Skip to content

Commit 406aae0

Browse files
committed
added decrement for situations where we are on the cap
1 parent b5a954c commit 406aae0

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

core/bid.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,17 @@ def increment(bid):
1616
else:
1717
return 1000
1818

19+
def decrement(bid):
20+
if bid <= 1000:
21+
return 50
22+
elif bid <= 10000:
23+
return 100
24+
elif bid <= 50000:
25+
return 250
26+
elif bid <= 100000:
27+
return 500
28+
else:
29+
return 1000
1930

2031
def roundBid(bid):
2132
return int(increment(bid) * round(float(bid)/increment(bid)))
@@ -97,7 +108,7 @@ def bid(q, api, playerList, settings):
97108
# Search first 50 items in my price range to bid on within 5 minutes
98109
if not settings['snipeOnly']:
99110
bidon = 0
100-
subtract = increment(bidDetails[defId]['maxBid'])
111+
subtract = decrement(bidDetails[defId]['maxBid'])
101112
for item in api.searchAuctions('player', defId=defId, max_price=bidDetails[defId]['maxBid']-subtract, start=0, page_size=50):
102113
# player safety checks for every possible bid
103114
# Let's look at last 5 minutes for now and bid on 5 players max

core/watch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import math
2-
from core.bid import increment
2+
from core.bid import decrement
33

44
def lowestBin(q, api, defIds):
55

@@ -16,7 +16,7 @@ def find(api, defId, buy=None, num=0):
1616
num = sum([i['buyNowPrice'] == lowest for i in items])
1717
# If we have 50 of the same result, go one lower
1818
if num == 50:
19-
lowest -= increment(lowest)
19+
lowest -= decrement(lowest)
2020
if buy is None or lowest < buy:
2121
return find(api, defId, lowest, num)
2222
return (lowest, num)

0 commit comments

Comments
 (0)