Fix callback found after finding spell

This commit is contained in:
2024-10-12 15:05:54 -04:00
parent 154bdbbd9f
commit 117a2fc63e
3 changed files with 9 additions and 8 deletions
+4 -3
View File
@@ -79,7 +79,7 @@ class Monitor:
def findMatchAndMoveToPosition(self, template, method = "TM_CCOEFF_NORMED"):
point = self.findMatch(template, method)
if (point == -1):
return -1
return -1
addHumanReaction()
pyautogui.moveTo(point[0], point[1])
addHumanReaction()
@@ -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)
+2 -2
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):