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)
|
time.sleep(1)
|
||||||
self.findLure()
|
self.findLure()
|
||||||
self.lureLoc = res
|
self.lureLoc = res
|
||||||
|
time.sleep(0.2)
|
||||||
|
pyautogui.moveTo(res[0], res[1])
|
||||||
self.watchLure()
|
self.watchLure()
|
||||||
|
|
||||||
def watchLure(self):
|
def watchLure(self):
|
||||||
|
self.retry = 0
|
||||||
self.logger.log("Waiting for fish...")
|
self.logger.log("Waiting for fish...")
|
||||||
while True:
|
while True:
|
||||||
|
self.retry += 1
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
res = self.monitor.findMatch(self.fishingBobberImg)
|
res = self.monitor.findMatch(self.fishingBobberImg)
|
||||||
print(res)
|
print(res)
|
||||||
|
if (res != -1 and abs(res[1] - self.lureLoc[1]) > 20):
|
||||||
|
pyautogui.click()
|
||||||
def pullLine(self):
|
time.sleep(0.5)
|
||||||
self.logger.log("Pulling line!")
|
self.castLure()
|
||||||
|
elif (self.retry > 200):
|
||||||
|
self.castLure()
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
self.logger.log("Starting fishing thread in 3 seconds...")
|
self.logger.log("Starting fishing thread in 3 seconds...")
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ class Monitor:
|
||||||
|
|
||||||
matchRatio = max_val * 100
|
matchRatio = max_val * 100
|
||||||
self.logger.log(matchRatio)
|
self.logger.log(matchRatio)
|
||||||
if (matchRatio < 40):
|
if (matchRatio < 55):
|
||||||
self.logger.log("Cannot find matching result...")
|
self.logger.log("Cannot find matching result...")
|
||||||
return -1
|
return -1
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user