Add humanReaction
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user