Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Commit

Permalink
feat(farmer): add platinum chest for free_chest_farmer_thread
Browse files Browse the repository at this point in the history
Signed-off-by: hldh214 <[email protected]>
  • Loading branch information
hldh214 committed Jul 4, 2023
1 parent 46733f5 commit 1522540
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions lokbot/farmer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1103,13 +1103,17 @@ def free_chest_farmer_thread(self, _type=0):

raise

next_gold = arrow.get(res.get('freeChest', {}).get('gold', {}).get('next'))
next_silver = arrow.get(res.get('freeChest', {}).get('silver', {}).get('next'))
next_dict = {
0: arrow.get(res.get('freeChest', {}).get('silver', {}).get('next')),
1: arrow.get(res.get('freeChest', {}).get('gold', {}).get('next')),
2: arrow.get(res.get('freeChest', {}).get('platinum', {}).get('next')),
}
next_type = min(next_dict, key=next_dict.get)

if next_gold < next_silver:
threading.Timer(self.calc_time_diff_in_seconds(next_gold), self.free_chest_farmer_thread, [1]).start()
else:
threading.Timer(self.calc_time_diff_in_seconds(next_silver), self.free_chest_farmer_thread, [0]).start()
threading.Timer(
self.calc_time_diff_in_seconds(next_dict[next_type]),
self.free_chest_farmer_thread, [next_type]
).start()

def use_resource_in_item_list(self):
"""
Expand Down

0 comments on commit 1522540

Please sign in to comment.