-
Notifications
You must be signed in to change notification settings - Fork 0
/
fish.py
66 lines (59 loc) · 1.92 KB
/
fish.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
import pyautogui
import time
import sys
import os
import shlex
import subprocess
count = 0
print("Initializing bot please minimize this screen and mantain your fishes on the screen...")
print("Starting...")
botoes = list(pyautogui.locateAllOnScreen('botao.jpg',confidence = 0.95))
for botao in botoes:
while True:
count+=1
try:
l,t,w,h = botao
x,y=int(l+(w/2)),int(t+(h/2))
pyautogui.moveTo((x,y), duration=0.3, tween=pyautogui.easeInOutQuad)
pyautogui.click()
time.sleep(2)
hungry = pyautogui.locateCenterOnScreen('hungry.jpg', confidence = 0.90)
print(count,"Hungry:", hungry)
if hungry is None:
form = pyautogui.locateCenterOnScreen('form.jpg', confidence = 0.90)
print(count,"Form:", form)
pyautogui.moveTo(form, duration=0.3, tween=pyautogui.easeInOutQuad)
if form is None:
fechar = list(pyautogui.locateCenterOnScreen('fechar.jpg', confidence = 0.80))
print(count,"Fechar:", fechar)
pyautogui.moveTo(fechar, duration=0.3, tween=pyautogui.easeInOutQuad)
pyautogui.click()
time.sleep(0.5)
break
else:
fechar = list(pyautogui.locateCenterOnScreen('fechar.jpg', confidence = 0.80))
print(count,"Fechar:", fechar)
pyautogui.moveTo(fechar, duration=0.3, tween=pyautogui.easeInOutQuad)
pyautogui.click()
time.sleep(0.5)
break
pyautogui.click()
pyautogui.press('down')
time.sleep(0.5)
pyautogui.press('enter')
feed = pyautogui.locateCenterOnScreen('feed.jpg', confidence = 0.90)
print(count,"Feed:", feed)
pyautogui.moveTo(feed, duration=0.3, tween=pyautogui.easeInOutQuad)
pyautogui.click()
time.sleep(2)
break
except Exception as e:
print(count,"Erro", e)
continue
print("Feed complete!!!")
print("If you like this project please buy some Eggs with my discount code: MasterRoot")
sys.exit(0)
# time.sleep(300)
# invent = pyautogui.locateCenterOnScreen('invent.jpg', confidence = 0.90)
# pyautogui.click()
# time.sleep(5)