-
Notifications
You must be signed in to change notification settings - Fork 1
/
bot.py
143 lines (115 loc) · 3.72 KB
/
bot.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
import pyautogui as pg
import keyboard as kb
from time import sleep
class Instagram:
def __init__(self):
self.renda = 0.0010
self.saldo = 0.0000
self.errosbt1 = 0
self.errosbt2 = 0
self.errosbt3 = 0
self.acertos = 0
self.teste = 1
def loop(self):
if self.teste == 1:
self.butao1()
sleep(5)
elif self.teste == 2:
self.butao2()
sleep(2)
elif self.teste == 3:
self.butao3()
def butao1(self):
falha = 0
for _ in range(6):
print('Procurando Seguir perfil')
instabt = pg.locateOnScreen('instabt.png')
if instabt:
print('\nBotao 1 encontrado')
pg.click(pg.center(instabt))
self.acertos += 1
self.teste += 1
break
elif falha >= 3:
kb.press_and_release('f5')
sleep(5)
elif falha == 6:
pg.click(470, 40)
pg.move(470, 400)
self.errosbt1 += 1
falha += 1
print(falha)
def butao2(self):
falha = 0
for _ in range(3):
print('Procurando Seguir no intagram')
seguirbt = pg.locateOnScreen('seguirbt.png')
seguirbt2 = pg.locateOnScreen('seguirbt2.png')
if seguirbt:
print('Botao 2 encontrado')
pg.click(pg.center(seguirbt))
sleep(1)
pg.click(470, 40)
self.acertos += 1
self.teste += 1
break
elif seguirbt2:
print('Botao 2 encontrado')
pg.click(pg.center(seguirbt2))
sleep(1)
pg.click(470, 40)
self.acertos += 1
self.teste += 1
break
elif falha == 2:
self.teste = 3
pg.click(470, 40)
pg.move(470, 400)
continue
print(falha)
falha += 1
self.errosbt2 += 1
sleep(2)
def butao3(self):
falha = 0
for _ in range(3):
print('Procurando botao proximo')
proximo = pg.locateOnScreen('proximo.png')
proximo2 = pg.locateOnScreen('proximo2.png')
if proximo:
pg.click(pg.center(proximo))
print('Botao proximo encontrado')
self.acertos += 1
self.saldo += self.renda
self.teste = 1
print("Relatorio"
f"\nSaldo = {self.saldo}"
f"\nAcertos {self.acertos}"
f"\nErros no bt1 {self.errosbt1}"
f"\nErros no bt2 {self.errosbt2}"
f"\nErros no bt3 {self.errosbt3}")
break
elif proximo2:
pg.click(pg.center(proximo2))
self.acertos = 1
self.saldo += self.renda
self.teste = 1
print("Relatorio"
f"\nSaldo = {self.saldo}"
f"\nAcertos {self.acertos}"
f"\nErros no bt1 {self.errosbt1}"
f"\nErros no bt2 {self.errosbt2}"
f"\nErros no bt3 {self.errosbt3}")
break
elif falha == 2:
kb.press_and_release('f5')
self.teste = 1
break
falha += 1
self.errosbt3 += 1
bot = Instagram()
while True:
for _ in range(20):
bot.loop()
kb.press_and_release('f5')
sleep(4)