forked from swiftb/clicker-heroes-sw1ft-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmonster_clicker.ahk
101 lines (75 loc) · 2.12 KB
/
monster_clicker.ahk
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
; -----------------------------------------------------------------------------------------------------
; Clicker Heroes Monster Clicker
; by Sw1ftb
; Hotkeys:
; Shift+F1 to start
; Shift+Pause to stop
; Shift+F5 to reload the script
; Built in click speed throttle when moving mouse cursor inside the Clicker Heroes window.
; -----------------------------------------------------------------------------------------------------
#Persistent
#NoEnv
#InstallKeybdHook
#SingleInstance force
#Include %A_ScriptDir%
#Include ch_bot_lib.ahk
SetControlDelay, -1
SetBatchLines, -1
scriptName=Monster Clicker
scriptVersion=1.21
minLibVersion=1.3
script := scriptName . " v" . scriptVersion
short := 2 ; ms
long := 2000 ; throttled delay
clickDelay := short
; -----------------------------------------------------------------------------------------
#Include *i monster_clicker_settings.ahk
if (libVersion < minLibVersion) {
showWarningSplash("The bot lib version must be " . minLibVersion . " or higher!")
ExitApp
}
clientCheck()
; -----------------------------------------------------------------------------------------
; -- Hotkeys (+=Shift)
; -----------------------------------------------------------------------------------------
; Start clicker with Shift+F1
+F1::
keepOnClicking := true
monsterClicks := 0
showSplash("Starting clicker...")
if (clickDuration > 0) {
setTimer, stopClicking, % -clickDuration * 60 * 1000 ; run only once
}
while(keepOnClicking) {
clickPos(xMonster, yMonster)
sleep % clickDelay
}
return
; Pause/Unpause script
; Remote pause
+F2::
~Pause::Pause
return
; Stop clicker with Shift+F3
+F3::
keepOnClicking := false
return
; Reload script with Shift+F5
+F5::
showSplashAlways("Reloading clicker...", 1)
Reload
return
; -----------------------------------------------------------------------------------------
; -- Subroutines
; -----------------------------------------------------------------------------------------
checkMouse:
MouseGetPos,,, window
if (window = WinExist(winName)) {
clickDelay := long
} else {
clickDelay := short
}
return
stopClicking:
keepOnClicking := false
return