Fishbot v1
This commit is contained in:
parent
d51914053c
commit
446e584b66
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
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 |
|
|
@ -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...")
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user