Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

Commit

Permalink
bids only if logged in
Browse files Browse the repository at this point in the history
  • Loading branch information
rschultheis committed Sep 12, 2011
1 parent a69a962 commit affe522
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions site_bindings/quibids.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module QUIBIDS
@browser = nil
@last_amt = nil
@auction_els = nil
@logged_in = false

def start auction_id
@auction_id = auction_id if auction_id
Expand Down Expand Up @@ -67,10 +68,14 @@ def refresh_auction
def bid
sleep 0.1 #this pause can be tweaked to give better last second catches
if seconds_left < 3
@auction_els[:bid_btn].click
puts "BID clicked!"
if @logged_in
@auction_els[:bid_btn].click
puts "BID clicked!"
else
puts "BID would be clicked if logged in!"
end
else
puts "SKIPPED BID at the last second.... timer didn't look ready'"
puts "SKIPPED BID at the last second because timer went up"

end
end
Expand Down Expand Up @@ -116,6 +121,7 @@ def login username, password
@browser.text_field(:name, 'password').set password
@browser.button(:id, 'login-btn').click
goto_auction
@logged_in = true
end

end

0 comments on commit affe522

Please sign in to comment.