Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions core/watch.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@ def find(api, defId, buy=0, num=0):
lowest = buy
items = api.searchAuctions('player', defId=defId, max_buy=buy, page_size=50)
if items:
lowest = min([i['buyNowPrice'] for i in items])
num = sum([i['buyNowPrice'] == lowest for i in items])
buyNowArray = [i['buyNowPrice'] for i in items]
# Use the third lowest as result, to eliminate unusual low data point.
lowest = sorted(buyNowArray)[min(2, len(buyNowArray) - 1)]
num = sum([i['buyNowPrice'] <= lowest for i in items])
# If we have 50 of the same result, go one lower
if num == 50:
lowest -= decrement(lowest)
if num < 50:
return (lowest, num)
if buy == 0 or lowest < buy:
return find(api, defId, lowest, num)
return (lowest, num)
Expand Down
2 changes: 2 additions & 0 deletions frames/bid.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,8 @@ def setPrice(self, item, sell):
item['buy'] = roundBid(sell*self.settings['buy'])
item['sell'] = roundBid(sell*self.settings['sell'])
item['bin'] = roundBid(sell*self.settings['bin'])
if item['bin'] <= item['sell']:
item['bin'] = item['sell'] + increment(item['sell'])
self.tree.set(item['player']['id'], 'buy', item['buy'])
self.tree.set(item['player']['id'], 'sell', item['sell'])
self.tree.set(item['player']['id'], 'bin', item['bin'])
Expand Down