-
Notifications
You must be signed in to change notification settings - Fork 0
/
freedomBard3.0.ahk
329 lines (287 loc) · 13.1 KB
/
freedomBard3.0.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
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
;;;;; NEEDED TO RUN ;;;;;
#Include <classMemory>
#include botLauncherConfig.ini
;;;;; OPTOMIZE SORCERY ;;;;;
#singleinstance force
#NoEnv
SetBatchLines -1
ListLines Off
;;;;; OTHER GOODIES ;;;;;
coordmode, mouse, client
coordmode, pixel, screen
coordmode, tooltip, screen
#InstallMouseHook
SetKeyDelay, 0, 0
;;;;; SET THE WINDOW ID/NAMES ;;;;;
if (_ClassMemory.__Class != "_ClassMemory")
{
msgbox class memory not correctly installed. Or the (global class) variable "_ClassMemory" has been overwritten
ExitApp
}
WinGet, id, List, BlankTK
loop, %boxes% {
WinSetTitle, % "ahk_id " id%A_Index%, , freedomPoet%A_Index%
freedomPoet%a_index% := new _ClassMemory("freedomPoet"a_index, "", hProcessCopy)
}
game := new _ClassMemory("ahk_exe BloonsTk.exe")
BA := game.BaseAddress
statusCode:= 0x44724
statusCode1 := 0x144
scSleep := 10000
songSleep := 4000
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;; ON THE GO SCRIPT MAINTENANCE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
~!^y::Suspend
~!p::Reload
~!^q::exitApp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;; TOGGLE BOT ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$+f12::
inputbox, temp1, PARTY SLOT,,,150,140,,,,30,0
inputbox, temp2, ON / OFF,,,150,140,,,,30,0
inspire%temp1% := temp2
return
$f12::
if (castSpells=1) {
castSpells = 0
castSpellsState = OFF
return
}
if (castSpells=0) {
castSpells = 1
castSpellsState = ON
return
}
return
$f8::
castScourge ++
if (castScourge > 1)
castScourge = 0
if castScourge=0
castScourgeState = OFF
if castScourge=1
castScourgeState = SMART
if castScourge=2
castScourgeState = MED
if castScourge=3
castScourgeState = HIGH
return
$f10::
castScourge = 0
castScourgeAuto++
if (castScourgeAuto > 1)
castScourgeAuto = 0
if castScourgeAuto = 0
castScourgeState = OFF
if castScourgeAuto = 1
castScourgeState = AUTO (Casting!)
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;; RESET PLAYER ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$!f12::
inputbox, asvReset, poet, ASV reset?,,150,140,,,,30,0
asvTimer%asvReset% := asvTimer%asvReset% - 1000000
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; ##### # # ##### ##### ### ##### ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; # # # # # # # # # ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; # ##### ##### ##### # # # ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; # # # # # # # # # ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; # # # ##### ##### ### # ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$^f12::
;build regular variables
uidCounter = 0
matchSC = 0
castSpells = 0
castSpellsState = OFF
castScourge = 0
castScourgeAuto = 0
castScourgeState = OFF
recentInvoke = 0
loop, 20 { ; needs to be set to maximum possible group size to ensure full group asv capability
asvTimer%a_index% := a_tickcount - 1000000
shieldTimer%a_index% := a_tickcount - 1000000
inspire%a_index% := 0
waitToHeal%a_index% = 0
}
loop, 100 { ; build the SC scanner variable tables;
tempUIDTimer%a_index% := a_tickcount - 1000000
tempUID%a_index% := 0
}
;build full variable preset
loop % boxes {
if (char%a_index% = 1) {
spellTicker%a_index% := a_tickcount
invokeTimer%a_index% := a_tickcount - 1000000
restoreTimer%a_index% := a_tickcount - 1000000
scTimer%a_index% := a_tickcount - 1000000
songTimer%a_index% := a_tickcount - 1000000
spellCount%a_index% = 0
; smartOverlay := smartOverlay"`nInvoke"a_index: %"invokeOverlay"a_index%
}
} ; full variable preset complete
loop { ; infinity loop, start of the working bot
%a_index%ping1 := A_TickCount ; start the stop watch ping timer
loop % boxes {
poetTemp := a_index ; cache the poet
if (char%a_index% = 1) and (castSpells = 1) { ; full variable loop
if ((a_tickcount-spellTicker%a_index%) >= 1000) { ; reset spell tickers
spellCount%a_index% = 0
spellTicker%a_index% := a_tickcount
}
;inspire start
groupSize := freedomPoet%a_index%.read(groupBaseAddress, "UInt", groupSizeOffset)
loop % groupSize {
curMana%a_index% := freedomPoet%poetTemp%.read(groupBaseAddress, "UInt", (groupCurMana + ((groupOffsetMult * a_index) - groupOffsetMult)))
maxMana%a_index% := freedomPoet%poetTemp%.read(groupBaseAddress, "UInt", (groupMaxMana + ((groupOffsetMult * a_index) - groupOffsetMult)))
manaP%a_index% := ((100 / maxMana%a_index%) * curMana%a_index%)
; temp := a_index
if (inspire%a_index% = 1) and (90 > manaP%a_index%) and (spellCount%poetTemp% < 3) and ((a_tickcount-invokeTimer%poetTemp%)>invokeAther) {
targetUID := freedomPoet%poetTemp%.read(groupBaseAddress, "UInt", (groupUID + ((groupOffsetMult * a_index) - groupOffsetMult)))
freedomPoet%poetTemp%.write(spellCastUID, targetUID, "Int")
Controlsend,, {Blind}%inspireKey%, freedomPoet%poetTemp%
sleep, 10
Controlsend,, {Blind}{enter}, freedomPoet%poetTemp%
spellCount%poetTemp% ++
}
}
;invoke start
curMana := freedomPoet%a_index%.read(0x6FE238, "UInt", 0x10C)
maxMana := freedomPoet%a_index%.read(0x6FE238, "UInt", 0x110)
curManaP := ((100 / maxMana) * curMana)
if (curManaP < 75) {
if ((a_tickcount-invokeTimer%a_index%)>invokeAther) and (spellCount%a_index% < 3) {
if (curMana<invokeCost) {
Controlsend,, {Blind}u%wineKey%, freedomPoet%a_index%
}
Controlsend,, {Blind}%invokeKey%, freedomPoet%a_index%
curMana := maxMana
invokeTimer%a_index% := a_tickcount
spellCount%a_index% ++
recentInvoke = 1
}
}
;heal start
groupSize := freedomPoet%a_index%.read(groupBaseAddress, "UInt", groupSizeOffset)
loop % groupSize {
curVita%a_index% := freedomPoet%poetTemp%.read(groupBaseAddress, "UInt", (groupCurVita + ((groupOffsetMult * a_index) - groupOffsetMult)))
maxVita%a_index% := freedomPoet%poetTemp%.read(groupBaseAddress, "UInt", (groupMaxVita + ((groupOffsetMult * a_index) - groupOffsetMult)))
vitaP%a_index% := ((100 / maxVita%a_index%) * curVita%a_index%)
temp := a_index
; Restore
if (35 > vitaP%a_index%) and (spellCount%a_index% < 3) and (curMana>(restoreCost+30)) and ((a_tickcount-restoreTimer%poetTemp%)>restoreAther) {
freedomPoet%poetTemp%.write(spellCastUID, targetUID, "Int")
Controlsend,, {Blind}%restoreKey%{enter}, freedomPoet%poetTemp%
spellCount%poetTemp% ++
curMana := freedomPoet%poetTemp%.read(0x6FE238, "UInt", 0x10C)
}
if (90 < vitaP%a_index%)
waitToHeal%a_index% = 0
if (90 > vitaP%a_index%) and (waitToHeal%a_index% = 0) {
waitToHeal%a_index% = 1
healMeTimer%a_index% := a_tickcount
}
if ((a_tickcount-healMeTimer%a_index%) > 5000) and (waitToHeal%a_index% = 1) and (spellCount%poetTemp% < 3) and (curMana>(healCost+30)) {
targetUID := freedomPoet%poetTemp%.read(groupBaseAddress, "UInt", (groupUID + ((groupOffsetMult * temp) - groupOffsetMult)))
freedomPoet%poetTemp%.write(spellCastUID, targetUID, "Int")
Controlsend,, {Blind}%healKey%{enter}, freedomPoet%poetTemp%
spellCount%poetTemp% ++
curMana := freedomPoet%poetTemp%.read(0x6FE238, "UInt", 0x10C)
}
if (90 > vitaP%a_index%) and (spellCount%a_index% < 3) and (curMana>(healCost+30)) {
targetUID := freedomPoet%poetTemp%.read(groupBaseAddress, "UInt", (groupUID + ((groupOffsetMult * temp) - groupOffsetMult)))
freedomPoet%poetTemp%.write(spellCastUID, targetUID, "Int")
Controlsend,, {Blind}%healKey%{enter}, freedomPoet%poetTemp%
spellCount%poetTemp% ++
curMana := freedomPoet%poetTemp%.read(0x6FE238, "UInt", 0x10C)
}
}
;asv
if ((a_tickcount-asvTimer%a_index%)>asvAther) and ((a_tickcount - songTimer%a_index%) > songSleep) and (spellCount%poetTemp% = 0) and (curMana>(asvCost+30)) {
targetUID := freedomPoet%poetTemp%.read(groupBaseAddress, "UInt", (groupUID + ((groupOffsetMult * a_index) - groupOffsetMult)))
freedomPoet%poetTemp%.write(spellCastUID, targetUID, "Int")
Controlsend,, {Blind}%asvKey%, freedomPoet%poetTemp%
asvTimer%a_index% := a_tickcount
songTimer%a_index% := a_tickcount
spellCount%poetTemp% ++
curMana := freedomPoet%poetTemp%.read(0x6FE238, "UInt", 0x10C)
}
;shield set up -- every 7 sec :)
if(( a_tickcount-shieldTimer%a_index%)>shieldAther) and ((a_tickcount - songTimer%a_index%) > songSleep) and (spellCount%poetTemp% = 0) and (curMana>(shieldCost+30)) {
targetUID := freedomPoet%poetTemp%.read(groupBaseAddress, "UInt", (groupUID + ((groupOffsetMult * a_index) - groupOffsetMult)))
freedomPoet%poetTemp%.write(spellCastUID, targetUID, "Int")
Controlsend,, {Blind}%shieldKey%, freedomPoet%poetTemp%
shieldTimer%a_index% := a_tickcount
songTimer%a_index% := a_tickcount
spellCount%poetTemp% ++
curMana := freedomPoet%poetTemp%.read(0x6FE238, "UInt", 0x10C)
}
;harden body
curVita := freedomPoet%poetTemp%.read(0x6FE238, "UInt", 0x104)
if (curVita<cacheVita%poetTemp%) and (curMana>(hardenBodyCost+30)) and (spellCount%poetTemp% < 3) and (recentInvoke != 1) {
Controlsend,, {Blind}%hardenBodyKey%, freedomPoet%poetTemp%
Controlsend,, {Blind}%hardenBodyKey%, freedomPoet%poetTemp%
spellCount%poetTemp% ++
curMana := freedomPoet%poetTemp%.read(0x6FE238, "UInt", 0x10C)
}
cacheVita%poetTemp% := curVita
recentInvoke=0
;SC START
if (castScourge > 0) and (spellCount%poetTemp% < 3) and (curMana>(scourgeCost+30)) {
status := freedomPoet%poetTemp%.read(BA + statusCode, "int", statusCode1)
Controlsend,, {Blind}%scourgeKey%, freedomPoet%poetTemp%
spellCount%poetTemp% ++
; debug box, can remove semi colon on msgbox to decode mem values!
; MsgBox, 0,, %status%
; status check for not sc cast is commented out, current is no target or aethers 1-9
if ( status = 1701278305) or (status >= 1931489568 and status <= 1931491360 ) {
; if (status != 1953718627) {
castScourge = 0
castScourgeState = OFF
}
}
if (castScourgeAuto > 0) and (a_tickcount - scTimer%a_index% > scSleep) and (spellCount%poetTemp% < 3) and (curMana>(scourgeCost+30)) {
castScourgeState = AUTO (Casting!)
Controlsend,, {Blind}%scourgeKey%, freedomPoet%poetTemp%
spellCount%poetTemp% ++
status := freedomPoet%poetTemp%.read(BA + statusCode, "int", statusCode1)
; calc := a_tickcount - scTimer%a_index%
; debug box, can remove semi colon on msgbox to decode mem values!
; MsgBox, 0,, calc = %calc% SCSLEEP %scSleep%
if ( status = 1701278305) or (status >= 1931489568 and status <= 1931491360 ) {
;if (status != 1953718627) {
scTimer%a_index% := a_tickcount
castScourgeState = AUTO (Waiting to scan!)
}
}
; end cast scourge
;invoke timer
invokeOverlay%a_index% := a_tickcount - invokeTimer%a_index%
invokeOverlay%a_index% := invokeOverlay%a_index% * 0.001
invokeOverlay%a_index% := 24 - invokeOverlay%a_index%
setformat, float, 0
if invokeOverlay%a_index% <= 0
invokeOverlay%a_index% = Ready
;restore timer
restoreOverlay%a_index% := a_tickcount - restoreTimer%a_index%
restoreOverlay%a_index% := restoreOverlay%a_index% * 0.001
restoreOverlay%a_index% := 11 - restoreOverlay%a_index%
setformat, float, 0
if restoreOverlay%a_index% <= 0
restoreOverlay%a_index% = Ready
;overlayBuild :=
} ; end full variable loop
} ; end group loop
ping2 := A_TickCount - %a_index%ping1 ; calculate ping
ping3 := 100 - ping2 ; do we need to slow down?
sleep % ping3 ; slow down
;tooltip, Caster State: %castSpellsState% %smartOverlay% `n Scourge: %scourgeDisplay% `n Group Size: %groupSize% `n Spell Count: %spellCount%a_index%% `n ping: %ping2%, 0, 0
tooltip, freedomBard: %castSpellsState% | castScourge: %castScourgeState%, 0, 0
} ;end infinite loop
return