Skip to content

Commit e8ae4e6

Browse files
authored
Merge pull request #6 from BluDolphin/Frenzy-fix
Frenzy fix
2 parents a90c4c8 + 098ebe9 commit e8ae4e6

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

Main/autoClicker.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
- Can auto find and click on many images (Windows only)
1313
"""
1414

15+
1516
# ================================================================================================
1617
# SETTINGS
1718
delay = 0.001 # Set delay
@@ -50,6 +51,8 @@
5051

5152
mouse = Controller() # Create mouse object
5253
clicking = False # Set clicking to false
54+
frenzy = False # Set frenzy to false
55+
pyautogui.PAUSE = 0.01 # Delay for pyautogui between image searches
5356

5457
def active(delay, button): # Function to click
5558
while clicking == True: # While true
@@ -82,7 +85,7 @@ def boundary(): # Function to check if the mouse is in the boundary+
8285
def keyLogger(key): # Function for tracking key presses
8386
global clicking
8487
if key == startStopKey: # If the key pressed is the start/stop key
85-
try:
88+
try:
8689
if autoSnapToggle == True:
8790
imageLocation = pyautogui.locateOnScreen(cookiepath, grayscale=True, confidence=0.70) # Locate the image on the screen
8891
imageLocation = (imageLocation[0], imageLocation[1] - 100, imageLocation[2], imageLocation[3]) # modify y to raise the mouse to middle
@@ -110,19 +113,22 @@ def keyLogger(key): # Function for tracking key presses
110113
clicking = False
111114

112115
if key == frenzyKey and frenzyToggle == True: # If the key pressed is the frenzy key
116+
print("Frenzy mode: On") # Print frenzy mode is true
113117
clicking = False # Set clicking to false to disable if auto clicker is currently running
114-
115-
while True: # While true
118+
frenzy = True # Set frenzy to true
119+
120+
while frenzy == True: # While true
116121
try:
117-
for pos in pyautogui.locateAllOnScreen(frenzyPath, grayscale=True, confidence=0.5): # Locate all the images on the screen
122+
for pos in pyautogui.locateAllOnScreen(frenzyPath, grayscale=True, confidence=0.8): # Locate all the images on the screen
118123
pyautogui.moveTo(pos) # Move the mouse to the location
119124
mouse.click(Button.left) # Click the button
120125

121126
except Exception as e: # Exit on no frenzy cookie found
122127
print(f"Error: {e}")
123128
print("No frenzy cookie found") # Print if no cookie is found
129+
frenzy = False
124130
break # Break the loop
125-
131+
126132
# Create listener for key logging and start keyLogger function
127133
with Listener(on_press=keyLogger) as listener:
128134
listener.join()

0 commit comments

Comments
 (0)