-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.py
91 lines (45 loc) · 1.89 KB
/
index.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
import pyautogui
import time
from colorama import Fore, Style
import sys
import os
# Made by <3 by Walkoud
print(Fore.RED + Style.BRIGHT + """
___ __ ____________ ___ _________________ ______
/ _ |/ / / /_ __/ __ \ / _ |/ ___/ ___/ __/ _ \/_ __/
/ __ / /_/ / / / / /_/ / / __ / /__/ /__/ _// ___/ / /
/_/ |_\____/ /_/ \____/ /_/ |_\___/\___/___/_/ /_/
"""+ Fore.BLUE + """
By Walkoud v1 """ + Fore.YELLOW + """
____________
/ ___/ __/_ |
/ /___\ \/ __/
\___/___/____/
"""+ Fore.WHITE + """
https://github.com/walkoud
""")
print(Fore.GREEN + "Starting in 3 seconds !" + Style.RESET_ALL)
def resource_path(relative_path):
""" Get absolute path to resource, works for dev and for PyInstaller """
try:
# PyInstaller creates a temp folder and stores path in _MEIPASS
base_path = sys._MEIPASS
except Exception:
base_path = os.path.abspath(".")
return os.path.join(base_path, relative_path)
# Utilisation de la fonction resource_path pour obtenir le chemin absolu de "image.png"
image_path = resource_path("image.png")
def detect_and_click(image_path):
time.sleep(3)
while True:
try:
x, y = pyautogui.locateCenterOnScreen(image_path)
pyautogui.click(x, y)
print(Fore.GREEN + "CLICKED IN AUTOACCEPT Successfully" + Style.RESET_ALL)
print(Fore.GREEN + "ReStarting in 3 seconds !" + Style.RESET_ALL)
time.sleep(3)
except TypeError:
print("Searching accept button... Retrying in 1 seconds...")
time.sleep(1)
detect_and_click(image_path)
# Made by <3 by Walkoud