Mod: Auto tamer dexer with Disco Tamer by daklue
Related: AnimalTaming disco
Description: Tamers with Discord
1################################
2###### How Many Pets
3################
4@setvar! totalPets 1
5
6################################
7###### Adjust Variables
8################
9@setvar! requireWarModeToHealPets 0
10@setvar! ohCrapDrinkAHealthPotHpCheck 50
11@setvar! bandageCheckTimerCd 5000
12@setvar! DiscoTimerCd 6500
13settimer DiscoTimer 0
14@setvar! GuardTimerCd 3000
15settimer GuardTimer 0
16################################
17###### Potion Controllers
18################
19@setvar! automaticallyDrinkStrPot 0
20@setvar! automaticallyDrinkAgiPot 1
21@setvar! automaticallyDrinkMagicPot 1
22@setvar! automaticallyDrinkHealPot 1
23@setvar! automaticallyDrinkCurePot 1
24@setvar! automaticallyDrinkRefreshPot 1
25
26@setvar! hpCheckToTriggerHealPotion 45
27@setvar! hpCheckToTriggerCurePotion 45
28@setvar! stamDiffCheckToTriggerRedPotion 10
29@setvar! HealTargetTimerCd 5000
30@setvar! drinkPotionsEvenIfInWarModeAndYouLoseHealth 1
31
32###########
33# If shit is not working right, adjust this number to ping
34#####
35@setvar! minimumWaitForPing 200
36@setvar! minimumWaitForPingUnequipping 650
37@setvar! cdPreventChivAbilitySpam 750
38@setvar! cdSkinningCheck 3000
39@setvar! cdPreventOverheadSpam 2000
40
41settimer bandageCheckTimer bandageCheckTimerCd
42settimer preventOverheadSpamTimer cdPreventOverheadSpam
43settimer preventChivAbilitySpamTimer cdPreventChivAbilitySpam
44settimer sCheck 12000
45
46@setvar! myRangeCheckForTarget 10
47@setvar! myPreviousKillTarget 0
48
49#####
50## Skill Check Timer
51####
52@setvar! jaseowns_SkillTimerCD 11500
53settimer jaseowns_SkillTimerCheck jaseowns_SkillTimerCD
54
55#####
56## System Message Check Timer
57####
58@setvar! jaseowns_SystemMsgCheckCD 2000
59settimer jaseowns_SystemMsgCheck jaseowns_SystemMsgCheckCD
60
61#####
62## Targeting Variables
63####
64@setvar! jaseowns_CurrentTargetFocus 0
65@setvar! jaseowns_LastFocusAggressionTarget 0
66@setvar! jaseowns_KillTarget 0
67
68# Pets
69 if not varexist jaseowns_PetOne
70 @setvar! jaseowns_PetOne 0
71 endif
72 if not find jaseowns_PetOne ground -1 -1 20
73 overhead "Select your main tank" 88
74 @setvar! jaseowns_PetOne
75 wait 200
76 endif
77
78 if totalPets = 2 or totalPets = 3 or totalPets = 4 or totalPets = 5
79 if not varexist myOtherPet1
80 @setvar! myOtherPet1 0
81 endif
82 if not find myOtherPet1 ground -1 -1 20
83 overhead "Select your non tank pet 1" 88
84 @setvar! myOtherPet1
85 wait 200
86 endif
87 else
88 @setvar! myOtherPet1 0
89 endif
90
91 if totalPets = 3 or totalPets = 4 or totalPets = 5
92 if not varexist myOtherPet2
93 @setvar! myOtherPet2 0
94 endif
95 if not find myOtherPet2 ground -1 -1 20
96 overhead "Select your non tank pet 2" 88
97 @setvar! myOtherPet2
98 wait 200
99 endif
100 else
101 @setvar! myOtherPet2 0
102 endif
103
104 if totalPets = 4 or totalPets = 5
105 if not varexist myOtherPet3
106 @setvar! myOtherPet3 0
107 endif
108 if not find myOtherPet3 ground -1 -1 20
109 overhead "Select your non tank pet 3" 88
110 @setvar! myOtherPet3
111 wait 200
112 endif
113 else
114 @setvar! myOtherPet3 0
115 endif
116
117 if totalPets = 5
118 if not varexist myOtherPet4
119 @setvar! myOtherPet4 0
120 endif
121 if not find myOtherPet4 ground -1 -1 20
122 overhead "Select your non tank pet 4" 88
123 @setvar! myOtherPet4
124 wait 200
125 endif
126 else
127 @setvar! myOtherPet4 0
128 endif
129endif
130
131if not timerexists bandageCheckTimer
132 createtimer bandageCheckTimer
133 settimer bandageCheckTimer bandageCheckTimerCd
134endif
135
136if not timerexists HealTargetTimer
137 createtimer HealTargetTimer
138 settimer HealTargetTimer HealTargetTimerCd
139endif
140
141
142clearsysmsg
143
144while not dead
145
146 if insysmsg 'world is saving'
147 for 60
148 overhead 'Waiting for world save...'
149 wait 100
150 if insysmsg 'save complete'
151 overhead 'Save complete - continue on!' 88
152 break
153 endif
154 endfor
155 endif
156
157 // Trapped
158 if paralyzed
159 if findtype "pouch" backpack 38
160 yell "[pouch"
161 wait minimumWaitForPing
162 else
163 overhead "Out of Pouches!" 34
164 endif
165 endif
166
167 if findbuff "weaken" and weight > maxweight
168 if findtype "gold coin" backpack as item
169 lift item 2000
170 droprelloc 0 0
171 wait minimumWaitForPing
172 if insysmsg "cannot drop anything"
173 drop backpack -1 -1 -1
174 endif
175 wait minimumWaitForPingUnequipping
176 else
177 overhead "We are overweight and cannot drop anything" 34
178 endif
179 endif
180
181 ###############
182 ### Pet Healing
183 #############
184 @setvar! canUseKit 1
185 if requireWarModeToHealPets = 1 and not warmode
186 @setvar! canUseKit 0
187 endif
188
189 if not bandaging
190 if canUseKit = 1 and timer bandageCheckTimer > bandageCheckTimerCd
191 if findtype "veterinary supplies" backpack as item
192 dclick item
193 wait 650
194 endif
195 settimer bandageCheckTimer 0
196 else
197 if hp < maxhp
198 // we need to heal
199 if findtype "veterinary supplies" backpack as item
200 dclick item
201 wait 650
202 elseif not bandaging and findtype 'clean bandage%s%'
203 hotkey 'bandage self'
204 endif
205
206 if diffhits >= ohCrapDrinkAHealthPotHpCheck
207 if findtype "Yellow Potion" backpack as pot
208 dclick pot
209 wait 650
210 endif
211 endif
212 endif
213
214 if not bandaging and findtype "clean bandage%s%" backpack as item
215 dclick item
216 wft 650
217 target jaseowns_PetOne
218 overhead "Heal Target" 77 jaseowns_PetOne
219 wait minimumWaitForPingUnequipping
220 endif
221 if myOtherPet1 != 0 and not bandaging and findtype "clean bandage%s%" backpack as item
222 dclick item
223 wft 650
224 target myOtherPet1
225 overhead "Heal Target" 66 myOtherPet1
226 wait minimumWaitForPingUnequipping
227 endif
228 if myOtherPet2 != 0 and not bandaging and findtype "clean bandage%s%" backpack as item
229 dclick item
230 wft 650
231 target myOtherPet2
232 overhead "Heal Target" 55 myOtherPet2
233 wait minimumWaitForPingUnequipping
234 endif
235 if myOtherPet3 != 0 and not bandaging and findtype "clean bandage%s%" backpack as item
236 dclick item
237 wft 650
238 target myOtherPet3
239 overhead "Heal Target" 44 myOtherPet3
240 wait minimumWaitForPingUnequipping
241 endif
242 if myOtherPet4 != 0 and not bandaging and findtype "clean bandage%s%" backpack as item
243 dclick item
244 wft 650
245 target myOtherPet4
246 overhead "Heal Target" 33 myOtherPet4
247 wait minimumWaitForPingUnequipping
248 endif
249 endif
250 else
251 settimer bandageCheckTimer 0
252 endif
253
254
255 ###############
256 ### Potions
257 #############
258 if not findtype "White Potion" backpack
259 @setvar! automaticallyDrinkStrPot 0
260 endif
261
262 if not findtype "Blue Potion" backpack
263 @setvar! automaticallyDrinkAgiPot 0
264 endif
265
266 if not findtype "Black Potion" backpack
267 @setvar! automaticallyDrinkMagicPot 0
268 endif
269
270 # Eat food if we got it
271 if not findbuff "food" and findtype "tray" backpack as jood
272 dclick jood
273 wait minimumWaitForPing
274 endif
275
276 @setvar! needStrBuff 0
277 @setvar! needDexBuff 0
278 @setvar! needMagicBuff 0
279 @setvar! needHealPot 0
280 @setvar! needCurePot 0
281 @setvar! needRefreshPot 0
282
283 @setvar! drinkThosePots 0
284
285 if targetInRange = 1
286 @setvar! drinkThosePots 1
287 elseif warmode and drinkPotionsEvenIfInWarModeAndYouLoseHealth = 1 and hp < maxhp
288 @setvar! drinkThosePots 1
289 endif
290
291 if automaticallyDrinkStrPot = 1 and drinkThosePots = 1 and not findbuff "Strength"
292 @setvar! needStrBuff 1
293 endif
294
295 if automaticallyDrinkAgiPot = 1 and drinkThosePots = 1 and not findbuff "Agility"
296 @setvar! needDexBuff 1
297 endif
298
299 if automaticallyDrinkMagicPot = 1 and drinkThosePots = 1 and not findbuff "Magic Resist Potion"
300 @setvar! needMagicBuff 1
301 endif
302
303 if automaticallyDrinkHealPot = 1 and hp <= hpCheckToTriggerHealPotion
304 @setvar! needHealPot 1
305 endif
306
307 if automaticallyDrinkCurePot = 1 and poisoned and hp <= hpCheckToTriggerCurePotion
308 @setvar! needCurePot 1
309 endif
310
311 if automaticallyDrinkRefreshPot = 1 and diffstam >= stamDiffCheckToTriggerRedPotion
312 @setvar! needRefreshPot 1
313 endif
314
315 if needStrBuff = 1 and not findtype "White Potion" backpack
316 @setvar! needStrBuff 0
317 endif
318
319 if needDexBuff = 1 and not findtype "Blue Potion" backpack
320 @setvar! needDexBuff 0
321 endif
322
323 if needMagicBuff = 1 and not findtype "Black Potion" backpack
324 @setvar! needMagicBuff 0
325 endif
326
327 if needHealPot = 1 and not findtype "Yellow Potion" backpack
328 @setvar! needHealPot 0
329 elseif needHealPot = 1 and findtype "Yellow Potion" backpack as item
330 getlabel item healPotDesc
331 if "next usable" in healPotDesc
332 @setvar! needHealPot 0
333 else
334 @setvar! needHealPot 1
335 endif
336 endif
337
338 if needCurePot = 1 and not findtype "Orange Potion" backpack
339 @setvar! needCurePot 0
340 endif
341
342 if needRefreshPot = 1 and not findtype "Red Potion" backpack
343 @setvar! needRefreshPot 0
344 endif
345
346 @setvar! jaseCanDrinkPotion 0
347
348 if needStrBuff = 1 or needDexBuff = 1 or needMagicBuff = 1 or needHealPot = 1 or needCurePot = 1 or needRefreshPot = 1
349
350 @setvar! jaseRightHand 0
351 @setvar! jaseLeftHand 0
352 @setvar! needTwoHandSwap 0
353 @setvar! needShieldSwap 0
354
355 if skill "Alchemy" >= 80
356 @setvar! jaseCanDrinkPotion 1
357 else
358 if not findlayer self lefthand and not findlayer self righthand
359 @setvar! jaseCanDrinkPotion 1
360 else
361 if findlayer self lefthand as myLefthand
362 @setvar! jaseLeftHand myLefthand
363 endif
364 if findlayer self righthand as myRightHand
365 @setvar! jaseRightHand myRightHand
366 endif
367 if not lhandempty
368 if not rhandempty
369 @setvar! jaseCanDrinkPotion 0
370 else
371 // handle two handed weapons
372 getlabel jaseLeftHand desc
373 if skill "Swordsmanship" > 0
374 if "axe" in desc or "bardiche" in desc or "halberd" in desc
375 @setvar! jaseCanDrinkPotion 0
376 @setvar! needTwoHandSwap 1
377 else
378 @setvar! jaseCanDrinkPotion 1
379 endif
380 elseif skill "Mace Fighting" > 0
381 if "staff" in desc or "crook" in desc or "war hammer" in desc
382 @setvar! jaseCanDrinkPotion 0
383 @setvar! needTwoHandSwap 1
384 else
385 @setvar! jaseCanDrinkPotion 1
386 endif
387 elseif skill "Fencing" > 0
388 if "spear" in desc or "pitchfork" in desc
389 @setvar! jaseCanDrinkPotion 0
390 @setvar! needTwoHandSwap 1
391 else
392 @setvar! jaseCanDrinkPotion 1
393 endif
394 elseif skill "Archery" > 0
395 if "bow" in desc or "heavy crossbow" in desc
396 @setvar! jaseCanDrinkPotion 0
397 @setvar! needTwoHandSwap 1
398 else
399 @setvar! jaseCanDrinkPotion 1
400 endif
401 elseif skill "Wrestling" > 0
402 @setvar! jaseCanDrinkPotion 1
403 endif
404 endif
405 endif
406 if not rhandempty
407 if lhandempty
408 @setvar! jaseCanDrinkPotion 1
409 else
410 @setvar! needShieldSwap 1
411 endif
412 endif
413 endif
414 endif
415
416 if jaseCanDrinkPotion = 1
417 // do nothing
418 else
419 if needTwoHandSwap = 1
420 if skill "Swordsmanship" > 0 and findtype "cutlass|broadsword|scimitar|viking sword|longsword|katana" backpack as item
421 dclick item
422 wait minimumWaitForPing
423 elseif skill "Mace Fighting" > 0 and findtype "maul|war axe|war mace|mace|hammer pick|club" backpack as item
424 dclick item
425 wait minimumWaitForPing
426 elseif skill "Fencing" > 0 and findtype "kryss|war fork" backpack as item
427 dclick item
428 wait minimumWaitForPing
429 elseif skill "Archery" > 0 and findtype "crossbow" backpack as item
430 dclick item
431 wait minimumWaitForPing
432 else
433 hotkey 'Arm/Disarm Left Hand'
434 wait minimumWaitForPing
435 endif
436 @setvar! jaseCanDrinkPotion 1
437 elseif needShieldSwap = 1
438 overhead "we should be disarming left hand"
439 while not lhandempty
440 hotkey 'Arm/Disarm Left Hand'
441 wait minimumWaitForPingUnequipping
442 while queued
443 wait 100
444 endwhile
445 endwhile
446 setvar! jaseCanDrinkPotion 1
447 endif
448 endif
449
450 if jaseCanDrinkPotion = 1
451 if needHealPot = 1
452 if findtype "Yellow Potion" backpack as jotion
453 overhead "chug heal"
454 dclick jotion
455 wait minimumWaitForPing
456 cooldown "Yellow Potion" 10000
457 else
458 overhead "No Heal potion found!" 34
459 endif
460 endif
461
462 if needCurePot = 1
463 if findtype "Orange Potion" backpack as jotion
464 overhead "chug cure"
465 dclick jotion
466 wait minimumWaitForPing
467 else
468 overhead "No Cure potion found!" 34
469 endif
470 endif
471
472
473 if needDexBuff = 1
474 if findtype "Blue Potion" backpack as jotion
475 overhead "chug"
476 dclick jotion
477 wait minimumWaitForPing
478 else
479 overhead "No AGI potion found!" 34
480 endif
481 endif
482
483 if automaticallyDrinkRefreshPot = 1 and diffstam >= stamDiffCheckToTriggerRedPotion
484 @setvar! needRefreshPot 1
485 endif
486
487 if needRefreshPot = 1
488 if findtype "Red Potion" backpack as jotion
489 overhead "chug refresh"
490 dclick jotion
491 wait minimumWaitForPing
492 else
493 overhead "No Refresh potion found!" 34
494 endif
495 endif
496
497 if needStrBuff = 1
498 if findtype "White Potion" backpack as jotion
499 overhead "chug"
500 dclick jotion
501 wait minimumWaitForPing
502 else
503 overhead "No STR potion found!" 34
504 endif
505 endif
506
507 if needMagicBuff = 1
508 if findtype "Black Potion" backpack as jotion
509 overhead "chug"
510 dclick jotion
511 wait minimumWaitForPing
512 else
513 overhead "No MR potion found!" 34
514 endif
515 endif
516
517 if needTwoHandSwap = 1
518 dclick jaseLeftHand
519 wait minimumWaitForPing
520 elseif needShieldSwap = 1
521 hotkey 'Arm/Disarm Left Hand'
522 wait minimumWaitForPingUnequipping
523 endif
524 endif
525 endif
526
527
528 ###############
529 ### Self Healing
530 #############
531 if hp < maxhp
532 // we need to heal
533 if findtype "veterinary supplies" backpack as item
534 dclick item
535 wait 650
536 elseif not bandaging and findtype 'clean bandage%s%'
537 hotkey 'bandage self'
538 endif
539
540 if diffhits >= ohCrapDrinkAHealthPotHpCheck
541 if findtype "Yellow Potion" backpack as pot
542 dclick pot
543 wait 650
544 endif
545 endif
546 endif
547
548 ###############
549 ### Targeting (based on warmode on)
550 #############
551 if warmode
552 @setvar! myKillTarget 0
553 @hotkey 'Target Closest Non-Friendly Monster'
554 wait minimumWaitForPing
555 if insysmsg "No one matching that was found"
556 if timer preventOverheadSpamTimer >= cdPreventOverheadSpam
557 overhead "No targets found" 34
558 settimer preventOverheadSpamTimer 0
559 endif
560 else
561 @setvar! myKillTarget lasttarget
562 endif
563
564 if not varexist autoAttack
565 @setvar! autoAttack 1
566 endif
567
568 if myKillTarget != 0 and myPreviousKillTarget != myKillTarget
569 getlabel myKillTarget mobDesc
570 @setvar! myPreviousKillTarget myKillTarget
571 if "(summoned" in mobDesc or "(bonded" in mobDesc or "(tame" in mobDesc
572 overhead "▼ Player pet - IGNORE ▼" 77 lasttarget
573 @setvar! autoAttack 0
574 @setvar! myKillTarget 0
575 else
576 @setvar! autoAttack 1
577 endif
578 endif
579
580 if myKillTarget = 0
581 // do nothing
582 elseif not find myKillTarget ground -1 -1 myRangeCheckForTarget
583 if showTargetOverheadMessages = 1 and timer preventOverheadSpamTimer >= cdPreventOverheadSpam
584 overhead "● ▼ OUT OF RANGE ▼ ●" 88 lasttarget
585 settimer preventOverheadSpamTimer 0
586 endif
587 if find myKillTarget ground -1 -1 8 and autoAttack = 1
588 attack myKillTarget
589 endif
590 elseif autoAttack = 1
591 @setvar! targetInRange 1
592 if showTargetOverheadMessages = 1 and timer preventOverheadSpamTimer >= cdPreventOverheadSpam
593 overhead "● ▼▼ HERE ▼▼ ●" 88 myKillTarget
594 settimer preventOverheadSpamTimer 0
595 endif
596 attack myKillTarget
597 endif
598 endif
599
600 if not timerexists GuardTimer
601 createtimer GuardTimer
602 settimer GuardTimer 0
603 endif
604 ###############
605 ### Herding
606 #############
607
608 if myKillTarget != 0 and find myKillTarget ground -1 -1 12
609 @setvar jaseowns_KillTarget myKillTarget
610 if jaseowns_KillTarget != jaseowns_LastFocusAggressionTarget
611 if find jaseowns_PetOne and timer GuardTimer > GuardTimerCd
612 if find jaseowns_PetOne
613 overhead "● Guarding ●" 88 jaseowns_PetOne
614 if skill "Herding" > 0
615 menu jaseowns_PetOne 4
616 settimer GuardTimer 0
617 else
618 menu jaseowns_PetOne 3
619 settimer GuardTimer 0
620 endif
621 endif
622 endif
623
624 if timer jaseowns_SkillTimerCheck >= jaseowns_SkillTimerCD and findtype 3713 backpack as jrook
625 settimer jaseowns_SystemMsgCheck 0
626 while timer jaseowns_SystemMsgCheck <= jaseowns_SystemMsgCheckCD
627 if not targetexists
628 overhead "● ▼ Attempting Herd ▼ ●" 88 jaseowns_KillTarget
629 dclick jrook
630 wft 500
631 else
632 break
633 endif
634 endwhile
635 if insysmsg "What do you wish to focus your" and targetexists
636 target jaseowns_KillTarget
637 settimer jaseowns_SystemMsgCheck 0
638 while timer jaseowns_SystemMsgCheck <= jaseowns_SystemMsgCheckCD
639 if insysmsg "You focus your follower"
640 @setvar! jaseowns_LastFocusAggressionTarget jaseowns_KillTarget
641 break
642 elseif insysmsg "Target cannot be seen"
643
644 endif
645 endwhile
646 if not targetexists
647 settimer jaseowns_SkillTimerCheck 10000
648 endif
649 endif
650 endif
651 endif
652 else
653 @setvar! jaseowns_LastFocusAggressionTarget 0
654 endif
655
656
657
658 ###############
659 ### Discord
660 #############
661
662 if myKillTarget != 0 and find myKillTarget ground -1 -1 12 and skill 'Discordance' > 0
663 useskill 'Discordance'
664 wait 600
665 if insysmsg "What instrument"
666 if findtype "bamboo flute" backpack as inny
667 target inny
668 elseif findtype "tambourine" backpack as inny
669 target inny
670 elseif findtype "drum" backpack as inny
671 target inny
672 elseif findtype "lute" backpack as inny
673 target inny
674 elseif findtype "lap harp" backpack as inny
675 target inny
676 else
677 overhead "I do not have an inny" 34
678 wait 2000
679 replay
680 endif
681 wait 600
682 overhead "● ▼▼ HERE ▼▼ ●" 88 myKillTarget
683 settimer preventOverheadSpamTimer 0
684 target myKillTarget
685 endif
686 settimer "DiscoTimer" 0
687 endif
688
689
690 ###############
691 ### Discord Buff
692 #############
693 if skill 'Discordance' > 0
694 if not findbuff "song of discordance"
695 overhead 'Discord Buff.'
696 useskill 'Discordance'
697 wait 600
698 if insysmsg "what do you wish to discord"
699 wait 600
700 target backpack
701 elseif insysmsg "What instrument"
702 if findtype "bamboo flute" backpack as inny
703 target inny
704 elseif findtype "tambourine" backpack as inny
705 target inny
706 elseif findtype "drum" backpack as inny
707 target inny
708 elseif findtype "lute" backpack as inny
709 target inny
710 elseif findtype "lap harp" backpack as inny
711 target inny
712 else
713 overhead "I do not have an inny" 34
714 wait 2000
715 replay
716 endif
717 endif
718 endif
719 endif
720 ###############
721 ### Peacemaking Buff
722 #############
723 if skill "Peacemaking" > 0
724 if not findbuff "song of peacemaking"
725 overhead 'Peace Buff.'
726 useskill 'Peacemaking'
727 wft 600
728 if insysmsg "what do you wish to Pacify"
729 wait 600
730 target backpack
731 elseif insysmsg "What instrument"
732 if findtype "bamboo flute" backpack as inny
733 target inny
734 elseif findtype "tambourine" backpack as inny
735 target inny
736 elseif findtype "drum" backpack as inny
737 target inny
738 elseif findtype "lute" backpack as inny
739 target inny
740 elseif findtype "lap harp" backpack as inny
741 target inny
742 else
743 overhead "I do not have an inny" 34
744 wait 2000
745 replay
746 endif
747 endif
748 endif
749 endif
750
751endwhile
752
753while dead
754 overhead "Rip" 34
755 if gumpexists 2957810225
756 gumpresponse 1 2957810225
757 break
758 endif
759 wait 500
760endwhile
761
762replay