Fix callback found after finding spell

This commit is contained in:
srose 2024-10-12 15:05:54 -04:00
parent 154bdbbd9f
commit 117a2fc63e
3 changed files with 9 additions and 8 deletions

View File

@ -32,8 +32,8 @@ class BattlegroundAgent:
self.tagInBg()
else:
self.logger.log("Deserter debuff found, waiting for debuff to disapear before tagging to bg...")
# self.inBgRoutine()
time.sleep(3)
self.logger.log("Battleground bg farming ended.")
def isDeserter(self):
res = self.monitor.findMatch(self.deserterIcon)
@ -64,10 +64,10 @@ class BattlegroundAgent:
self.inBgRoutine()
def foundEndOfBg(self ):
def foundEndOfBg(self, _res):
self.logger.log("End of bg detected, leaving...")
self.status = BG_STATUS.IDLE
time.sleep(10)
time.sleep(25)
def checkEndOfBg(self):
self.monitor.findMatchAndClickIfAvailable(self.leaveBgButton, self.foundEndOfBg)

View File

@ -89,13 +89,14 @@ class Monitor:
if (res == -1):
addHumanReaction()
if isfunction(onNotFound) is True:
if onNotFound is not None:
return onNotFound(res)
else:
addHumanReaction()
pyautogui.click()
addHumanReaction()
if (isfunction(onFound) is True):
print(isfunction(onFound))
if (onFound is not None):
return onFound(res)

View File

@ -26,12 +26,12 @@ class Player:
self.reconnectButton = cv.imread("assets/" + self.lang + "/menus/Reconnect.jpg", cv.IMREAD_GRAYSCALE)
self.logger.log("Connected with " + self.playerName + " (" + self.playerClass + " - " + self.playerSpe + ")")
def connectButtonFound(self):
def connectButtonFound(self, _res):
self.isConnected = CONNECT_STATUS.DISCONNECTED
self.logger.log("Player not connected attempting to connect...")
time.sleep(30)
def connectButtonNotFound(self):
def connectButtonNotFound(self, _res):
self.isConnected = CONNECT_STATUS.CONNECTED
def checkConnection(self):