Made adjustment to determining if stash is full of gold. Also remade inv_no_gold picture as it would detect numbers starting with 91 as 0.
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.3 KiB |
@@ -89,13 +89,17 @@ def stash_all_items(items: list = None):
|
||||
if Config().char["stash_gold"]:
|
||||
if not is_visible(ScreenObjects.GoldNone):
|
||||
Logger.debug("Stashing gold")
|
||||
common.select_tab(min(1, stash.get_curr_stash()["gold"]))
|
||||
gold_tab = min(1, stash.get_curr_stash()["gold"])
|
||||
common.select_tab(gold_tab)
|
||||
wait(0.7, 1)
|
||||
stash_full_of_gold = False
|
||||
# Try to read gold count with OCR
|
||||
try:
|
||||
gold_amount = common.read_gold(grab(), "stash")
|
||||
stash_full_of_gold = ((gold_amount == 2500000) or (gold_amount==12500000))
|
||||
if gold_tab == 0:
|
||||
stash_full_of_gold = (gold_amount >= 2500000)
|
||||
else:
|
||||
stash_full_of_gold = (gold_amount >= 12500000)
|
||||
except: pass
|
||||
if not stash_full_of_gold:
|
||||
# If gold read by OCR fails, fallback to old method
|
||||
@@ -114,7 +118,7 @@ def stash_all_items(items: list = None):
|
||||
stash.set_curr_stash(gold = (stash.get_curr_stash()["gold"] + 1))
|
||||
if Config().general["info_screenshots"]:
|
||||
cv2.imwrite("./log/screenshots/info/info_gold_stash_full_" + time.strftime("%Y%m%d_%H%M%S") + ".png", grab())
|
||||
if stash.get_curr_stash()["gold"] > 3:
|
||||
if stash.get_curr_stash()["gold"] > 1:
|
||||
#decide if gold pickup should be disabled or gambling is active
|
||||
vendor.set_gamble_status(True)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user