Skip to content

Commit 11ed4c9

Browse files
committed
Init bot files
1 parent c5e29ae commit 11ed4c9

7 files changed

+375
-0
lines changed

clicker_bot.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import time
2+
import pyautogui
3+
4+
time.sleep(2)
5+
6+
gift_pos = (579, 513)
7+
8+
purchasable_color = (41, 44, 51)
9+
10+
x = 1345
11+
upgrades_y = [493, 583, 670, 756]
12+
13+
while True:
14+
for i in range(20):
15+
pyautogui.click(gift_pos[0], gift_pos[1])
16+
17+
for y in upgrades_y[::-1]:
18+
if pyautogui.pixel(x * 2, y * 2) == purchasable_color:
19+
pyautogui.click(x, y)

commands.ipynb

Lines changed: 293 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,293 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"### Tutoriel PyAutoGUI"
8+
]
9+
},
10+
{
11+
"cell_type": "markdown",
12+
"metadata": {},
13+
"source": [
14+
"#### Importer PyAutoGUI"
15+
]
16+
},
17+
{
18+
"cell_type": "code",
19+
"execution_count": 4,
20+
"metadata": {},
21+
"outputs": [],
22+
"source": [
23+
"import pyautogui"
24+
]
25+
},
26+
{
27+
"cell_type": "markdown",
28+
"metadata": {},
29+
"source": [
30+
"#### Les fonctions de taille et position"
31+
]
32+
},
33+
{
34+
"cell_type": "code",
35+
"execution_count": null,
36+
"metadata": {},
37+
"outputs": [],
38+
"source": [
39+
"print(pyautogui.size())"
40+
]
41+
},
42+
{
43+
"cell_type": "code",
44+
"execution_count": null,
45+
"metadata": {},
46+
"outputs": [],
47+
"source": [
48+
"print(pyautogui.position())"
49+
]
50+
},
51+
{
52+
"cell_type": "markdown",
53+
"metadata": {},
54+
"source": [
55+
"#### Les fonctions de la souris"
56+
]
57+
},
58+
{
59+
"cell_type": "code",
60+
"execution_count": 5,
61+
"metadata": {},
62+
"outputs": [],
63+
"source": [
64+
"pyautogui.moveTo(860, 550)"
65+
]
66+
},
67+
{
68+
"cell_type": "code",
69+
"execution_count": 6,
70+
"metadata": {},
71+
"outputs": [],
72+
"source": [
73+
"pyautogui.moveTo(860, 550, 1)"
74+
]
75+
},
76+
{
77+
"cell_type": "code",
78+
"execution_count": 7,
79+
"metadata": {},
80+
"outputs": [],
81+
"source": [
82+
"pyautogui.move(200, 200)"
83+
]
84+
},
85+
{
86+
"cell_type": "code",
87+
"execution_count": 8,
88+
"metadata": {},
89+
"outputs": [],
90+
"source": [
91+
"pyautogui.move(200, 200, 1)"
92+
]
93+
},
94+
{
95+
"cell_type": "code",
96+
"execution_count": null,
97+
"metadata": {},
98+
"outputs": [],
99+
"source": [
100+
"pyautogui.click(500, 500)"
101+
]
102+
},
103+
{
104+
"cell_type": "code",
105+
"execution_count": null,
106+
"metadata": {},
107+
"outputs": [],
108+
"source": [
109+
"pyautogui.doubleClick(500, 500)"
110+
]
111+
},
112+
{
113+
"cell_type": "code",
114+
"execution_count": null,
115+
"metadata": {},
116+
"outputs": [],
117+
"source": [
118+
"pyautogui.middleClick(500, 500)"
119+
]
120+
},
121+
{
122+
"cell_type": "code",
123+
"execution_count": null,
124+
"metadata": {},
125+
"outputs": [],
126+
"source": [
127+
"pyautogui.rightClick(500, 500)"
128+
]
129+
},
130+
{
131+
"cell_type": "code",
132+
"execution_count": null,
133+
"metadata": {},
134+
"outputs": [],
135+
"source": [
136+
"pyautogui.scroll(10)"
137+
]
138+
},
139+
{
140+
"cell_type": "code",
141+
"execution_count": null,
142+
"metadata": {},
143+
"outputs": [],
144+
"source": [
145+
"pyautogui.scroll(-10)"
146+
]
147+
},
148+
{
149+
"cell_type": "code",
150+
"execution_count": null,
151+
"metadata": {},
152+
"outputs": [],
153+
"source": [
154+
"pyautogui.hscroll(10)"
155+
]
156+
},
157+
{
158+
"cell_type": "code",
159+
"execution_count": null,
160+
"metadata": {},
161+
"outputs": [],
162+
"source": [
163+
"pyautogui.hscroll(-10)"
164+
]
165+
},
166+
{
167+
"cell_type": "markdown",
168+
"metadata": {},
169+
"source": [
170+
"#### Les fonctions du clavier"
171+
]
172+
},
173+
{
174+
"cell_type": "code",
175+
"execution_count": null,
176+
"metadata": {},
177+
"outputs": [],
178+
"source": [
179+
"pyautogui.write(\"Abonnez-vous !\")"
180+
]
181+
},
182+
{
183+
"cell_type": "code",
184+
"execution_count": null,
185+
"metadata": {},
186+
"outputs": [],
187+
"source": [
188+
"pyautogui.write(\"Abonnez-vous !\", interval=0.1)"
189+
]
190+
},
191+
{
192+
"cell_type": "code",
193+
"execution_count": null,
194+
"metadata": {},
195+
"outputs": [],
196+
"source": [
197+
"pyautogui.press('enter')"
198+
]
199+
},
200+
{
201+
"cell_type": "code",
202+
"execution_count": null,
203+
"metadata": {},
204+
"outputs": [],
205+
"source": [
206+
"pyautogui.keyDown('ctrl')\n",
207+
"pyautogui.press('c')\n",
208+
"pyautogui.keyUp('ctrl')"
209+
]
210+
},
211+
{
212+
"cell_type": "code",
213+
"execution_count": null,
214+
"metadata": {},
215+
"outputs": [],
216+
"source": [
217+
"with pyautogui.hold('ctrl'):\n",
218+
" pyautogui.press('c')"
219+
]
220+
},
221+
{
222+
"cell_type": "markdown",
223+
"metadata": {},
224+
"source": [
225+
"#### Les fonctions d'écran"
226+
]
227+
},
228+
{
229+
"cell_type": "code",
230+
"execution_count": null,
231+
"metadata": {},
232+
"outputs": [],
233+
"source": [
234+
"pyautogui.screenshot()"
235+
]
236+
},
237+
{
238+
"cell_type": "code",
239+
"execution_count": null,
240+
"metadata": {},
241+
"outputs": [],
242+
"source": [
243+
"sc = pyautogui.screenshot(region=(100, 100, 200, 200))"
244+
]
245+
},
246+
{
247+
"cell_type": "code",
248+
"execution_count": null,
249+
"metadata": {},
250+
"outputs": [],
251+
"source": [
252+
"sc.save('image.png')"
253+
]
254+
},
255+
{
256+
"cell_type": "code",
257+
"execution_count": null,
258+
"metadata": {},
259+
"outputs": [],
260+
"source": [
261+
"pyautogui.pixel(400, 400)"
262+
]
263+
},
264+
{
265+
"cell_type": "code",
266+
"execution_count": null,
267+
"metadata": {},
268+
"outputs": [],
269+
"source": []
270+
}
271+
],
272+
"metadata": {
273+
"kernelspec": {
274+
"display_name": ".abonnez-vous",
275+
"language": "python",
276+
"name": "python3"
277+
},
278+
"language_info": {
279+
"codemirror_mode": {
280+
"name": "ipython",
281+
"version": 3
282+
},
283+
"file_extension": ".py",
284+
"mimetype": "text/x-python",
285+
"name": "python",
286+
"nbconvert_exporter": "python",
287+
"pygments_lexer": "ipython3",
288+
"version": "3.12.0"
289+
}
290+
},
291+
"nbformat": 4,
292+
"nbformat_minor": 2
293+
}

