Skip to content

Commit d6017e4

Browse files
committed
elections mode
1 parent dc494aa commit d6017e4

File tree

3 files changed

+27
-5
lines changed

3 files changed

+27
-5
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
___
33
A simple autoclicker for blum drop mini-game on python (autoclicker collects **$dogs**)
44

5-
### Halloween mode:
6-
- run `main.py --halloween` to enable halloween mode (bot will collect pumpkins and bombs)
5+
### Elections mode:
6+
- run `main.py --elections` to enable elections mode
77

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

constants.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
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"""
66
HALLOWEEN_MODE = '--halloween' in sys.argv
7+
ELECTIONS_MODE = '--elections' in sys.argv
78
DOGS_DROP_TOGGLE = '--disable-dogs' not in sys.argv
89

910
CLICK_LIMIT = 1.0
@@ -40,6 +41,20 @@
4041
"green":{"min":125, "max":135},
4142
"blue":{"min":125, "max":135}}
4243

44+
#Election
45+
ELECTIONS_COLOR_TRIGGERS = [
46+
{
47+
"red":{"min":250, "max":255},
48+
"green":{"min":130, "max":140},
49+
"blue":{"min":90, "max":105}
50+
},
51+
{
52+
"red":{"min":220, "max":230},
53+
"green":{"min":160, "max":175},
54+
"blue":{"min":125, "max":135}
55+
}
56+
]
57+
4358

4459
HELP_STRING = \
4560
"""
@@ -48,6 +63,7 @@
4863
Options:
4964
--help - show this string
5065
--halloween - enable halloween mode
66+
--elections - enable elections mode
5167
--disable-dogs - don't collect dogs
5268
--click-limit=n - limit clicks (Example: --click-limit=0.05, only 5% of clicks)
5369

main.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from constants import (
1616
CLICK_LIMIT,
1717
HELP_STRING,
18+
ELECTIONS_MODE,
1819
HALLOWEEN_MODE,
1920
DOGS_DROP_TOGGLE,
2021
AVG_GAME_DURATION,
@@ -25,6 +26,7 @@
2526
DEFAULT_COLOR_TRIGGER,
2627
DOGS_WHITE_COLOR_RANGE,
2728
HALLOWEEN_COLOR_TRIGGER,
29+
ELECTIONS_COLOR_TRIGGERS,
2830
)
2931

3032

@@ -53,8 +55,8 @@ def check_running(frame, application_bbox) -> bool:
5355
def check_object(frame, x:int, y:int) -> bool:
5456
""" Finding dropping objects by color """
5557

56-
def _check_color_trigger(color_trigger):
57-
if random.random() > CLICK_LIMIT:
58+
def _check_color_trigger(color_trigger, limit:bool=True):
59+
if not limit and random.random() > CLICK_LIMIT:
5860
return False
5961

6062
if color_trigger['red']['min'] <= frame[y][x][0] <= color_trigger['red']['max']:
@@ -71,8 +73,12 @@ def _check_color_trigger(color_trigger):
7173
if _check_color_trigger(DEFAULT_COLOR_TRIGGER):
7274
return True
7375

74-
#DOGS DROP
76+
if ELECTIONS_MODE:
77+
for color_trigger in ELECTIONS_COLOR_TRIGGERS:
78+
if _check_color_trigger(color_trigger, False):
79+
return True
7580

81+
#DOGS DROP
7682
if DOGS_DROP_TOGGLE:
7783
if frame[y][x][0] == frame[y][x][1] == frame[y][x][2] and DOGS_WHITE_COLOR_RANGE[0] <= frame[y][x][0] <= DOGS_WHITE_COLOR_RANGE[1]:
7884
counter = 0

0 commit comments

Comments
 (0)