Add humanReaction

This commit is contained in:
2024-10-10 20:29:15 -04:00
parent 0b8d761a37
commit 154bdbbd9f
3 changed files with 17 additions and 9 deletions
+5 -4
View File
@@ -6,6 +6,7 @@ import cv2 as cv
import pyautogui
from core.Logger import Logger
from core.Player import PLAYER_STATE
from core.utils import addHumanReaction
class FishingAgent:
def __init__(self, monitor, player) -> None:
@@ -58,24 +59,24 @@ class FishingAgent:
time.sleep(1)
self.findLure()
else:
time.sleep(0.5)
addHumanReaction()
pyautogui.moveTo(res[0], res[1])
self.watchLure()
def watchLure(self):
self.retry = 0
self.logger.log("Waiting for fish...")
time.sleep(0.4)
addHumanReaction()
res = self.monitor.findMatch(self.fishingBobberImg)
if (res != -1):
self.lureLoc = res
while True:
self.retry += 1
time.sleep(0.1)
addHumanReaction()
res = self.monitor.findMatch(self.fishingBobberImg)
print(res)
if (res == -1 or abs(res[1] - self.lureLoc[1]) > 20):
time.sleep(0.2)
addHumanReaction()
pyautogui.click()
return
elif (self.retry > 150):