-
Notifications
You must be signed in to change notification settings - Fork 0
/
p3_global.inc
executable file
·626 lines (489 loc) · 17.7 KB
/
p3_global.inc
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
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
SUB p3_global_init {
/declare stopWait bool outer FALSE
/declare autoKeywordIgnoreValues ON,OFF,YES,NO,NONE
/declare iniSectionsAutoProcess string outer Heals,CombatSpells,Buffs,AutoAbilities,BuffRequests,TankActions,AutoDebuffs
/declare iniSectionsAutoValidate string outer Heals,CombatSpells,Buffs,AutoAbilities,BuffRequests,TankActions,AutoDebuffs
/declare debugMode bool outer FALSE
/declare botIniFile string outer -
/declare allNetbotNames string outer
/declare beepOnDeath bool outer TRUE
/declare beepOnDeathSound string outer spx_dth.wav
/declare holdFunctionsAfterZoning bool outer TRUE
/declare holdDelayDuration string outer 10s
/declare maxForegroundFPS int outer 60
/declare maxBackgroundFPS int outer 60
/call processCommandLine
/call initializeEntryFlagSystem
/call loadIniSections
/call processAutoValidateIniSections
/call gatherNetbotNames
/declare bcsChannels string outer ${getDefaultBCSChannels[]}
/varset bcsChannels ${getBotIniOption[Misc.EQBCSChannels,${bcsChannels}]}
/varset holdFunctionsAfterZoning ${getBotIniOption[Misc.HoldFunctionsAfterZoning,TRUE,general]}
/varset holdDelayDuration ${getBotIniOption[Misc.HoldFunctionDuration,5s,general]}
/varset beepOnDeath ${getBotIniOption[Misc.BeepOnDeath,TRUE,general]}
/varset beepOnDeathSound ${getBotIniOption[Misc.BeepOnDeathSound,${beepOnDeathSound},general]}
/ECHO bccmd channels ${bcsChannels}
/bccmd channels ${bcsChannels}
/notify AdvancedDisplayOptionsWindow ADOW_MaxBGFPSSlider newvalue ${Math.Calc[${maxBackgroundFPS}-9]}
/notify AdvancedDisplayOptionsWindow ADOW_MaxFPSSlider newvalue ${Math.Calc[${maxForegroundFPS}-9]}
/notify OptionsDisplayPage ODP_LODBiasSlider newvalue 0
/notify AdvancedDisplayOptionsWindow ADOW_ActorClipPlaneSlider newvalue 50
/notify OptionsWindow ODP_ClipPlaneSlider newvalue 6
|/notify AdvancedDisplayOptionsWindow ADOW_ActorClipPlaneSlider newvalue 90
/RETURN
}
SUB globalMaintenance() {
/if (${checkOpenWindows[]}==TRUE) {
/delay 10
/RETURN RESET
}
/if (${Me.Dead}==TRUE || ${Me.State.Equal[HOVER]}) {
/delay 10
/RETURN RESET
}
/RETURN
}
SUB loadIniSections {
/declare sections string local ${Ini[${botIniFile}]}
/declare a string local
/declare i int local 1
/declare sectionName string local
/declare shortSectionName string local
/declare newArrayName string local
/for i 1 to ${sections.Count[|]}
/varset sectionName ${sections.Token[${i},|]}
/if (${sectionName.Length}==0 || ${Bool[${sectionName}]}==NULL) /continue
/if (${Select[${sectionName},${iniSectionsAutoProcess}]}==0) /continue
/varset shortSectionName ${sectionName.Replace[ ,]}
/varset newArrayName ini${shortSectionName}
/declare ${newArrayName}[96,96] string outer -
/declare tmpArray[96] string outer -
/call getIniSectionToArray "${botIniFile},${shortSectionName}" tmpArray
/call processArray tmpArray ${newArrayName}
/deletevar tmpArray
/next i
/for i 1 to ${Math.Calc[${iniSectionsAutoProcess.Count[,]}+1]}
/if (${Defined[ini${iniSectionsAutoProcess.Token[${i},,]}]}==FALSE) {
/declare ini${iniSectionsAutoProcess.Token[${i},,]}[1,1] string outer -
}
/next i
/RETURN
}
SUB processAutoValidateIniSections() {
/declare i int local
/for i 1 to ${Math.Calc[${iniSectionsAutoValidate.Count[,]}+1]}
/echo Validating: ini${iniSectionsAutoValidate.Token[${i},,]}
/call validateSpellBasedArray ini${iniSectionsAutoValidate.Token[${i},,]}
/next i
/RETURN
}
SUB initializeEntryFlagSystem {
/declare flagNamesByIndex list outer
/invoke ${flagNamesByIndex.Append[bNull,bName,bValue,bTargets,bExcludeTargets,bTargetOverLevel,bCastableDuringAssist,bSelfOverHP,bSelfUnderHP,bSelfOverMana,bSelfUnderMana,bCastableOnlyResting,bCastOnlyDuringAssist,bSelfUnderEnd,bSelfOverEnd,bNoCancelChecks,bRequireGroupInRange,bTargetUnderHP,bTargetOverHP,bNotIfShortBuff,bNotIfLongBuff,bRecastDelay,bHealPct,bTargetRace,bCombatOnly,bTargetUnderLevel,bUseTeamIndex,bRequireMobsInProximity,bForceSpellID,bRequireTargetClass,bNoSitTimer,bRequireBodyType,bRequireDiseased,bRequireGroup,bRequireHurtPartyMembers,bRequireMaxMobsInProximity,bRequireAssistTarget,bRequirePoisoned,bDoCommand,bPreCommand,bNotToT,bKeyword,bRebuffSeconds,bActivateBandolier,bRevertToBandolier,bFreeze,bInstructRemove,bMaxResists,bExtendedStackCheck,bIncludeXTargets,bNoCast,bIncludeGroup,bMemInGem,bOnlyXTargets,bRequireCastIdle,bOnlyAfterTaunt,bTargetLifeManaRatio,bAmToT,bRequireCursed,bRequireAssistTag,bNotIfAssistTag,bRequireUW,bCancelAtHP,bAssumeSuccess,bRequireTeamIndexOver,bIgnoreTargetType,bNotIfMounted,bEnabled,bTagsInvalidated,bIncludeNetBotPets,bOnlyNetBotPets,bRequireTeamIndex,bTargetUnderDistance,bMyName,bCheckShortBuffs,bForceTargetType,bRequireBehindAssistTarget,bAutoDebuff,bAutoDebuffOnly,bCastableMoving,bGiftOfMana,bTargetType,bNoTwistStop,bIgnoreSanityCheck,bTargetHasBuff,bTargetDoesntHaveBuff,bRequireHealIdle,bTargetUnderMana,bSelfOverActualHP,bIgnoreRangeCheck,bInMaxRangeTo,bNextHighestAggroOver,bSelfNotHighestAggro,bSelfOverAggro,bSelfUnderAggro,bForceTargetting,bRequireDiscNotReady]}
/declare i int local
/for i 1 to ${Math.Calc[${flagNamesByIndex.Count}-1]}
/declare ${flagNamesByIndex.Item[${i}]} string outer ${i}
/next i
/return
}
SUB processArray(string sourceArray, string destArray) {
/declare i int local 1
/declare e string local
/declare j int local 1
/declare sectionText string local
/declare sectionValue string local
/declare sectionName string local
/declare keyName string local
/declare keyValue string local
/for i 1 to ${${sourceArray}.Size}
/varset e ${${sourceArray}[${i}]}
|/if (${Bool[${e}]}==FALSE) /goto :loopesc
/varset keyName ${e.Token[1,|]}
/varset keyValue ${e.Right[-${Math.Calc[${keyName.Length}+1]}]}
/varset ${destArray}[${i},${bName}] ${keyName}
/varset ${destArray}[${i},${bValue}] ${keyValue}
/for j 1 to ${Math.Calc[${keyValue.Count[|]}+1]}
/varset sectionText ${keyValue.Token[${j},|]}
/if (${sectionText.Length}==0) /goto :loopnexti
/varset sectionName ${sectionText.Token[1,:]}
/if (${Select[${sectionName},${autoKeywordIgnoreValues}]}>0) /goto :loopnextj
/if (${sectionText.Count[:]}>0) {
/varset sectionValue ${sectionText.Token[2,:]}
} else {
/noparse /varset sectionValue ${sectionText}
}
/if (${Defined[b${sectionName}]}==FALSE) {
/bc Warning: >>> ${sectionName} <<< is not a recognized parameter.
/continue
}
/varset ${destArray}[${i},${b${sectionName}}] ${sectionValue}
:loopnextj
/next j
:loopnexti
/next i
:loopesc
/RETURN
}
SUB processArrayTargets(string arrayName, int defaultToNetBots) {
/declare i int local
/declare j int local
/declare finalTargets list local
/declare removeTargets list local
/declare finalString string local
/for i 1 to 64
/if (${${arrayName}[${i},1].Equal[-]}) /break
/invoke ${finalTargets.Clear}
/invoke ${removeTargets.Clear}
/varset finalString
/if (${${arrayName}[${i},${bTargets}].NotEqual[-]}) {
/call processTargets "${${arrayName}[${i},${bTargets}]}"
/invoke ${finalTargets.Append[${Macro.Return}]}
} else {
/invoke ${finalTargets.Append[${allNetbotNames}]}
}
/if (${${arrayName}[${i},${bExcludeTargets}].NotEqual[-]}) {
/call processTargets "${${arrayName}[${i},${bExcludeTargets}]}"
/invoke ${removeTargets.Append[${Macro.Return}]}
/for j 0 to ${Math.Calc[${removeTargets.Count}-1]}
/invoke ${finalTargets.Remove[${removeTargets.Item[${j}]}]}
/next j
}
/for j 0 to ${Math.Calc[${finalTargets.Count}-1]}
/varset finalString ${finalString},${finalTargets.Item[${j}]}
/next j
/varset finalString ${finalString.Right[-1]}
/varset ${arrayName}[${i},${bTargets}] ${finalString}
/next i
/RETURN
}
SUB processTargets(string targets) {
/declare i int local
/declare e string local
/declare max int local ${Math.Calc[${targets.Count[,]}+1]}
/declare ret string local
/declare ret2 string local
/for i 1 to ${max}
/varset e ${targets.Token[${i},,]}
/if (${e.Left[1].Equal[@]}) {
/call getMatchesForKey "${e}"
/if (${Macro.Return.Length}==0) /continue
/if (${ret.Length}==0) {
/varset ret ${Macro.Return}
} else {
/varset ret ${Macro.Return},${ret}
}
} else {
/if (${ret.Length}==0) {
/varset ret ${e}
} else {
/varset ret ${ret},${e}
}
}
/next i
/RETURN ${ret}
}
SUB getIniSectionToArray(string iniKey, string arrayName) {
/declare iniSectionKeys string local
/declare keyCount int local
/declare i int local
/deletevar ${arrayName}
/varset iniSectionKeys ${Ini[${iniKey}]}
| EMPTY SECTION? MAKE AN EMPTY ARRAY AND BAIL
/if (${iniSectionKeys.Equal[NULL]}) {
/declare ${arrayName}[0] string outer -
/return
}
/varset keyCount ${Math.Calc[${iniSectionKeys.Count[|]}-1]}
| re-create the array with the appropriate size
/echo /declare ${arrayName}[${keyCount}] string outer -
/declare ${arrayName}[${keyCount}] string outer -
| fetch and store the ini sections into the array
/for i 1 to ${keyCount}
/varset ${arrayName}[${i}] ${iniSectionKeys.Arg[${i},|].Arg[1,#]}|${Ini[${iniKey},${iniSectionKeys.Arg[${i},|]}]}
/next i
/RETURN
}
SUB getMatchesForKey(string allowKey) {
/declare i int local
/declare netbotCount int local ${Math.Calc[${NetBots.Counts}]}
/declare netbotName string local
/declare netbotClass string local
/declare ret string local
/for i 1 to ${netbotCount}
/varset netbotName ${NetBots.Client[${i}]}
/call characterPassesAllowKey ${netbotName} ${allowKey}
/if (${Macro.Return}==TRUE) {
/if (${ret.Length}==0) {
/varset ret ${netbotName}
} else {
/varset ret ${ret},${netbotName}
}
}
/next i
/return ${ret}
}
SUB characterPassesAllowKey(string charName, string allowKey) {
/if (${Spawn[pc ${charName}].ID}==NULL) /return FALSE
/declare searchKey string
/declare xspawn spawn local
/vardata xspawn Spawn[pc ${charName}]
/if (${allowKey.Equal[ALL]}) /return TRUE
/if (${allowKey.Upper.Equal[@ALLNETBOTS]}) /return TRUE
/if (${allowKey.Upper.Equal[@SELF]}) {
/if (${xspawn.ID}==${Me.ID}) /RETURN TRUE
/RETURN FALSE
}
/if (${allowKey.Upper.Equal[@MANAREGENCLASSES]}) {
/if (${manaRegenClasses.Find[${xspawn.Class.ShortName}]}!=NULL) /return TRUE
/return FALSE
}
/if (${allowKey.Upper.Equal[@HASTECLASSES]}) {
/if (${hasteClasses.Find[${xspawn.Class.ShortName}]}!=NULL) /return TRUE
/return FALSE
}
/if (${allowKey.Upper.Equal[@MANACLASSES]}) {
/if (${manaClasses.Find[${xspawn.Class.ShortName}]}!=NULL) /return TRUE
/return FALSE
}
/if (${allowKey.Upper.Equal[@MELEECLASSES]}) {
/if (${meleeClasses.Find[${xspawn.Class.ShortName}]}!=NULL) /return TRUE
/return FALSE
}
/if (${allowKey.Upper.Equal[@MONKS]}) {
/if (${xspawn.Class.ShortName.Equal[MNK]}) /return TRUE
/return FALSE
}
/if (${allowKey.Upper.Equal[@ROGUES]}) {
/if (${xspawn.Class.ShortName.Equal[ROG]}) /return TRUE
/return FALSE
}
/if (${allowKey.Upper.Equal[@BERSERKERS]}) {
/if (${xspawn.Class.ShortName.Equal[BER]}) /return TRUE
/return FALSE
}
/if (${allowKey.Upper.Equal[@KNIGHTS]}) {
/if (${knightClasses.Find[${xspawn.Class.ShortName}]}!=NULL) /return TRUE
/return FALSE
}
/if (${allowKey.Upper.Equal[@TANKS]}) {
/if (${tankClasses.Find[${xspawn.Class.ShortName}]}!=NULL) /return TRUE
/return FALSE
}
/if (${allowKey.Upper.Equal[@CLERICS]}) {
/if (${xspawn.Class.ShortName.Equal[CLR]}) /return TRUE
/return FALSE
}
/if (${allowKey.Upper.Equal[@BARDS]}) {
/if (${xspawn.Class.ShortName.Equal[BRD]}) /return TRUE
/return FALSE
}
/if (${allowKey.Upper.Left[5].Equal["ONLY:"]}==TRUE) {
/varset searchKey ,${allowKey.Arg[2,:]},
/if (${searchKey.Upper.Find[${charName.Upper}]}!=0) /return TRUE
}
/if (${allowKey.Upper.Equal[@GROUP]}==TRUE) {
/if (${Group.Member[${charName}]}!=NULL) /return true
}
/RETURN
}
SUB characterPassesAllowKeySeries(string charName, string series) {
/declare i int local 0
/declare ikey string local
/for i 1 to ${Math.Calc[${series.Count[,]}+1]}
/varset ikey ${series.Token[${i},,]}
/if (${ikey.Left[1].Equal[@]}) {
/call characterPassesAllowKey ${charName} ${ikey}
/if (${Macro.Return}==TRUE) /return TRUE
} else {
/if (${charName.Upper.Equal[${ikey.Upper}]}) /return TRUE
}
/next i
/return FALSE
}
SUB gatherNetbotNames {
/declare i int local
/declare netbotCount int local ${Math.Calc[${NetBots.Counts}]}
/declare netbotName string local
/declare ret string local
/for i 1 to ${netbotCount}
/if (${ret.Length}==0) {
/varset ret ${NetBots.Client[${i}]}
} else {
/varset ret ${ret},${NetBots.Client[${i}]}
}
/next i
/varset allNetbotNames ${ret}
/RETURN
}
SUB validateTagsFromArray(string arrName) {
/echo validating tags for ${arrName}
/declare i int local
/for i 1 to 64
/if (${${arrName}[${i},${bNotIfAssistTag}].Equal[-]} && ${${arrName}[${i},${bRequireAssistTag}].Equal[-]}) /continue
/if (${${arrName}[${i},${bNotIfAssistTag}].NotEqual[-]}) {
/if (${assistTags.Count}>0 || ${persistentAssistTags.Count}>0) {
|/echo bNotIfAssistTag: ${${arrName}[${i},${bNotIfAssistTag}]} TRUE
/call validateAssistTags ${${arrName}[${i},${bNotIfAssistTag}]} TRUE
/if (${Macro.Return}==TRUE) {
|/echo invalidating: ${${arrName}[${i},1]}
/varset ${arrName}[${i},${bTagsInvalidated}] YES
} else {
/varset ${arrName}[${i},${bTagsInvalidated}] -
}
}
}
/if (${${arrName}[${i},${bRequireAssistTag}].NotEqual[-]}) {
/if (${assistTags.Count}==0 && ${persistentAssistTags.Count}==0) {
/echo invalidating: ${${arrName}[${i},1]}
/varset ${arrName}[${i},${bTagsInvalidated}] YES
/continue
}
|/ECHO bRequireAssistTag ${${arrName}[${i},${bRequireAssistTag}]}
/call validateAssistTags ${${arrName}[${i},${bRequireAssistTag}]}
/if (${Macro.Return}==FALSE) {
/echo invalidating: ${${arrName}[${i},1]}
/varset ${arrName}[${i},${bTagsInvalidated}] YES
} else {
/varset ${arrName}[${i},${bTagsInvalidated}] -
}
}
/next i
/RETURN
}
SUB validateSpellBasedArray(string arrName) {
/declare i int local
/for i 1 to 64
/if (${${arrName}[${i},1].Equal[-]}) /break
/if (${${arrName}[${i},1].Equal[NULL]}) /break
/if (${${arrName}[${i},${bIgnoreSanityCheck}].NotEqual[-]}) /break
/if (${isRealSpell[${${arrName}[${i},${bName}]}]}==FALSE) {
/echo Error: >>>${${arrName}[${i},1]}<<< does not appear to be a valid spell/item/abilty in array [${arrName}]. Check spelling? Non-existant item/clicky? Disabling this spell entry until macro restart.
/varset ${arrName}[${i},${bEnabled}] NO
}
/next i
/RETURN
}
SUB isRealSpell(string request) {
/declare castType string local
/call getCastTypeByCastRequest "${request}"
/varset castType ${Macro.Return}
/if (${castType.Equal[UNKNOWN]}) /return FALSE
/return TRUE
}
SUB memorizeSpellInGem(string spellName, int gemNumber) {
/if (${Me.Book[${spellName}]}==NULL) {
/bc Cannot memorize ${spellName} - I don't have this spell.
/RETURN FALSE
}
/if (${Me.Casting.ID}!=NULL) {
/echo interrupt.
/interrupt
/delay 5
}
/memspell ${gemNumber} "${spellName}"
/delay 3
/while (${Window[SpellBookWnd]}==TRUE) {
/delay 3
/if (${Gem[${spellName}]}!=NULL) /break
}
/delay 35 ${Me.SpellReady[${spellName}]}
/RETURN TRUE
}
SUB isNetBotAttackingID(int targetID) {
/declare netbotCount int local ${NetBots.Counts}
/declare i int local
/declare netbotName string local
/for i 1 to ${netbotCount}
/varset netbotName ${NetBots.Client[${i}]}
/if (${NetBots[${netbotName}].Attacking}==TRUE && ${NetBots[${netbotName}].TargetID}==${targetID}) /return TRUE
/next i
/RETURN FALSE
}
SUB processCommandLine() {
/if (${commandLine[${cmdDEBUG}].NotEqual[-]}) /varset debugMode TRUE
/if (${commandLine[${cmdINI}].Length}>0) /varset commandLine[${cmdINI}] -${commandLine[${cmdINI}]}
/if (${commandLine[${cmdDIRECTINI}].Length}>0) {
/varset botIniFile p3_bots\${commandLine[${cmdDIRECTINI}]}.ini
} else {
/varset botIniFile p3_bots\${MacroQuest.Server}-${Me.CleanName}${commandLine[${cmdINI}]}.ini
}
/RETURN
}
SUB getDefaultBCSChannels() {
/declare ret list local
/declare retstr string local
/declare i int local
/invoke ${ret.Append[${Me.Class.Name.Lower}s]}
/if (${meleeClasses.Find[${Me.Class.ShortName}]}!=NULL) {
/invoke ${ret.Append[melee]}
}
/if (${tankClasses.Find[${Me.Class.ShortName}]}!=NULL) {
/invoke ${ret.Append[tanks]}
}
/if (${rangedClasses.Find[${Me.Class.ShortName}]}!=NULL) {
/invoke ${ret.Append[ranged]}
}
/if (${priestClasses.Find[${Me.Class.ShortName}]}!=NULL) {
/invoke ${ret.Append[healers]}
}
/for i 0 to ${Math.Calc[${ret.Count}-1]}
/varset retstr ${ret.Item[${i}]} ${retstr}
/next i
/RETURN ${retstr.Left[-1]}
}
SUB fullTarget(int targetID) {
/if (${Target.ID} != ${targetID}) {
/tar id ${targetID}
/delay 10
}
/RETURN TRUE
/target clear
/delay 2
/while (${Target.BuffsPopulated}==0 && ${Target.BuffsPopulated}!=NULL) {
/if (${Target.ID}!=${targetID}) /tar id ${targetID}
/delay 1
}
/RETURN
}
SUB checkOpenWindows() {
/if (${Window[BigBankWnd].Open}) /return TRUE
/if (${Window[TradeWnd].Open}) /return TRUE
/if (${Window[GuildBankWnd].Open}) /return TRUE
/if (${Window[MerchantWnd].Open}) /return TRUE
/if (${Window[SpellBookWnd].Open}) /return TRUE
/return FALSE
}
SUB waitForInt(string eval, int result) {
:loopstart
/doevents
/delay 1
/if (${stopWait}) {
/varset stopWait FALSE
/return
}
/if (${${eval}}!=${result}) /goto :loopstart
/RETURN
}
SUB waitForBool(string eval, bool result, string docmd)
/echo waitfor bool: ${eval}
:loopstart
/doevents
/delay 2
/if (${stopWait}) {
/varset stopWait FALSE
/return
}
/if (${docmd.Length}>0) /docommand ${docmd}
/if (${${eval}}!=${result}) /goto :loopstart
/RETURN
SUB waitForIntLTE(string eval, int result)
:loopstart
/doevents
/delay 1
/if (${stopWait}) {
/varset stopWait FALSE
/return
}
/if (${${eval}}>${result}) /goto :loopstart
/RETURN