Skip to content

Commit

Permalink
credits check inside loops
Browse files Browse the repository at this point in the history
  • Loading branch information
hunterjm committed Nov 20, 2015
1 parent 9a9f4dd commit 68503e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/bid.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def bid(q, api, playerList, settings, trades={}):
for item in api.searchAuctions('player', defId=defId, max_buy=bidDetails[defId]['maxBid'], start=0, page_size=50):

# player safety checks for every possible bid
if listed >= settings['maxPlayer']:
if listed >= settings['maxPlayer'] or api.credits < settings['minCredits']:
break

# No Dups
Expand Down Expand Up @@ -78,7 +78,7 @@ def bid(q, api, playerList, settings, trades={}):

# player safety checks for every possible bid
# Let's look at last 5 minutes for now and bid on 5 players max
if item['expires'] > 600 or bidon >= 5 or listed >= settings['maxPlayer']:
if item['expires'] > 600 or bidon >= 5 or listed >= settings['maxPlayer'] or api.credits < settings['minCredits']:
break

# No Dups
Expand Down

0 comments on commit 68503e2

Please sign in to comment.