-
Notifications
You must be signed in to change notification settings - Fork 2
/
cch_blum_re.py
158 lines (129 loc) · 5.49 KB
/
cch_blum_re.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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
from pyautogui import *
import pygetwindow as gw
import pyautogui
import time
import keyboard
import random
from pynput.mouse import Button, Controller
import colorama
from colorama import Fore
colorama.init(autoreset=True)
mouse = Controller()
def print_intro():
print(r"""
_
( )_
___ _ __ _ _ _ _ | ,_) _
/'___)( '__)( ) ( )( '_`\ | | /'_`\
( (___ | | | (_) || (_) )| |_ ( (_) )
`\____)(_) `\__, || ,__/'`\__)`\___/'
( )_| || |
`\___/'(_)
_ _ _ _
(_ ) _ ( ) ( ) ( )
___ | | (_) ___ | |/') __ _ __ ___ | |__ _ _ | |_
/'___) | | | | /'___)| , < /'__`\( '__)/',__) | _ `\( ) ( )| '_`\
( (___ | | | |( (___ | |\`\ ( ___/| | \__, \ | | | || (_) || |_) )
`\____)(___)(_)`\____)(_) (_)`\____)(_) (____/ (_) (_)`\___/'(_,__/'
""")
print(Fore.RED + "Crypto Clickers Hub - t.me/cryptoapps0")
def print_message(message):
if "Play" in message:
print(Fore.MAGENTA + message)
else:
print(message)
def click(x, y):
mouse.position = (x, y + random.randint(1, 3))
mouse.press(Button.left)
mouse.release(Button.left)
def activate_window(window):
try:
if window.isMinimized:
window.restore()
window.activate()
return True
except Exception:
return False
def click_play_button(is_first_time):
try:
if is_first_time:
play_button_coords = (telegram_window.left + int(telegram_window.width * 0.75), telegram_window.top + int(telegram_window.height * 0.6))
else:
play_button_coords = (telegram_window.left + int(telegram_window.width * 0.5), telegram_window.top + int(telegram_window.height * 0.85) - 10) # Сместили вверх
if not activate_window(telegram_window):
pass
click(play_button_coords[0], play_button_coords[1])
print_message('[🌙] | Кнопка Play нажата.')
time.sleep(1)
except Exception as e:
pass
def find_and_click_bacteria():
scrn = pyautogui.screenshot(region=(telegram_window.left, telegram_window.top, telegram_window.width, telegram_window.height))
width, height = scrn.size
bacteria_found = False
for x in range(0, width, 20):
for y in range(0, height, 20):
r, g, b = scrn.getpixel((x, y))
if (b in range(0, 125)) and (r in range(102, 220)) and (g in range(200, 255)):
is_bomb = False
for bx in range(-5, 6):
for by in range(-5, 6):
if 0 <= x + bx < width and 0 <= y + by < height:
br, bg, bb = scrn.getpixel((x + bx, y + by))
if br in range(100, 160) and bg in range(100, 160) and bb in range(100, 160):
is_bomb = True
break
if is_bomb:
break
if not is_bomb:
screen_x = telegram_window.left + x
screen_y = telegram_window.top + y
click(screen_x + 4, screen_y)
time.sleep(0.001)
bacteria_found = True
return bacteria_found
def start_game():
window_name = input('\n[⚡️] | Crypto Clickers Hub | Нажми 1 ')
num_games = int(input('\n[☘️] | Введите количество игр, которые вы хотите сыграть: '))
if window_name == '1':
window_name = "TelegramDesktop"
check = gw.getWindowsWithTitle(window_name)
if not check:
print(f"[❌] | Окно - {window_name} не найдено!")
exit()
print(f"[☘️] | Окно найдено - {window_name}\n[☘️] | Нажмите 'q' для паузы.")
global telegram_window
telegram_window = check[0]
paused = False
games_played = 0
is_first_time = True
while games_played < num_games:
click_play_button(is_first_time)
is_first_time = False
game_start_time = time.time()
while time.time() - game_start_time < 31:
if keyboard.is_pressed('q'):
paused = not paused
if paused:
print('[🌙] | Пауза')
else:
print('[🌙] | Возобновление работы')
time.sleep(1)
while paused:
if keyboard.is_pressed('q'):
paused = False
print('[🌙] | Возобновление работы')
time.sleep(1)
bacteria_found = find_and_click_bacteria()
if not bacteria_found and not paused:
time.sleep(0.1)
games_played += 1
print(f"[🌕] | Игра завершена. Игр сыграно: {games_played}")
if games_played < num_games:
is_first_time = False
time.sleep(2)
print(f'[☘️] | {num_games} билетов потрачено, скрипт приостановлен.')
if __name__ == "__main__":
print_intro()
while True:
start_game()