Bugfix: Reduce identify time at cain (#837)

This commit is contained in:
mgleed
2022-06-06 20:55:46 -04:00
committed by GitHub
parent 084bdb6573
commit 8db079f720
2 changed files with 15 additions and 4 deletions
+13 -2
View File
@@ -1,3 +1,4 @@
import keyboard
import template_finder
from config import Config
from pather import Location
@@ -161,12 +162,22 @@ class TownManager:
# check if we can Identify in current act
if self._acts[curr_act].can_identify():
success = self._acts[curr_act].identify(curr_loc)
view.return_to_play()
if success:
wait(0.2)
# close cain dialog so inventory key is not blocked
keyboard.send("esc")
else:
view.return_to_play()
return success
new_loc = self.go_to_act(5, curr_loc)
if not new_loc: return False
success = self._acts[Location.A5_TOWN_START].identify(new_loc)
view.return_to_play()
if success:
wait(0.2)
# close cain dialog so inventory key is not blocked
keyboard.send("esc")
else:
view.return_to_play()
return success
def open_stash(self, curr_loc: Location) -> Location | bool:
+2 -2
View File
@@ -81,7 +81,7 @@ def return_to_play() -> bool:
substrings = ["NPC", "Panel", "SaveAndExit"]
img=grab()
start=time.time()
while (elapsed := (time.time() - start) < 8):
while (elapsed := (time.time() - start) < 5):
need_escape = False
match = detect_screen_object(ScreenObjects.InGame, img)
if match.valid and "DARK" in match.name:
@@ -92,7 +92,7 @@ def return_to_play() -> bool:
break
if need_escape:
keyboard.send("esc")
wait(1.7)
wait(1)
img=grab()
else:
break