diff --git a/assets/npc/missing_gold/missing_gold.png b/assets/npc/missing_gold/missing_gold.png new file mode 100644 index 0000000..3987d01 Binary files /dev/null and b/assets/npc/missing_gold/missing_gold.png differ diff --git a/config/params.ini b/config/params.ini index 2da2219..154d079 100644 --- a/config/params.ini +++ b/config/params.ini @@ -8,7 +8,7 @@ ; bnet_pass=${BOTTY_BNET_PASS} ; char_name=${BOTTY_CHAR_NAME} ; difficulty: game difficulty to create ("normal", "nightmare", "hell") -difficulty=nightmare +difficulty=hell ; name: bot profile name used in logs/messages and mod launch option replacement name=fistman ; randomize_runs: 0 = run in listed order, 1 = shuffle run order diff --git a/src/inventory/vendor.py b/src/inventory/vendor.py index dcaef04..673ac6a 100644 --- a/src/inventory/vendor.py +++ b/src/inventory/vendor.py @@ -9,6 +9,8 @@ from logger import Logger from input_layer import mouse from ui_manager import center_mouse, is_visible, select_screen_object_match, wait_until_visible, ScreenObjects from inventory import personal, common, stash +from utils.log_rotation import safe_imwrite +import time gamble_count = 0 gamble_status = False @@ -44,6 +46,7 @@ def repair() -> bool: select_screen_object_match(repair_btn) if wait_until_visible(ScreenObjects.NotEnoughGold, 1).valid: Logger.warning("Couldn't repair--out of gold. Continue.") + safe_imwrite(f"./log/screenshots/info/info_not_enough_gold_repair_{time.strftime('%Y%m%d_%H%M%S')}.png", grab()) keyboard.send("esc") return False return True @@ -70,6 +73,7 @@ def gamble(): # make sure the "not enough gold" message doesn't exist if is_visible(ScreenObjects.NotEnoughGold, img): Logger.warning(f"Out of gold, stop gambling") + safe_imwrite(f"./log/screenshots/info/info_not_enough_gold_gambling_{time.strftime('%Y%m%d_%H%M%S')}.png", img) keyboard.send("esc") set_gamble_status(False) break @@ -118,6 +122,7 @@ def buy_item(template_name: str, quantity: int = 1, img: np.ndarray = None, shif wait(0.4, 0.6) if is_visible(ScreenObjects.NotEnoughGold): Logger.warning(f"Out of gold, could not purchase {template_name}") + safe_imwrite(f"./log/screenshots/info/info_not_enough_gold_purchase_{time.strftime('%Y%m%d_%H%M%S')}.png", grab()) keyboard.send('shift', do_release=True) keyboard.send("esc") return False @@ -131,6 +136,7 @@ def buy_item(template_name: str, quantity: int = 1, img: np.ndarray = None, shif wait(0.9, 1.1) if is_visible(ScreenObjects.NotEnoughGold): Logger.warning(f"Out of gold, could not purchase {template_name}") + safe_imwrite(f"./log/screenshots/info/info_not_enough_gold_purchase_{time.strftime('%Y%m%d_%H%M%S')}.png", grab()) keyboard.send("esc") return False personal.set_inventory_gold_full(False) diff --git a/src/ui_manager.py b/src/ui_manager.py index 25c9ad2..4809755 100644 --- a/src/ui_manager.py +++ b/src/ui_manager.py @@ -251,10 +251,8 @@ class ScreenObjects: threshold=0.8, ) NotEnoughGold=ScreenObject( - ref="NOT_ENOUGH_GOLD", - threshold=0.9, - color_match=Config().colors["red"], - use_grayscale=True + ref="MISSING_GOLD", + threshold=0.8, ) QuestSkillBtn=ScreenObject( ref="QUEST_SKILL_BTN",