Fishing agent first draft

This commit is contained in:
2024-09-03 00:23:14 -04:00
parent eedc65f853
commit 05c04e3bac
14 changed files with 90 additions and 45 deletions
+15 -19
View File
@@ -6,29 +6,19 @@ import time
import cv2 as cv
import numpy as np
import pyautogui
from core.Logger import Logger
class FishingAgent:
def __init__(self, mainAgent) -> None:
self.mainAgent = mainAgent
# interpolate here_path to get the path to the fishing target image
def __init__(self, monitor) -> None:
self.logger = Logger("Fishing Agent")
self.monitor = monitor
assetPath = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
"assets"
"..\\..\\assets"
)
assetPath = os.path.dirname(os.path.realpath(__file__))
print(assetPath)
self.fishingBobber = cv.imread(
os.path.join(
assetPath,
"assets", "Bobber.png"
)
)
self.fishingBobberImg = cv.imread(os.path.join(assetPath,"fishing","Bobber.png"), cv.IMREAD_GRAYSCALE)
self.fishingThread = None
def agentLog(self, log: str):
print("Fishing Agent: " + log)
def castLure(self):
self.agentLog("Casting Lure.")
# pyautogui.press('1')
@@ -59,11 +49,17 @@ class FishingAgent:
def pullLine(self):
self.agentLog("Pulling line!")
def test(self):
while True:
time.sleep(1)
self.logger.log("###")
self.monitor.findMatch(self.fishingBobberImg)
def run(self):
if self.mainAgent.currImg is None:
print("Image capture not found! Did you start the screen capture thread?")
if self.monitor.screenshot is None:
self.logger.log("Screenshot capture not found...")
return
print("Starting fishing thread in 10 seconds...")
self.logger.log("Starting fishing thread in 3 seconds...")
time.sleep(3)
# print("Switching to fishing hotbar (hotbar 4)")
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1010 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 MiB