get_color.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import time
2+
import pyautogui
3+
4+
time.sleep(2)
5+
6+
coords = pyautogui.position()
7+
8+
print(coords, '=', pyautogui.pixel(coords[0], coords[1]))

get_position.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import time
2+
import pyautogui
3+
4+
time.sleep(2)
5+
6+
print(pyautogui.position())

image_bot.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import time
2+
import pyautogui
3+
4+
time.sleep(2)
5+
6+
while True:
7+
try:
8+
mole = pyautogui.locateCenterOnScreen(
9+
'images/taupe.png',
10+
region=(554 * 2, 356 * 2, (1117 - 554) * 2, (870 - 356) * 2),
11+
grayscale=True,
12+
confidence=0.6
13+
)
14+
15+
pyautogui.click(mole[0] / 2, mole[1] / 2)
16+
except pyautogui.ImageNotFoundException:
17+
print("Image pas trouvée")
18+
19+
time.sleep(0.5)

move_mouse.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import time
2+
import pyautogui
3+
4+
time.sleep(2)
5+
6+
origin = (743, 348)
7+
8+
temp_y = 792
9+
temp_x = 805
10+
11+
distance_x = temp_x - origin[0]
12+
distance_y = temp_y - origin[1]
13+
14+
pyautogui.moveTo(origin[0], origin[1])
15+
pyautogui.move(0, distance_y, 0.7)
16+
pyautogui.move(distance_x, 0, 0.1)
17+
pyautogui.move(0, -distance_y, 0.7)
18+
pyautogui.move(distance_x, 0, 0.1)
19+
pyautogui.move(0, distance_y, 0.7)
20+
pyautogui.move(distance_x, 0, 0.1)
21+
pyautogui.move(0, -distance_y, 0.7)
22+
pyautogui.move(distance_x, 0, 0.1)
23+
pyautogui.move(0, distance_y, 0.7)

text_bot.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import time
2+
import pyautogui
3+
4+
time.sleep(2)
5+
6+
im = pyautogui.screenshot(region=(675, 398, 772 - 675, 699 - 398))
7+
im.save('rose.png')

0 commit comments

Comments
 (0)