Fishbot v1

This commit is contained in:
srose 2024-09-09 23:22:29 -04:00
parent d51914053c
commit 446e584b66
5 changed files with 11 additions and 5 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
assets/fishing/Bobber.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 348 KiB

After

Width:  |  Height:  |  Size: 308 KiB

View File

@ -42,18 +42,24 @@ class FishingAgent:
time.sleep(1)
self.findLure()
self.lureLoc = res
time.sleep(0.2)
pyautogui.moveTo(res[0], res[1])
self.watchLure()
def watchLure(self):
self.retry = 0
self.logger.log("Waiting for fish...")
while True:
self.retry += 1
time.sleep(0.1)
res = self.monitor.findMatch(self.fishingBobberImg)
print(res)
def pullLine(self):
self.logger.log("Pulling line!")
if (res != -1 and abs(res[1] - self.lureLoc[1]) > 20):
pyautogui.click()
time.sleep(0.5)
self.castLure()
elif (self.retry > 200):
self.castLure()
def run(self):
self.logger.log("Starting fishing thread in 3 seconds...")

View File

@ -53,7 +53,7 @@ class Monitor:
matchRatio = max_val * 100
self.logger.log(matchRatio)
if (matchRatio < 40):
if (matchRatio < 55):
self.logger.log("Cannot find matching result...")
return -1