Skip to content

Commit 1bb3602

Browse files
committed
X-mas update
1 parent ced1cab commit 1bb3602

File tree

3 files changed

+42
-4
lines changed

3 files changed

+42
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ ___
33
A simple autoclicker for blum drop mini-game on python (autoclicker collects **$dogs**)
44

55
### Football mode:
6-
- run `main.py --football` to enable football mode
6+
- run `main.py --xmas` to enable christmas mode
77

88
## Usage
99
- Start tg app, then `main.py` and press play

constants.py

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"""On different devices app size is also different,
44
so i located triggers on mine and devided it by window size on my pc,
55
in game this coefficients are multiplied by actual window size to get correct coordinates"""
6+
CHRISTMAS_MODE = '--xmas' in sys.argv
67
HALLOWEEN_MODE = '--halloween' in sys.argv
78
ELECTIONS_MODE = '--elections' in sys.argv
89
FOOTBALL_MODE = '--football' in sys.argv
@@ -56,15 +57,45 @@
5657
}
5758
]
5859

60+
# X-mas update
61+
CHRISTMAS_COLOR_TRIGGERS = [
62+
{
63+
"red":{"min":240, "max":255},
64+
"green":{"min":0, "max":15},
65+
"blue":{"min":120, "max":200}
66+
},
67+
{
68+
"red":{"min":50, "max":120},
69+
"green":{"min":100, "max":210},
70+
"blue":{"min":5, "max":40}
71+
},
72+
{
73+
"red":{"min":130, "max":180},
74+
"green":{"min":50, "max":80},
75+
"blue":{"min":0, "max":20}
76+
},
77+
{
78+
"red":{"min":250, "max":255},
79+
"green":{"min":150, "max":190},
80+
"blue":{"min":0, "max":20}
81+
},
82+
{
83+
"red":{"min":230, "max":240},
84+
"green":{"min":85, "max":160},
85+
"blue":{"min":70, "max":140}
86+
}
87+
]
88+
5989

6090
HELP_STRING = \
6191
"""
6292
Usage: main.py [AMOUNT OF GAMES] [OPTIONS]
6393
6494
Options:
6595
--help - show this string
96+
--xmas - enable christmas mode
6697
--halloween - enable halloween mode
67-
--football - enable football mode
98+
--football - enable football mode
6899
--elections - enable elections mode
69100
--disable-dogs - don't collect dogs
70101
--click-limit=n - limit clicks (Example: --click-limit=0.05, only 5% of clicks)

main.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
HELP_STRING,
1818
FOOTBALL_MODE,
1919
ELECTIONS_MODE,
20+
CHRISTMAS_MODE,
2021
HALLOWEEN_MODE,
2122
DOGS_DROP_TOGGLE,
2223
AVG_GAME_DURATION,
@@ -27,6 +28,7 @@
2728
DEFAULT_COLOR_TRIGGER,
2829
DOGS_WHITE_COLOR_RANGE,
2930
HALLOWEEN_COLOR_TRIGGER,
31+
CHRISTMAS_COLOR_TRIGGERS,
3032
ELECTIONS_COLOR_TRIGGERS,
3133
)
3234

@@ -57,7 +59,7 @@ def check_object(frame, x:int, y:int) -> bool:
5759
""" Finding dropping objects by color """
5860

5961
def _check_color_trigger(color_trigger, limit:bool=True):
60-
if not limit and random.random() > CLICK_LIMIT:
62+
if limit and random.random() > CLICK_LIMIT:
6163
return False
6264

6365
if color_trigger['red']['min'] <= frame[y][x][0] <= color_trigger['red']['max']:
@@ -70,6 +72,11 @@ def _check_color_trigger(color_trigger, limit:bool=True):
7072
if HALLOWEEN_MODE:
7173
if _check_color_trigger(HALLOWEEN_COLOR_TRIGGER) or _check_color_trigger(BOMB_COLOR_TRIGGER):
7274
return True
75+
elif CHRISTMAS_MODE:
76+
for trigger in CHRISTMAS_COLOR_TRIGGERS:
77+
if _check_color_trigger(trigger):
78+
return True
79+
return False
7380
else:
7481
if _check_color_trigger(DEFAULT_COLOR_TRIGGER):
7582
return True
@@ -165,7 +172,7 @@ def main():
165172
mouse.move(x, y, absolute=True)
166173
mouse.click(button='left')
167174

168-
time.sleep(0.3)
175+
time.sleep(0.28)
169176
frame = camera.get_latest_frame()
170177
else:
171178
print('Finished')

0 commit comments

Comments
 (0)