From 31440a9776803e0c1bd81edff0dcb8e03c3e814e Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Thu, 23 Feb 2023 21:30:46 +0700 Subject: [PATCH] Only show drills that aren't actively staking --- mm.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/mm.py b/mm.py index 4fbff4d..c34f6e0 100644 --- a/mm.py +++ b/mm.py @@ -71,9 +71,8 @@ def get_active_stakes(source_id): cursor = conn.cursor() cursor.execute(""" - SELECT staking_event.id, staking_event.source_id, staking_event.well_id, - staking_event.inventory_item_id, staking_event.duration_in_mins, - staking_event.created_at + SELECT staking_event.id, source_id, well_id, inventory_item_id, + duration_in_mins, staking_event.created_at FROM staking_event LEFT JOIN claim_event ON staking_event.id = claim_event.staking_event_id WHERE staking_event.source_id = ? AND claim_event.staking_event_id IS NULL; @@ -268,8 +267,14 @@ def draw_moons(): for name,(supply,ts) in wells.items(): im.text(f"{name.capitalize()}: {supply}") - items = [(item[0], world.store[item[1][0]][0]) for item in world.inventory.items()] - for item_id,item_name in items: + for item_id,(store_id,_) in world.inventory.items(): + item_name = world.store[store_id][0] + skip = False + for ss in world.staking_sources[source_id][2].values(): + if ss[2] == item_id: + skip = True + if skip == True: + continue im.push_id(f"Mine{id}{name}") if im.button(item_name): mine(source_id, name, item_id)