Beastlord bot (Updated 05/07/05)

Post your completed (working) macros here. Only for macros using MQ2Data syntax!

Moderator: MacroQuest Developers

User avatar
fearless
Not a Psychic
Posts: 2684
Joined: Wed Mar 10, 2004 3:52 pm

Post by fearless » Sun Jul 03, 2005 2:10 pm

snomanx3 wrote:Im talking about a released version oh brilliant one. This is the only mac that doesnt work so its something im doing or a true bug. I will try again on the next release.
On
Fri Jul 01, 2005 11:39 am
there was no released version of MQ2 that worked.

Thank you, drive through, try again.

And for your information, this macro won't work as posted anyway. It's got some String problems.
Last edited by fearless on Sun Jul 03, 2005 4:43 pm, edited 1 time in total.
Reading . . . it's not just for me.

[url=http://www.catb.org/~esr/faqs/smart-questions.html]How To Ask Questions The Smart Way[/url]
[quote="Ccomp5950"]Fearless showed me the light, you too shall learn.[/quote]

DigitalMocking
a grimling bloodguard
a grimling bloodguard
Posts: 620
Joined: Mon Apr 04, 2005 5:53 pm

Post by DigitalMocking » Sun Jul 03, 2005 4:23 pm

Fixes:

Code: Select all

Change this line:
/if (${Spawn[${sID}].Class.Name.Equal[${String[${SpellBuff[${i},2]}].Arg[${h},,]}]} && !${Spawn[${sID}].Type.Equal[Corpse]}) { 
To this:
/if (${SpellBuff[${i},2].Arg[${h},,].Find[${Spawn[${sID}].Class.Name}]}&& !${Spawn[${sID}].Type.Equal[Corpse]}) {

and this line:
/varset Classes ${String[${SpellBuff[${i},2]}].Count[,]} 
To this:
/varset Classes ${SpellBuff[${i},2].Count[,]}
That'll get you working.

To be honest, there are still some real problems with this macro where it just stands around for long periods of time before engaging, as well as the 'home' anchor code, it'll just run in circles forever.

I'm not sure if guest_01 is still updating it, I've got the slow and add detection routines rewritten so you don't need the plugin, I'll post them later today if I get some time.

DigitalMocking
a grimling bloodguard
a grimling bloodguard
Posts: 620
Joined: Mon Apr 04, 2005 5:53 pm

Updated Macro (part1)

Post by DigitalMocking » Mon Jul 04, 2005 4:51 am

Here's the updated macro with new slow code to get all mobs in range and some other fixes to keep the macro working a bit better. There's still an odd pause before combat at times, just haven't looked into it.

Code: Select all

#chat group 
#chat tell 

#Event   ToggleVariable   "[MQ2] Toggle #1#" 
#Event   ToggleVariable   "[MQ2] Toggle #1# #2#" 
#Event   Zoned           "LOADING, PLEASE WAIT..." 
#Event   OutDoor         "#*#outdoors#*#" 
#Event   NoMount         "You can not summon a mount here." 
#Event   ImDead          "You have been slain by#*#" 
#Event   Invited         "#*#To join the group, click on the 'FOLLOW' option, or 'DISBAND' to cancel#*#" 
#Event   UnderAttack         "#*#YOU for#*#points of damage." 
#Event   UnderAttack         "#*#YOU, but YOU#*#!" 
#Event   UnderAttack         "#*#YOU, but misses!" 

| GM's and Guides ALWAYS open conversation saying who they are 
#event GMInZone "#*#tells you,#*# GM #*#" 
#event GMInZone "#*#tells you,#*# Guide #*#" 
#event GMInZone "#*#tells you,#*# gamemaster #*#" 
#event GMInZone "#*#tells you,#*# Game Master #*#" 
#event GMInZone "#*#tells you,#*# Customer Service #*#" 
#event GMInZone "#*#tells you,#*# CSR #*#" 

/declare noInvis int outer 1 

#include Spell_Routines.inc 
#include advpath.inc 

|-- The normal debug - for normal play. Enable: "/echo", Disable: "/squelch /echo" 
#define DEBUG_1 "/echo" 
|-- Deeper debugging - enable when trying to find bugs. Enable: "/echo", Disable: "/squelch /echo" 
#define DEBUG_2 "/echo" 
|-- The Deepest debugging - will spam a lot. Enable: "/echo", Disable: "/squelch /echo" 
#define DEBUG_3 "/echo" 

|-- Also loot items? 
#define LOOT_ITEMS FALSE
|-- Loot all items? 
#define LOOT_ALL_ITEMS FALSE 
|-- Destroy the remaining items -not in use atm 
|#define LOOT_DESTROY False 
|-- What lvl should the mob be before we bother looting it 
#define LOOT_ABOVE_LEVEL 1 
|-- Keep loot record - Will display how much you have looted + items 
#define LOOT_KEEP_RECORD TRUE 

|-- No matter other settings. If the value of the item is above this, GET IT! (Value is in copper) 
|-- Not nodrop 
#define LOOT_NORMAL_ITEMS_IF_VALUE_IS_ABOVE 40000 
|-- No matter other settings. If the value of the item is above this and stackable, GET IT! (Value is in copper) 
|-- Not lore, not nodrop 
#define LOOT_STACKABLE_ITEMS_IF_VALUE_IS_ABOVE 4000 

Sub Main 
/call InitAPFVars 1 15 20 

| ########### Make changes in spells as you need. 
  | The % of your spell duration bonus. 
  /declare SpellDurationBonus   outer 30 
    
  |- If you have no focus item, leave it blank. 
  /declare BuffFocusItem       outer "" 

  /declare SpellPetHeal         string outer "Healing of Mikkily"
  /declare SpellPetHealGem      int    outer 1 
  /declare SpellHeal            string outer "Muada's Mending"
  /declare SpellHealGem         int    outer 2 
  /declare SpellSlow            string outer "Sha's Revenge"
  /declare SpellSlowGem         int    outer 3 
  /declare SpellDeBuff          string outer "Incapacitate"
  /declare SpellDeBuffGem       int    outer 4
  /declare SpellFirstNuke       string outer "Ice Shard"
  /declare SpellFirstNukeGem    int    outer 5 
  /declare SpellOtherNuke       string outer "Frost Spear"
  /declare SpellOtherNukeGem    int    outer 6 
  /declare SpellDoT             string outer "Chimera Blood"
  /declare SpellDoTGem          int    outer 7 
  /declare SpellATK             string outer "Ferocity"
  /declare SpellATKGem          int    outer 8
  
  /declare SpellBuffsGem        outer 9
  /declare SpellPet             outer "Spirit of Alladnu" 
  /declare SpellPetGem          outer 9

  /declare SpellPetBuff[5] string outer 
  /varset  SpellPetBuff[1] "Growl of the Beast" 
  /varset  SpellPetBuff[2] "Spirit of Irionu"
  /varset  SpellPetBuff[3] "Ferocity" 
  /varset  SpellPetBuff[4] "Focus of Alladnu" 
  /varset  SpellPetBuff[5] "Infusion of Spirit"

  /declare ItemPetBuff[1,2] string outer 
  /varset  ItemPetBuff[1,1] "Savage Lord's Totem" 
  /varset  ItemPetBuff[1,2] "Savage Wildcaller's Blessing" 
  
| ############ The Magic of single spell buffs... 
| ############ 
| ############ /declare SpellBuff[2,2] string outer 
| ############  Do only change the 1st number in [#,#] 
| ############  If you have three single spells to cast change the 1st number to 3. 
| ############ /declare SpellBuff[3,2] string outer 
| ############ 
| ############ /varset SpellBuff[1,1] "Spirit of Sense" 
| ############  This is the 1st line that is needed, Here you write your spell name 
| ############ /varset SpellBuff[1,2] "Warrior,Monk,Cleric,Shaman,Enchanter," 
| ############  The 2nd line is for the classes who gets the buff. 
| ############ NOTE: Only classes in group will get buffed 
| ############ NOTE: End the class line with a , If not you can BLOW up your computer. ;P 
  /declare SpellBuff[5,2] string outer 
  /varset SpellBuff[1,1] Focus of Alladnu 
  /varset SpellBuff[1,2] "Bard,Beastlord,Berserker,Monk,Paladin,Ranger,Rogue,Warrior," 
  /varset SpellBuff[2,1] Infusion of Spirit 
  /varset SpellBuff[2,2] "Bard,Beastlord,Berserker,Monk,Paladin,Ranger,Rogue,Shadowknight,Warrior," 
  /varset SpellBuff[3,1] Stamina 
  /varset SpellBuff[3,2] "Cleric,Druid,Enchanter,Magician,Necromancer,Wizard," 
  /varset SpellBuff[4,1] Chloroplast
  /varset SpellBuff[4,2] "Bard,Beastlord,Berserker,Monk,Paladin,Ranger,Rogue,Shadowknight,Warrior,Necromancer," 
  /varset SpellBuff[5,1] Frenzy 
  /varset SpellBuff[5,2] "Beastlord," 

| ############ Group buffs... 

  /declare SpellGrpBuff[2] string outer 
  /varset SpellGrpBuff[1] Spiritual Dominion 
  /varset SpellGrpBuff[2] Spiritual Vitality 

  /declare DoSingleBuffs             outer TRUE 
  /declare DoBuffs                   outer TRUE 
  /declare AssistAt            int   outer 100 
  /declare CombatAt            int   outer 96
  /declare PetCombatAt         int   outer 98
  /declare CastDoTat           int   outer 98 
  /declare MinDoTat            int   outer 60 
  /declare MinNukeat           int   outer 10 
  /declare MinManaForNuke      int   outer 65 
  /declare NukeAt              int   outer 95 
  /declare DelayBetweenNukes   int   outer 0 
  /declare HealPetAt           int   outer 50 
  /declare HealGroupAt         int   outer 60 
  /declare HealInterrupt       int   outer 90
  /declare DowntimeHealGroupAt int   outer 40 
  /declare CastATK                   outer TRUE
  /declare DoMelee                   outer TRUE 
  /declare DoDebuff                  outer FALSE
  /declare DoSlow                    outer FALSE
  /declare SlowAllAdds               outer FALSE
  /declare FastSlow                  outer FALSE
  /declare SummonPet                 outer TRUE 
  /declare BuffPet                   outer TRUE 
  /declare HealPets                  outer TRUE 
  /declare DoDoT                     outer TRUE 
  /declare DoNuke                    outer TRUE 
  /declare DoHeal                    outer TRUE 
  /declare Verbose                   outer FALSE
  /declare quitOnZone                outer FALSE 
  /declare TetheredToHome            outer TRUE 
  /declare PathFile                  outer "HS" 
  /declare AutoPull                  outer FALSE 
  /declare AutoPullDistance          outer 125 
  /declare AutoPullEngageDistance    outer 20 
  /declare AutoLoot                  outer FALSE 
  /declare AutoMove                  outer FALSE 
  /declare AllowAutoFollow           outer TRUE 
  | This is a delay for how long Avatar will hold. (6min) 
  /declare AvatarDelay       outer 4000 
  |Loot items we want to loot 
  /declare LootList[6] string outer 
  /varset LootList[1] "silk" 
  /varset LootList[2] "Dust of Decay" 
  /varset LootList[3] "Emerald" 
  /varset LootList[4] "Opal" 
  /varset LootList[5] "Pearl" 
  /varset LootList[6] "Peridot" 
  /squelch /alias /dodebuff /echo toggle malo 
  /squelch /alias /doslow /echo toggle slow 
  /squelch /alias /dofastslow /echo toggle fastslow 
  /squelch /alias /doroot /echo toggle root 
  /squelch /alias /dopet /echo toggle pet 
  /squelch /alias /dodot /echo toggle dot 
  /squelch /alias /donuke /echo toggle nuke 
  /squelch /alias /nukeat /echo toggle nukeat    
  /squelch /alias /dobuffs /echo toggle buffs 
  /squelch /alias /dosow /echo toggle sow 
  /squelch /alias /assistat /echo toggle assistat 
  /squelch /alias /dotat /echo toggle dotat 
  /squelch /alias /rootat /echo toggle rootat 
  /squelch /alias /combatat /echo toggle combatat 
  /squelch /alias /healmeleeat /echo toggle healmeleeat 
  /squelch /alias /healcastersat /echo toggle healcastersat 
  /squelch /alias /healtankat /echo toggle healtankat 
  /squelch /alias /doassist /echo toggle assist 
  /squelch /alias /healat /echo toggle healat 
  /squelch /alias /status /echo toggle show 
  /squelch /alias /show /echo toggle show    
  /squelch /alias /bothelp /echo toggle help 
  /squelch /alias /verbose /echo toggle verbose    
  /squelch /alias /resetbuffs /echo toggle resetbuffs 
  /squelch /alias /clearpathing /echo toggle clearpathing 
  /squelch /alias /dohot /echo toggle dohot 
  /squelch /alias /doheal /echo toggle doheal 
  /squelch /alias /HealPets /echo toggle HealPets 
  /squelch /alias /DoRootParking /echo toggle DoRootParking 
  /squelch /alias /buff /echo toggle buff 
  /squelch /alias /DoMelee /echo toggle DoMelee 
  /squelch /alias /CastATK /echo toggle CastATK 
  /squelch /alias /dofollow /echo toggle dofollow 
  /squelch /alias /ClearBuffees /echo toggle ClearBuffees 
   
  /declare M_Assist        string outer 
  /declare OutDoors               outer TRUE 
  /declare SpDuration             outer 
  /declare SpCastTime             outer 
  /declare SpDurBonus             outer 
  /declare MainItem               outer 
  /declare MeLoM                  outer FALSE 
  /declare TargetArray[4]  string outer 
  /declare MobDebuffed            outer FALSE 
  /declare MobSlowed              outer FALSE 
  /declare PetOn                  outer FALSE 
  /declare MobRooted              outer FALSE 
  /declare MobDoTed               outer FALSE 
  /declare CombatOn               outer TRUE 
  /declare i               int    local 
  /declare Exper           float  outer 
  /declare AAExp           float  outer 
  /varset Exper ${Me.Exp} 
  /varset AAExp ${Me.AAExp} 
  /squelch /declare ATKBuffed0 timer global 0 
  /squelch /declare ATKBuffed1 timer global 0 
  /squelch /declare ATKBuffed2 timer global 0 
  /squelch /declare ATKBuffed3 timer global 0 
  /squelch /declare ATKBuffed4 timer global 0 
  /squelch /declare ATKBuffed5 timer global 0 
  /declare CallManaTmr timer outer 0 
  /varset MobRooted FALSE 
  /varset MobDebuffed FALSE 
  /varset MobSlowed FALSE 
  /varset PetOn FALSE 
  /varset MobDoTed FALSE 
  /varset MobRooted FALSE 
  /varset MobDebuffed FALSE 
  /varset MobSlowed FALSE 
  /varset PetOn FALSE 
  /varset MobDoTed FALSE 
  /varset CombatOn FALSE 
    
  /varset TargetArray[1] NULL 
  /varset TargetArray[2] NULL 
  /varset TargetArray[3] NULL 
  /varset TargetArray[4] NULL 
      
  /squelch /stick off 
  /declare GroupMemHoTTime0 timer outer 0 
  /declare GroupMemHoTTime1 timer outer 0 
  /declare GroupMemHoTTime2 timer outer 0 
  /declare GroupMemHoTTime3 timer outer 0 
  /declare GroupMemHoTTime4 timer outer 0 
  /declare GroupMemHoTTime5 timer outer 0 
  /declare GroupMemPetHoTTime0 timer outer 0 
  /declare GroupMemPetHoTTime1 timer outer 0 
  /declare GroupMemPetHoTTime2 timer outer 0 
  /declare GroupMemPetHoTTime3 timer outer 0 
  /declare GroupMemPetHoTTime4 timer outer 0 
  /declare GroupMemPetHoTTime5 timer outer 0 
  /declare DebuffTimers[10] int outer 
  /declare grpBuffTimer timer outer 
  /declare grpBuffTimesAttempted int outer 
  /declare j int local 1 
  /declare following string outer FALSE 
  /declare tookAction int outer 0 
  /declare WaitingOnSpell int outer 0 
  /declare didCanni int outer 0 
  /declare noMoveCount int outer 0 
  /declare underAttack timer outer 0 
  /declare underAttackBy int outer NULL 
  /declare LastSLAdded int outer 
  /squelch /declare SafeLocs[20,2] float global 
  /declare PrevLoc[4] float outer 
  /varset PrevLoc[1] 0 
  /varset PrevLoc[2] 0 
  /varset PrevLoc[3] 0 
  /varset PrevLoc[4] 0 
  /declare HomeX   int outer 
  /declare HomeY   int outer 
  /declare DotTime timer outer 
  /declare MoveToTmr timer outer 
  /declare DoingMove outer 0 
  /declare PrevMana outer 0 
  /squelch /declare otherBuffees[0] string global 
  /declare nukeTimer timer outer 0 
  /declare GotMob   int outer 0 
  /declare GotMobID int outer 0 
  /declare BuffsDone int outer 0 
  /declare delayMoveTimer timer outer 0 
  /declare doingPath int outer 0 
  /declare WaitForMob timer outer 0 
  /declare lootcnt int outer 0       |Loot counter 
  /declare stickID int outer 0 
  /declare perfectionNeeded int outer 0 
  /declare perfectionAnnounced int outer 0 
  /declare attemptedLoot int outer 0 
  /declare doorAttempt timer local 0 
  /declare DelayPull timer outer 0 
  /declare DidDelay int outer 0 
  /declare singleBuffsDone int outer 0 
  /declare DEBUG outer TRUE
  /declare SAFETOCAST outer TRUE
  /call MemSpells 
  /call SilentFunction 
    
| ############### Target a player as Main Assist 
  /if ((!${Target.ID} || (!${Target.Type.Equal[PC]} && !${Target.Type.Equal[Pet]})) && !${Defined[Param0]}) { 
    /varset M_Assist ${Me.Pet.CleanName} 
  } else /if (${Defined[Param0]}) { 
    /varset M_Assist ${Param0} 
  } else { 
    /varset M_Assist ${Target.CleanName} 
    /assist off 
  } 
  /echo Assist set to ${M_Assist} 

  /if (${AutoPull}) { 
    /call GoHome 
    :GoHomeLoop 
    /call AdvPathPoll 
    /if (${PathingFlag}) /goto :GoHomeLoop 
    /varset DelayPull 0 
    /varset DidDelay 1 
  } 
  /varset HomeX ${Me.X} 
  /varset HomeY ${Me.Y} 

  :Main_Loop 
  /if (${DEBUG}) /echo Start of :Main_Loop
  /varset tookAction 0 
  /varset WaitingOnSpell 0 
  /if (!${CombatOn} && ${Me.Combat}) /attack off 
  /if (!${FollowFlag} && !${PathingFlag}) { 
DEBUG_3 D1
    /squelch /stick off 
    /if (${CombatOn}) /target id ${TargetArray[4]} 
    /if (${CombatOn} && ${DoMelee}) /if (${Target.ID} && ${Target.ID} == ${TargetArray[4]} && ${Target.PctHPs} <  ${CombatAt}) { 
      /squelch /stick 20 moveback behindonce
    } 
   } 
  /if (${GotMobID} && ${WaitForMob}<=0 && !${GotMob}) { 
    /varset GotMobID 0 
    /varset WaitForMob 0 
    /varset MobRooted FALSE 
    /varset MobDebuffed FALSE 
    /varset MobSlowed FALSE 
    /varset PetOn FALSE 
    /varset MobDoTed FALSE 
    /varset CombatOn FALSE 
    /varset DotTime 0 
    /varset TargetArray[1] NULL 
    /varset TargetArray[2] NULL 
    /varset TargetArray[3] NULL 
    /varset TargetArray[4] NULL 
    /squelch /stick off 
  } 
  /if (${Me.Pet.Speed}>0) /if (${Math.Distance[${HomeY},${HomeX}:${Spawn[GotMobID].Y},${Spawn[GotMobID].X}]}>25) /if (${WaitForMob}>0 || ${GotMob}) { 
    /pet back 
    /varset PetOn FALSE 
  } 
  /if (${CombatOn} && !${doorAttempt}) { 
    /keypress use 
    /target id ${TargetArray[4]} 
    /varset doorAttempt 150
  } 
  /if (${FollowFlag} || ${PathingFlag}) /call AdvPathPoll 
  /delay 1 
  /if (${PrevLoc[1]}!=${Me.X} || ${PrevLoc[2]}!=${Me.Y}) { 
    /if (${Math.Distance[${PrevLoc[1]},${PrevLoc[2]}:${PrevLoc[3]},${PrevLoc[4]}]} >= 10) { 
      /varset PrevLoc[3] ${PrevLoc[1]} 
      /varset PrevLoc[4] ${PrevLoc[2]} 
    } 
    /varset PrevLoc[1] ${Me.X} 
    /varset PrevLoc[2] ${Me.Y} 
    /varset noMoveCount 0 
  } else { 
    /vardata noMoveCount Math.Calc[${noMoveCount}+1] 
  } 
  /doevents 
  /if (${PathingFlag}) { 
    /if (!${doorAttempt}) {
      /keypress use 
      /varset doorAttempt 150
    }
    /if (${underAttack} && !${GotMob}) { 
      /varset GotMob 1 
      /varset GotMobID ${underAttackBy} 
      /call GoHome 
    } 
    /if (!${GotMob}) { 
      /call PullNearestMob 
      /if (${Macro.Return}) { 
        /varset GotMob 1 
        /call GoHome 
      } 
    } 
    /call AdvPathPoll 
    /goto :Main_Loop 
  } else { 
DEBUG_3 D2
    /if (${GotMob}) { 
      /target id ${GotMobID} 
      /face nolook loc ${PrevLoc[4]}, ${PrevLoc[3]} 
      /varset WaitForMob 300 
      /varset GotMob 0 
    } else /if (!${CombatOn} && !${DidDelay}) { 
      /face nolook loc ${PrevLoc[4]}, ${PrevLoc[3]} 
      /varset DelayPull 300 
      /varset DidDelay 1 
    } 
  } 
  /if (${noMoveCount} > 20 || ${CombatOn}) { 
DEBUG_3 D3
    /if (${Me.Standing} && !${MoveToTmr} && !${FollowFlag} && !${Me.Moving} && !${PathingFlag}) { 
      /if (!${underAttack} && (${Me.PctMana} < 30 || !${DoMelee})) { 
        /squelch /stick off 
        /if (${Me.Standing} && !${underAttack} && ${Me.PctMana} < 85) /sit
        /varset DoingMove 0 
      } else /if (${CombatOn} && ${Target.Type.Equal[NPC]} && !${Target.Type.Equal[Corpse]} && !${Target.Type.Equal[PET]} && ${Target.PctHPs} <= ${CombatAt}) { 
        /sit off 
        /attack on 
        /if (${CombatOn} && ${DoMelee}) /if (${Target.ID} == ${TargetArray[4]}) { 
          /squelch /stick hold 40% moveback 
        } 
      } 
    } 
  /if (!${PathingFlag} && !${GotMob} && (!${GotMobID} || !${WaitForMob} || ${Math.Distance[${HomeY},${HomeX}:${Spawn[${GotMobID}].Y},${Spawn[${GotMobID}].X}]} < ${AutoPullEngageDistance})) {
DEBUG_3 D4
    /call GetTarget 
  }

  /if (!${MoveToTmr} && !${FollowFlag} && !${PathingFlag}) /if (${DoingMove}) { 
DEBUG_3 D5
    /squelch /moveto off 
    /keypress forward 
    /keypress back 
    /delay 1
  } 
  /if (${FollowFlag}) { 
    /if (${CombatOn}) { 
DEBUG_3 D6
      /varset FollowFlag 0 
      /echo Combat Detected. No longer following. Resuming program. 
      /keypress FORWARD 
      /goto :Main_Loop 
    } 
  }    

DEBUG_2 Test 1 
|- Do we move? 
  :Hold_Main 
  /varset BuffsDone 0 
  /varset singleBuffsDone 0 
  /if (!${FollowFlag} && ${Me.Moving}) /goto :Main_Loop 
  /if (!${MoveToTmr} && !${FollowFlag} && !${Me.Moving}) { 
    /if (!${underAttack} && (${Me.PctMana} < 30 || !${CombatOn} || !${DoMelee})) { 
      /squelch /stick off 
      /if (${Me.Standing} && !${underAttack} && ${Me.PctMana} < 85 ) /sit 
      /varset DoingMove 0 
    } else /if (${CombatOn} && ${Target.Type.Equal[NPC]} && !${Target.Type.Equal[Corpse]} && !${Target.Type.Equal[PET]} && ${Target.PctHPs} <= ${CombatAt}) { 
      /sit off 
      /attack on 
      /if (${Target.ID} == ${TargetArray[4]}) { 
        /squelch /stick hold 40% moveback 
      } 
    } 
  } 
|- Let the group know Im LOM 
  /if (${Me.PctMana} < 15 && !${CallManaTmr}) { 
    /if (${Verbose}) /gsay ${Me.PctMana}% Mana 
    /varset CallManaTmr 900 
  } 
|- Am I LoM? 
  /if (${Me.PctMana} < 40) /varset MeLoM TRUE 
  /if (${MeLoM}) /if (${Me.PctMana} > 40) /varset MeLoM FALSE 

DEBUG_2 Test 2 
|- Wait until spells are ready it doesn't think it can cast slow yet if it's been chain healing 
  /if (!${Me.SpellReady[1]} && !${Me.SpellReady[2]} && !${Me.SpellReady[3]} && !${Me.SpellReady[4]}) /goto :Main_Loop 

DEBUG_2 Test 3 
  /if (${DoSlow}) /call CheckDebuffTimers 
  /if (${tookAction} && !${WaitingOnSpell}) /goto :Main_Loop 

DEBUG_2 Test 4 
  /if (${DoSlow}) /call CheckSlowRadius 
  /if (${tookAction} && !${WaitingOnSpell}) /goto :Main_Loop 

DEBUG_2 Test 5 
  /if (${Math.Distance[${HomeY},${HomeX}:${Spawn[GotMobID].Y},${Spawn[GotMobID].X}]}>25) /if (${WaitForMob}>0 || ${GotMob}) /goto :Main_Loop 
|- Group Heals 
  /call Check_grpHPs 
  /if (${tookAction}) /goto :Main_Loop 

DEBUG_2 Test 6 
  /if (${HealPets}) /call Check_grpPetHPs 
  /if (${tookAction}) /goto :Main_Loop  

DEBUG_2 Test 7 
  /if (${MeLoM} || (${Me.PctMana} < 50 && ${Me.PctHPs} < 50) || ${perfectionNeeded}) { 
    /if (${Me.AltAbilityReady[Perfection of Spirit]}) { 
      /squelch /moveto off 
      /squelch /stick off 
      /keypress right 
      /keypress left 
      /delay 3 
      /target id ${Me.ID} 
      /if (!${perfectionAnnounced}) /g INC Perfection of Spirit - Group mana/health regen! 
      /varset perfectionAnnounced 1 
      /call Cast "Perfection of Spirit" alt 
      /if (${Macro.Return.Equal[CAST_SUCCESS]}) { 
        /varset perfectionNeeded 0 
        /varset perfectionAnnounced 0 
      } 
      /delay 2 
    } 
  } 

DEBUG_2 Test 8 
  |- Check for mobs and do combat stuff 
  /if (${CombatOn}) /call Combat    
  /if (${tookAction}) /goto :Main_Loop  
  /if (${Me.PctMana} < 40 || ${CombatOn}) /goto :Main_Loop 

DEBUG_2 Test 9 
  /if (${WaitingOnSpell}) /goto :FollowingBuffs 

DEBUG_2 Test 10 
|- Group Buffs 
  /if (${DoBuffs}) /if (!${grpBuffTimer}) /call GrpBuffs
  /if (${WaitingOnSpell}) /goto :FollowingBuffs 
  /if (${tookAction}) /goto :Main_Loop 
  /if (${Me.PctMana} > 40) /if (${CastATK}) /if (${Me.SpellReady[${SpellATK}]}) { 
    /squelch /stick off 
    /squelch /moveto off 
    /call Cast_Avatar 
    /if (${tookAction}) /goto :Main_Loop 
  } 

DEBUG_2 Test 11 
|- Single Buff ! 
   /if (${DoSingleBuffs}) /call SingleBuffs 
   /if (${WaitingOnSpell}) /goto :FollowingBuffs 
   /if (${tookAction}) /goto :Main_Loop 

DEBUG_2 Test 12 
|- Pet 
  /if (!${Me.Pet.ID} && ${SummonPet} && ${Spell[${SpellPet}].Mana} <= ${Me.CurrentMana}) { 
    /call checkCanCast ${SpellPet} gem${SpellPetGem} 
    /if (!${Macro.Return}) /goto :FollowingBuffs 
    /squelch /stick off 
    /squelch /moveto off 
    /call cast ${SpellPet} gem${SpellPetGem} 25s 
/if (${DEBUG}) /echo :Main_Loop call (DEBUGGER14)
    /goto :Main_Loop 
  } 

DEBUG_2 Test 13 
   /if (${Me.Pet.ID} && ${BuffPet}) { 
   /call BuffPet 
      /if (${WaitingOnSpell}) /goto :FollowingBuffs 
      /if (${tookAction}) /goto :Main_Loop 
   } 
   /call Check_grpHPsDowntime 
   /if (${WaitingOnSpell}) /goto :FollowingBuffs 
   /if (${tookAction}) /goto :Main_Loop 

   /varset BuffsDone 1 

DEBUG_2 Buffs done 

:FollowingBuffs 
DEBUG_2 Waiting on spell... 
} 
   /goto :Main_Loop 
/return 

Sub MemSpells 
  /declare gemnum int local 
  /echo Memming spells. Hang on. 
  /if (${Me.Standing}) /sit 
  /if (${HealPets}) /if (${Me.Gem[${SpellPetHeal}]} && ${Me.Gem[${SpellPetHeal}]}!=${SpellPetHealGem}) { 
    /varset gemnum ${Me.Gem[${SpellPetHeal}]} 
    /notify SpellBookWnd SBW_Spell${gemnum} rightmouseup 
    /memspell ${SpellPetHealGem} ${SpellPetHeal} 
    /delay 5s 
  } 
  /if (${HealPets}) /if (!${Me.Gem[${SpellPetHeal}]}) { 
    /memspell ${SpellPetHealGem} ${SpellPetHeal} 
    /delay 5s 
  } 

  /if (${DoHeal}) /if (${Me.Gem[${SpellHeal}]} && ${Me.Gem[${SpellHeal}]}!=${SpellHealGem}) { 
    /varset gemnum ${Me.Gem[${SpellHeal}]} 
    /notify SpellBookWnd SBW_Spell${gemnum} rightmouseup 
    /memspell ${SpellHealGem} ${SpellHeal} 
    /delay 5s 
  } 
  /if (${DoHeal}) /if (!${Me.Gem[${SpellHeal}]}) { 
    /memspell ${SpellHealGem} ${SpellHeal} 
    /delay 5s 
  } 

  /if (${Me.Gem[${SpellSlow}]} && ${Me.Gem[${SpellSlow}]}!=${SpellSlowGem}) { 
    /varset gemnum ${Me.Gem[${SpellSlow}]} 
    /notify SpellBookWnd SBW_Spell${gemnum} rightmouseup 
    /memspell ${SpellSlowGem} ${SpellSlow} 
    /delay 5s 
  } 
  /if (!${Me.Gem[${SpellSlow}]}) { 
    /memspell ${SpellSlowGem} ${SpellSlow} 
    /delay 5s 
  } 
  
  /if (${DoDebuff}) /if (${Me.Gem[${SpellDeBuff}]} && ${Me.Gem[${SpellDeBuff}]}!=${SpellDeBuffGem}) { 
    /varset gemnum ${Me.Gem[${SpellDeBuff}]} 
    /notify SpellBookWnd SBW_Spell${gemnum} rightmouseup 
    /memspell ${SpellDeBuffGem} ${SpellDeBuff} 
    /delay 5s 
  } 
  /if (${DoDebuff}) /if (!${Me.Gem[${SpellDeBuff}]}) { 
    /memspell ${SpellDeBuffGem} ${SpellDeBuff} 
    /delay 5s 
  } 
  
  /if (${DoNuke}) /if (${Me.Gem[${SpellFirstNuke}]} && ${Me.Gem[${SpellFirstNuke}]}!=${SpellFirstNukeGem}) { 
    /varset gemnum ${Me.Gem[${SpellFirstNuke}]} 
    /notify SpellBookWnd SBW_Spell${gemnum} rightmouseup 
    /memspell ${SpellFirstNukeGem} ${SpellFirstNuke} 
    /delay 5s 
  } 
  /if (${DoNuke}) /if (!${Me.Gem[${SpellFirstNuke}]}) { 
    /memspell ${SpellFirstNukeGem} ${SpellFirstNuke} 
    /delay 5s 
  } 

  /if (${DoNuke}) /if (${Me.Gem[${SpellOtherNuke}]} && ${Me.Gem[${SpellOtherNuke}]}!=${SpellOtherNukeGem}) { 
    /varset gemnum ${Me.Gem[${SpellOtherNuke}]} 
    /notify SpellBookWnd SBW_Spell${gemnum} rightmouseup 
    /memspell ${SpellOtherNukeGem} ${SpellOtherNuke} 
    /delay 5s 
  } 
  /if (${DoNuke}) /if (!${Me.Gem[${SpellOtherNuke}]}) { 
    /memspell ${SpellOtherNukeGem} ${SpellOtherNuke} 
    /delay 5s 
  } 

  /if (${DoDoT}) /if (${Me.Gem[${SpellDoT}]} && ${Me.Gem[${SpellDoT}]}!=${SpellDoTGem}) { 
    /varset gemnum ${Me.Gem[${SpellDoT}]} 
    /notify SpellBookWnd SBW_Spell${gemnum} rightmouseup 
    /memspell ${SpellDoTGem} ${SpellDoT} 
    /delay 5s 
  } 
  /if (${DoDoT}) /if (!${Me.Gem[${SpellDoT}]}) { 
    /memspell ${SpellDoTGem} ${SpellDoT} 
    /delay 5s 
  } 

  /if (${CastATK}) /if (${Me.Gem[${SpellATK}]} && ${Me.Gem[${SpellATK}]}!=${SpellATKGem}) { 
    /varset gemnum ${Me.Gem[${SpellATK}]} 
    /notify SpellBookWnd SBW_Spell${gemnum} rightmouseup 
    /memspell ${SpellATKGem} ${SpellATK} 
    /delay 5s 
  } 
  /if (${CastATK}) /if (!${Me.Gem[${SpellATK}]}) { 
    /memspell ${SpellATKGem} ${SpellATK} 
    /delay 5s 
  } 
/return 

| ################# Ensures that the spell is memmed and ready to cast, 
| # so we're not waiting for 5 minutes for the recast timer to tick down 
Sub checkCanCast(string spellName,string spellGem) 
  /if ( ${Me.SpellReady[${spellName}]} ) { 
    /squelch /moveto off 
    /squelch /stick off 
    /delay 2 
    /return 1 
  } 
  /if ( !${Me.Gem[${spellName}]} ) { 
    /squelch /moveto off 
    /squelch /stick off 
    /delay 2 
    :mem_spell 
    /if ( ${Cursor.ID} ) { 
      /autoinventory 
      /delay 5 
      /goto :mem_spell  
   } 
   /memspell ${spellGem.Right[1]} "${spellName}" 
   /delay 6s ${Me.Gem[${spellName}]} 
  } 
  /varset tookAction 1 
  /varset WaitingOnSpell 1 
/return 0 

| ################# Checks for expired slow/debuff timers 
Sub CheckDebuffTimers 
/if (!${SAFETOCAST}) /return
/if (${DEBUG}) /echo In CheckDebuffTimers
  /declare i int local 1 
  /for i 1 to ${DebuffTimers.Size} 
    /if (${DebuffTimers[${i}]}) /if (!${Spawn[${DebuffTimers[${i}]}].ID} || ${Spawn[${DebuffTimers[${i}]}].State.Equal[DEAD]}) { 
      /if (${Defined[DebuffTimer${DebuffTimers[${i}]}]}) { 
      /deletevar DebuffTimer${DebuffTimers[${i}]} 
    } 
    /varset DebuffTimers[${i}] 0 
    } 
    /if (${DebuffTimers[${i}]}) /if (${Defined[DebuffTimer${DebuffTimers[${i}]}]}) /if (${DebuffTimer${DebuffTimers[${i}]}}<=6) { 
/if (${DEBUG}) /echo /call checkCanCast ${SpellSlow} gem${SpellSlowGem} 
      /call checkCanCast ${SpellSlow} gem${SpellSlowGem} 
/if (${DEBUG}) /echo Macro.Return: ${Macro.Return}
      /if (!${Macro.Return}) /return 
      /squelch /stick off 
      /squelch /moveto off 
      /if (${Me.Combat}) /attack off 
      /target id ${DebuffTimers[${i}]} 
/if (${DEBUG}) /echo /call Slow
      /call Slow 
      /target id ${TargetArray[4]} 
      /if (${CombatOn} && ${Target.Type.Equal[NPC]} && !${Target.Type.Equal[Corpse]} && !${Target.Type.Equal[PET]} && ${Target.PctHPs} <= ${CombatAt}) /attack on 
    } 
  /next i 
/return 

Sub SetDebuffTimer(int id,timer t) 
  /declare i int local 1 
  /for i 1 to ${DebuffTimers.Size} 
    /if (!${DebuffTimers[${i}]}) { 
      /varset DebuffTimers[${i}] ${id} 
      /if (!${Defined[DebuffTimer${DebuffTimers[${i}]}]}) { 
        /declare DebuffTimer${DebuffTimers[${i}]} timer outer ${t} 
      } else { 
        /varset DebuffTimer${DebuffTimers[${i}]} ${t} 
      } 
      /return 
    } 
  /next i 
/return 

Sub CheckSlowRadius 
  /if (!${SAFETOCAST}) /return
  /if (!${DoSlow}) /return
DEBUG_3 D6
  /declare s   int local 
  /declare j   int local 1
  /declare i   int local 1 
  /for i 1 to 10 
    /varset s ${Me.NearestSpawn[${i},npc].ID} 
    /for j 1 to ${DebuffTimers.Size}
      /if (${DebuffTimers[${j}]} == ${s}) /return
      /next j
    /if (${Spawn[${s}].Distance}>${Spell[${SpellSlow}].Range} || ${Spawn[${s}].Distance} > ${AssistAt} || ${Spawn[${s}].Level} < 30) {
      /squelch /target clear
      /return
    }
    /if ((${Me.CurrentMana}<${Spell[${SpellSlow}].Mana})) /return
    /call checkCanCast ${SpellSlow} gem${SpellSlowGem} 
    /if (!${Macro.Return}) /return 
    /squelch /stick off 
    /squelch /moveto off 
    /attack off
    /target id ${s} 
    /delay 5 
    /call Slow 
    /if (!${SlowAllAdds}) /return
    /next i
    /target id ${TargetArray[4]} 
    /if (${Target.Type.Equal[NPC]} && !${Target.Type.Equal[Corpse]} && !${Target.Type.Equal[PET]} && ${Target.PctHPs} <= ${CombatAt}) /attack on
/return 

| ################# This will check what Main Assist has in target. 

Sub GetTarget 
DEBUG_3 D7 (GetTarget)
  /declare temp int inner 0 
  /declare i int local 1 
  /if (${GotMobID} && ${Spawn[${GotMobID}].Distance} < ${AutoPullEngageDistance}) { 
    /target id ${GotMobID} 
    /squelch /stick off 
    /squelch /moveto off 
    /target id ${GotMobID} 
    /varset TargetArray[1] ${Target.CleanName} 
    /varset TargetArray[2] ${Target.Level} 
    /varset TargetArray[3] ${Target.Name} 
    /varset TargetArray[4] ${Target.ID} 
    /varset CombatOn TRUE 
    /varset MobRooted FALSE 
    /varset MobDebuffed FALSE 
    /varset MobSlowed FALSE 
    /varset PetOn FALSE 
    /varset MobDoTed FALSE 
    /varset DotTime 0 
    /varset GotMobID 0 
    /varset WaitForMob 0 
  /return  
  } 
  /varset GotMobID 0 
  /varset WaitForMob 0 
  /if (${CombatOn} && !${Spawn[${TargetArray[4]}].Name.Equal[${TargetArray[3]}]} || ${Spawn[${TargetArray[4]}].Type.Equal[Corpse]}) { 
    /varset MobRooted FALSE 
    /varset MobDebuffed FALSE 
    /varset MobSlowed FALSE 
    /varset PetOn FALSE 
    /varset MobDoTed FALSE 
    /varset CombatOn FALSE 
    /varset DotTime 0 
    /if (${AutoLoot}) /call DoTheLooting ${TargetArray[4]} 
    /call GoHome 
    /varset TargetArray[1] NULL 
    /varset TargetArray[2] NULL 
    /varset TargetArray[3] NULL 
    /varset TargetArray[4] NULL 
    /squelch /stick off 
    /if (!${following.Equal[FALSE]}) { 
      /echo Combat over. Resume following ${following}. 
      /call FollowFunction "${following}" 
    } 
  } 

  /if (!${AutoPull}) {
DEBUG_3 D8 
    /squelch /stick off 
    /assist ${M_Assist} 
    /delay 7 
    /if (${Target.Type.Equal[NPC]}) { 
      /varset TargetArray[1] ${Target.CleanName} 
      /varset TargetArray[2] ${Target.Level} 
      /varset TargetArray[3] ${Target.Name} 
      /varset TargetArray[4] ${Target.ID} 
       /if (${Target.Distance}<=${AssistAt} && ${Target.ID}==${TargetArray[4]} && ${Target.PctHPs}<=${CombatAt}) /varset CombatOn TRUE 
    } 
  } else /if (${TargetArray[4]}) { 
      /return 
  } 
  /if (${Spawn[${TargetArray[4]}].ID} && !${Spawn[${TargetArray[4]}].Type.Equal[Corpse]} && ${Spawn[${TargetArray[4]}].Distance} > 50 && ${WaitForMob} <= 0) { 
    /varset GotMobID ${TargetArray[4]} 
    /varset WaitForMob 150 
    /return 
  } 
  /if (${Spawn[${TargetArray[4]}].ID} && !${Spawn[${TargetArray[4]}].Type.Equal[Corpse]}) /return 
  /for i 1 to ${DebuffTimers.Size} 
    /if (${DebuffTimers[${i}]}) /if (${Defined[DebuffTimer${DebuffTimers[${i}]}]}) {          
      /if (${Spawn[${DebuffTimers[${i}]}].Type.Equal[NPC]}) { 
        /target id ${DebuffTimers[${i}]} 
        /squelch /stick off 
        /squelch /moveto off 
        /target id ${DebuffTimers[${i}]} 
        /varset TargetArray[1] ${Target.CleanName} 
        /varset TargetArray[2] ${Target.Level} 
        /varset TargetArray[3] ${Target.Name} 
        /varset TargetArray[4] ${Target.ID} 
        /varset CombatOn TRUE 
        /varset MobRooted FALSE 
        /varset MobDebuffed FALSE 
        /varset MobSlowed FALSE 
        /varset PetOn FALSE 
        /varset MobDoTed FALSE 
        /varset DotTime 0 
        /return    
       } 
     } 
  /next i 
  /if (0 && ${AutoLoot} && !${attemptedLoot}) { 
    /target corpse 
    /if (${Target.ID} && ${Target.Type.Equal[Corpse]} && (${Target.Distance} < 50 || ${LineOfSight[${Me.Y},${Me.X},${Me.Z}:${Target.Y},${Target.X},${Target.Z}]})) { 
      /call DoTheLooting ${Target.ID} 
      /varset attemptedLoot 1 
      /call GoHome 
    } 
  } 
  /varset attemptedLoot 0 
DEBUG_2 BuffsDone: ${BuffsDone} 
  /if (${AutoPull} && ${BuffsDone} && !${perfectionNeeded} && ${DelayPull} <= 0) { 
    /call StopFunction 
    /call PlayFunction "${PathFile} 1 cf pp noz" 
    /varset doingPath 1 
  } 
/return 

| ################### Check target and do stuff like slow, dot, pet attack etc. 

Sub Combat 
DEBUG_3 D9 (Sub Combat)
  /target id ${TargetArray[4]} 
  /delay 3 ${Target.ID}==${TargetArray[4]} 
  /if (${Target.ID}==${TargetArray[4]}) /if (${Target.PctHPs}<=${CombatAt} && ${Target.Type.Equal[NPC]}) { 
    /if (${Target.Distance}>${Spell[${SpellSlow}].Range}) /call AttemptAvoid 
  } 
  /if (${CombatOn} && !${PetOn} && ${Target.ID}==${TargetArray[4]} && ${Target.PctHPs}<=${PetCombatAt}) { 
    /pet attack 
    /varset PetOn TRUE 
  } 
  /if (${CombatOn} && !${MobDebuffed} && ${DoDebuff} && ${Target.ID}==${TargetArray[4]}) { 
    /call DeBuff 
    /return 
  } 
  /if (${Defined[DebuffTimer${Target.ID}]} && ${DebuffTimer${Target.ID}} > 0) /if (${DotTime}<=0) /if (${Me.PctMana} > 65) /if (${CombatOn} && ${DoDoT} && ${Target.PctHPs}<=${CastDoTat} && ${Target.PctHPs}>=${MinDoTat}) { 
    /call checkCanCast ${SpellDot} gem${SpellDoTGem} 
    /if (!${Macro.Return}) /return 
    /squelch /stick off 
    /squelch /moveto off 
    /call cast ${SpellDot} gem${SpellDoTGem} 
    /if (${Macro.Return.Equal[CAST_SUCCESS]}) { 
      /varset DotTime ${Math.Calc[${Spell[${SpellDot}].Duration}*60-${Spell[${SpellDot}].CastTime}*10]} 
   } else { 
      /varset DotTime 50 
   } 
     /varset tookAction 1 
     /return 
   } 
  /if (${Me.Gem[${SpellNuke}]}) /if (${Me.PctMana} > ${MinManaForNuke}) /if (!${nukeTimer}) /if (${CombatOn} && ${DoNuke} && ${Target.PctHPs}<=${NukeAt} && ${Target.PctHPs}>=${MinNukeat}) { 
    /call checkCanCast ${SpellNuke} gem${SpellNukeGem} 
    /if (!${Macro.Return}) /return 
    /squelch /stick off 
    /squelch /moveto off 
    /call cast ${SpellNuke} gem${SpellNukeGem} 
    /if (${Macro.Return.Equal[CAST_SUCCESS]} || ${Macro.Return.Equal[CAST_RESISTED]}) { 
      /varset nukeTimer ${DelayBetweenNukes} 
    } else /if (${Macro.Return.Equal[CAST_OUTOFRANGE]}) { 
      /varset nukeTimer 150 
    } 
    /varset tookAction 1 
    /return 
  } 
  /if (${Me.Gem[${SpellNuke}]}) /if (${Me.PctMana} > ${MinManaForNuke}) /if (!${nukeTimer}) /if (${CombatOn} && ${DoNuke} && ${Target.PctHPs}<=${NukeAt} && ${Target.PctHPs}>=${MinNukeat}) { 
    /call checkCanCast ${SpellOtherNuke} gem${SpellOtherNukeGem} 
    /if (!${Macro.Return}) /return 
    /squelch /stick off 
    /squelch /moveto off 
    /call cast ${SpellOtherNuke} gem${SpellOtherNuke} 
    /if (${Macro.Return.Equal[CAST_SUCCESS]} || ${Macro.Return.Equal[CAST_RESISTED]}) { 
      /varset nukeTimer ${DelayBetweenNukes} 
    } else /if (${Macro.Return.Equal[CAST_OUTOFRANGE]}) { 
      /varset nukeTimer 150 
    } 
    /varset tookAction 1 
    /return 
  } 
  /target id ${TargetArray[4]} 
  /if (!${Target.Name.Equal[${TargetArray[3]}]} || !${Target.ID}) { 
    /varset MobRooted FALSE 
    /varset MobDebuffed FALSE 
    /varset MobSlowed FALSE 
    /varset PetOn FALSE 
    /varset MobDoTed FALSE 
    /varset CombatOn FALSE 
    /varset DotTime 0 
    /if (${AutoLoot}) /call DoTheLooting ${TargetArray[4]} 
    /call GoHome 
    /varset TargetArray[1] NULL 
    /varset TargetArray[2] NULL 
    /varset TargetArray[3] NULL 
    /varset TargetArray[4] NULL 
    /squelch /stick off 
    /varset AAExp ${Math.Calc[${Me.PctAAExp}-${AAExp}]} 
    /varset Exper ${Math.Calc[${Me.PctExp}-${Exper}]} 
    /if (!${following.Equal[FALSE]}) { 
      /echo Combat over. Resume following ${following}. 
      /call FollowFunction "${following}" 
    } 
  } 
/return 

Sub DeBuff 
:DeBuff_Loop 
DEBUG_3 D10 (:Debuff_Loop)
  /if (${Target.PctHPs}<=${CombatAt} && ${Target.Type.Equal[NPC]}) { 
    /if (${Me.CurrentMana}<${Spell[${SpellDeBuff}].Mana}) { 
      /if (${Verbose}) /echo *** I don't have mana to cast ${SpellDebuff}
    } else { 
      /call checkCanCast ${SpellDeBuff} gem${SpellDeBuffGem} 
      /if (!${Macro.Return}) /return 
      /squelch /stick off 
      /squelch /moveto off 
      /keypress left
      /keypress right
      /delay 3
      /call cast ${SpellDeBuff} gem${SpellDeBuffGem} 6s 
      /varset tookAction 1 
      /if (${Macro.Return.Equal["CAST_RESISTED"]}) { 
        /if (${Verbose}) /gsay < %T > RESISTED ${SpellDeBuff} ! Trying again... 
        /call SetDebuffTimer ${Target.ID} 60 
        /return 
      } 
      /if (!${Macro.Return.Equal["CAST_SUCCESS"]}) { 
        /if (${Verbose}) /gsay < %T > has been debuffed with: ${SpellDeBuff} 
        /return 
      } else /if (${Macro.Return.Equal[CAST_OUTOFRANGE]}) { 
        /call AttemptAvoid 
      } 
    /varset MobDebuffed TRUE 
    } 
  } 
/return 

DigitalMocking
a grimling bloodguard
a grimling bloodguard
Posts: 620
Joined: Mon Apr 04, 2005 5:53 pm

Updated Macro(part2)

Post by DigitalMocking » Mon Jul 04, 2005 4:52 am

Code: Select all

Sub Slow 
DEBUG_3 D11 (Sub Slow)
  /if (${Target.ID}==${TargetArray[4]} && ${Target.PctHPs}>${CombatAt}) /return 
  /if (${Me.CurrentMana}<${Spell[${SpellSlow}].Mana}) { 
      /if (${Verbose}) /echo *** I don't have mana to cast ${SpellSlow}
  } else { 
    /call checkCanCast ${SpellSlow} gem${SpellSlowGem} 
    /if (!${Macro.Return}) /return 
    /squelch /stick off 
    /squelch /moveto off 
    /call cast ${SpellSlow} gem${SpellSlowGem} 6s 
    /varset tookAction 1 
    /if (${Macro.Return.Equal["CAST_INTERRUPTED"]}) /return 
    /if (${Macro.Return.Equal["CAST_IMMUNE"]}) { 
      /if (${Verbose}) /gsay < %T > is IMMUNE to slow ! 
      /call SetDebuffTimer ${Target.ID} ${Math.Calc[${Spell[${SpellSlow}].Duration}*6000-100]} 
      /varset MobSlowed TRUE 
    } 
    /if (${Macro.Return.Equal["CAST_RESISTED"]}) { 
      /if (!${FastSlow}) { 
        /if (${Verbose}) /gsay < %T > RESISTED slow ! Trying again... 
        /call SetDebuffTimer ${Target.ID} 60 
        /return 
      } 
    /varset MobSlowed TRUE 
    } 
    /if (${Macro.Return.Equal["CAST_SUCCESS"]}) { 
      /if (${Verbose}) /gsay < %T > is SLOWED 
      /varset MobSlowed TRUE 
      /call SetDebuffTimer ${Target.ID} ${Math.Calc[${Spell[${SpellSlow}].Duration}*60-100]} 
    }  else /if (${Macro.Return.Equal[CAST_OUTOFRANGE]} || ${Macro.Return.Equal[CAST_CANNOTSEE]}) { 
      /call AttemptAvoid ${Target.ID} 
      /target id ${TargetArray[4]} 
    } 
    /if (${Macro.Return.Equal["CAST_CANNOTSEE"]}) { 
      /call SetDebuffTimer ${Target.ID} 150 
      /echo Cannot See: ${Target.CleanName} 
      /target id ${TargetArray[4]} 
    } 
  } 
/return
 
Sub GrpBuffs 
DEBUG_3 D12 (Sub GrpBuffs)
  /if (!${SAFETOCAST}) /return
  /declare i int local 1 
  /declare j int local 1 
  /if (!${SpellGrpBuff.Size}) /return 
  /for i 1 to ${SpellGrpBuff.Size} 
  /if (${Spell[${SpellGrpBuff[${i}]}].Mana} > ${Me.CurrentMana}) /return 
  /if ( !${Me.Buff[${SpellGrpBuff[${i}]}].ID} ) { 
    /squelch /stick off 
    /squelch /moveto off 
    /target id ${Me.ID} 
    /delay 1s ${Target.ID} 
    /call AttemptAvoid 
    /if (${grpBuffTimesAttempted}<3) { 
      /for j 1 to 5 
        /if (${Group.Member[${j}].Distance} > ${Spell[${SpellGrpBuff[${i}]}].AERange}) { 
          /echo *** Need to rebuff ${SpellGrpBuff[${i}]}, but group members are too far away! 
          /varset grpBuffTimer 150 
          /varset grpBuffTimesAttempted ${Math.Calc[${grpBuffTimesAttempted}+1]} 
          /call AttemptAvoid ${Spawn[pc ${M_Assist}].ID} 
          /return 
       } 
     /next j 
    } 
    /call checkCanCast "${SpellGrpBuff[${i}]}" gem${SpellBuffsGem} 
    /if (!${Macro.Return}) /return 
    /echo *** Hang on ! Rebuffing ${SpellGrpBuff[${i}]} 
    /if (${Verbose}) /gsay INC ${SpellGrpBuff[${i}]}, Stay close or miss out! 
    /call EquipItem ${BuffFocusItem} 
    /varset MainItem ${Macro.Return} 
    /squelch /stick off 
    /squelch /moveto off 
    /call cast "${SpellGrpBuff[${i}]}" gem${SpellBuffsGem} 5s 
    /varset tookAction 1 
    /call EquipItem ${MainItem} 
    /varset grpBuffTimesAttempted 0 
    /return 
  } 
  /next i 
/return 

Sub CheckHPs 
DEBUG_3 D13 (Sub CheckHPs)
  /if (${Target.PctHPs} >= ${HealInterrupt}) { 
    /call Interrupt 
  } 
/return 

Sub Check_grpHPsDowntime 
DEBUG_3 D14 (Sub CheckHPsDowntime)
  /declare g int local 1 
  /declare gClass string local 
  /for g 0 to ${Group.Members} 
  /if (${Group.Member[${g}].ID} && !${Group.Member[${g}].Type.Equal[CORPSE]}) { 
    /varset gClass ${Group.Member[${g}].Class.Name} 
    /if ((${DoHeal} || !${g}) && ${Group.Member[${g}].PctHPs}<=${DowntimeHealGroupAt}) { 
      /squelch /stick off 
      /squelch /moveto off 
      /target pc ${Group.Member[${g}]} 
      /delay 1s ${Target.ID}==${Group.Member[${g}].ID} 
      /if (${Me.CurrentMana}<${Spell[${SpellHeal}].Mana}) { 
        /echo *** Shid ! I don't have mana to heal ${Group.Member[${g}]} 
      } else /if (${Target.Distance}<=${Spell[${SpellHeal}].Range}) { 
        /if (${Verbose}) /gsay ${SpellHeal} on < %T > 
        /squelch /stick off 
        /squelch /moveto off 
        /delay 5 
        /call cast ${SpellHeal} ${SpellHealGem} 4s CheckHPs 
        /varset tookAction 1 
      } else { 
        /call AttemptAvoid ${Group.Member[${g}].ID} 
      } 
    } 
  } 
  /next g 
/return 


|################### Check if any group member needs healing 

Sub Check_grpHPs 
DEBUG_3 D15
  /declare g int local 1 
  /declare gClass string local 
  /for g 0 to ${Group.Members} 
  /if (${Group.Member[${g}].ID} && !${Group.Member[${g}].Type.Equal[CORPSE]}) { 
    /varset gClass ${Group.Member[${g}].Class.Name} 
    /if ((${DoHeal} || !${g}) && ${Group.Member[${g}].PctHPs}<=${HealGroupAt}) { 
      /target pc ${Group.Member[${g}]} 
      /delay 1s ${Target.ID}==${Group.Member[${g}].ID} 
      /if (${Me.CurrentMana}<${Spell[${SpellHeal}].Mana}) { 
        /echo *** Shid ! I don't have mana to heal ${Group.Member[${g}]} 
      } else /if (${Target.Distance}<=${Spell[${SpellHeal}].Range}) { 
        /if (${Verbose}) /gsay ${SpellHeal} on < %T > 
        /squelch /stick off 
        /squelch /moveto off 
        /delay 5 
        /call cast ${SpellHeal} ${SpellHealGem} 4s CheckHPs 
        /varset tookAction 1 
      } else { 
        /call AttemptAvoid ${Group.Member[${g}].ID} 
      } 
    } 
  } 
  /next g 
/return 

Sub Check_grpPetHPs 
DEBUG_3 D16
  /declare g int local 0 
  /declare gClass string local 
  /if (${Group.Member[${g}].ID} && ${Group.Member[${g}].Pet.ID}) { 
    /varset gClass ${Group.Member[${g}].Pet.Class.Name} 
    /if ((${DoHeal}) && ${Group.Member[${g}].Pet.PctHPs}<=${HealPetAt}) { 
      /squelch /stick off 
      /squelch /moveto off 
      /target id ${Group.Member[${g}].Pet.ID} 
      /delay 1s ${Target.ID}==${Group.Member[${g}].Pet.ID} 
      /if (${Me.CurrentMana}<${Spell[${SpellPetHeal}].Mana}) { 
        /echo *** Shid ! I don't have mana to heal ${Group.Member[${g}]}'s Pet 
      } else /if (${Target.Distance}<=${Spell[${SpellPetHeal}].Range}) { 
        /if (${Verbose}) /gsay ${SpellPetHeal} on < %T > 
        /squelch /stick off 
        /squelch /moveto off 
        /call cast "${SpellPetHeal}" gem${SpellPetHealGem} 4s CheckHPs 
        /varset tookAction 1 
      } else { 
      /call AttemptAvoid ${Group.Member[${g}].Pet.ID} 
      } 
    } 
  } 
/return 


Sub BuffPet 
  /if (!${SAFETOCAST}) /return 
DEBUG_3 D17
  /declare i int local 
  /if (${Me.AltAbility[Hobble of Spirits]} && ${Me.AltAbilityReady[Hobble of Spirits]}) { 
    /if (!${Me.PetBuff[Hobble of Spirits]}) { 
      /squelch /stick off 
      /squelch /moveto off 
      /call Cast "Hobble of Spirits" alt 
      /varset tookAction 1 
      /return 
    } 
  } 
  /for i 1 to ${SpellPetBuff.Size} 
  /if (!${SpellPetBuff[${i}].Equal[NULL]} && ${SpellPetBuff[${i}].Length} > 0) /if (!${Me.PetBuff[${SpellPetBuff[${i}]}]} && ${Spell[${SpellPetBuff[${i}]}].Mana} <= ${Me.CurrentMana}) { 
    DEBUG_2 ${i}: ${SpellPetBuff[${i}]} 
    /call checkCanCast ${SpellPetBuff[${i}]} gem${SpellBuffsGem} 
    /if (!${Macro.Return}) /return 
    /pet target 
    /delay 1s ${Me.Pet.ID}==${Target.ID} 
    /call EquipItem ${BuffFocusItem} 
    /varset MainItem ${Macro.Return} 
    /squelch /stick off 
    /squelch /moveto off 
    /call cast ${SpellPetBuff[${i}]} gem${SpellBuffsGem} 9s 
    /varset tookAction 1 
    /call EquipItem ${MainItem} 
  } 
  /next i 
  /for i 1 to ${ItemPetBuff[1].Size} 
    /if (!${Me.PetBuff[${ItemPetBuff[${i},2]}]}) { 
      /pet target 
      /delay 1s ${Me.Pet.ID}==${Target.ID} 
      /call EquipItem ${ItemPetBuff[${i},1]} 
      /varset MainItem ${Macro.Return} 
      /squelch /stick off 
      /squelch /moveto off 
      /call cast ${ItemPetBuff[${i},1]} item 
      /varset tookAction 1 
      /call EquipItem ${MainItem} 
    } 
  /next i 
/return 

Sub Cast_Avatar 
  /if (!${SAFETOCAST}) /return 
DEBUG_3 D17
  /declare i int local 0 
  /for i 0 to ${Group.Members} 
  /if (${Group.Member[${i}].ID}) { 
    /if (${ATKBuffed${i}}==0) /if (${Group.Member[${i}].Class.Name.Equal[Beastlord]} || ${Group.Member[${i}].Class.Name.Equal[Shadow Knight]} || ${Group.Member[${i}].Class.Name.Equal[Bard]} || ${Group.Member[${i}].Class.Name.Equal[Ranger]} || ${Group.Member[${i}].Class.Name.Equal[Rogue]} || ${Group.Member[${i}].Class.Name.Equal[Paladin]} || ${Group.Member[${i}].Class.Name.Equal[Monk]} || ${Group.Member[${i}].Class.Name.Equal[Warrior]}) { 
      /if (${Me.CurrentMana}>${Spell[${SpellATK}].Mana}) { 
        /call checkCanCast "${SpellATK}" gem${SpellATKGem} 
        /if (!${Macro.Return}) /return 
        /squelch /stick off 
        /squelch /moveto off 
        /target pc ${Group.Member[${i}]} 
        /delay 1s ${Group.Member[${i}].ID}==${Target.ID} 
        /call EquipItem ${BuffFocusItem} 
        /varset MainItem ${Macro.Return} 
        /call cast "${SpellATK}" gem${SpellATKGem} 4s 
        /varset tookAction 1 
        /if (${Macro.Return.Equal["CAST_SUCCESS"]}) { 
          /varset ATKBuffed${i} ${AvatarDelay}´ 
        } else /if (${Macro.Return.Equal[CAST_OUTOFRANGE]}) { 
          /varset ATKBuffed${i} 150 
        } 
        /call EquipItem ${MainItem} 
        /return 
      } 
    } 
  } 
  /next i 
/return 

Sub SingleBuffs
  /if (!${SAFETOCAST}) /return 
DEBUG_3 D18
  /declare i int local 1 
  /declare g int local 0 
  /declare h int local 1 
  /declare Classes int local 0 
  /declare sID int local 0 
  /if (!${SpellBuff.Size[1]}) /return 
  /for i 1 to ${SpellBuff.Size[1]} 
  /if (${Spell[${SpellBuff[${i}]},1].Mana} > ${Me.CurrentMana}) /return 
  /varset Classes ${SpellBuff[${i},2].Count[,]} 
  /echo Classes: ${Classes}
  /varset g 0 
  /for g 0 to ${Math.Calc[${Group.Members}+${otherBuffees.Size}]} 
    /if (${g} != 0 && ${Group.Member[${g}].Class.Name.Equal[${Me.Class.Name}]}) /next g 
    /if (${g}<=${Group.Members}) { 
      /varset sID ${Group.Member[${g}].ID} 
    } else { 
      /varset sID ${Spawn[${otherBuffees[${Math.Calc[${g}-${Group.Members}]}]}].ID} 
    } 
    /squelch /declare SpellBufftmr${i}${Spawn[${sID}].Name}   timer   global 0 
    /if (!${SpellBufftmr${i}${Spawn[${sID}].Name}}) { 
      /call SpellInformation "${SpellBuff[${i},1]}" 
      /for h 1 to ${Classes} 
      /echo Class.Name.Equal: ${SpellBuff[${i},2].Arg[${h},,]}
      /if (${SpellBuff[${i},2].Arg[${h},,].Find[${Spawn[${sID}].Class.Name}]}) {
        /if (${Spawn[${sID}].Distance}<=${Spell[${SpellBuff[${i},1]}].Range}) { 
          /if (${Me.CurrentMana}<${Spell[${SpellBuff[${i},1]}].Mana}) { 
          /return 
        } 
        /call checkCanCast "${SpellBuff[${i},1]}" gem${SpellBuffsGem} 
        /if (!${Macro.Return}) /return 
        /squelch /stick off 
        /squelch /moveto off 
        /target id ${sID} 
        /delay 1s ${Target.ID}==${Spawn[${sID}].ID} 
        /call EquipItem ${BuffFocusItem} 
        /varset MainItem ${Macro.Return} 
        /call cast "${SpellBuff[${i},1]}" gem${SpellBuffsGem} ${SpCastTime} 
        /varset tookAction 1 
        /if (${Macro.Return.Equal[CAST_SUCCESS]} || ${spellNotHold}) { 
          /varset SpellBufftmr${i}${Spawn[${sID}].Name} ${Math.Calc[${Math.Calc[${SpDuration}-${SpCastTime}]}-${Math.Calc[300-${Math.Calc[${Spell[${SpellBuff[${i},1]}].RecastTime}*10]}]}]} 
        } else /if (${Macro.Return.Equal[CAST_OUTOFRANGE]}) { 
          /call AttemptAvoid 
        } else { 
          /varset SpellBufftmr${i}${Spawn[${sID}].Name} 10 
          /call EquipItem ${MainItem} 
          /next h 
        } 
        /call EquipItem ${MainItem} 
        /return 
        } else { 
        /call AttemptAvoid ${Spawn[${sID}].ID} 
        /varset SpellBufftmr${i}${Spawn[${sID}].Name} 10 
        /next h 
        } 
      } 
    /next h 
  } 
  /next g 
  /next i 
  /varset singleBuffsDone 1 
/return 


| ################### Get some information of the spell to be used. 

Sub SpellInformation(string SpellName) 
DEBUG_3 D19
  /varset SpDurBonus ${Math.Calc[${SpellDurationBonus}/100+1]} 
  /varset SpDuration ${Math.Calc[${Spell[${SpellName}].Duration}*60*${SpDurBonus}]} 
  /varset SpCastTime ${Math.Calc[${Spell[${SpellName}].CastTime}*10].Int} 
/return 

| ################### This will check whenever the player is changing any variable via /echo 

Sub Event_ToggleVariable(string Line, string Command, string Command2) 
DEBUG_3 D20
   /declare i int local 1 
   /declare g int local 0 
   /declare sID int local 0 
   /if (${Command.Equal[malo]} && ${DoDebuff}==0) { 
      /varset DoDebuff TRUE 
      /echo Do Malo:   ${DoDebuff} 
   } else /if (${Command.Equal[malo]}) { 
      /varset DoDebuff FALSE 
      /echo Do Malo:   ${DoDebuff} 
   } 
   /if (${Command.Equal[slow]} && ${DoSlow}==0) { 
      /varset DoSlow TRUE 
      /echo Do Slow:   ${DoSlow} 
   } else /if (${Command.Equal[slow]}) { 
      /varset DoSlow FALSE 
      /echo Do Slow:   ${DoSlow} 
   } 
    
   /if (${Command.Equal[fastslow]} && ${FastSlow}==0) { 
      /varset FastSlow TRUE 
      /echo Do Fast Slow:   ${FastSlow} 
   } else /if (${Command.Equal[fastslow]}) { 
      /varset FastSlow FALSE 
      /echo Do Fast Slow:   ${FastSlow} 
   } 
    
    
   /if (${Command.Equal[pet]} && ${SummonPet}==0) { 
      /varset SummonPet TRUE 
      /echo Summon Pet:   ${SummonPet} 
   } else /if (${Command.Equal[pet]}) { 
      /varset SummonPet FALSE 
      /echo Summon Pet:   ${SummonPet} 
   }    
    
   /if (${Command.Equal[dot]} && ${DoDoT}==0) { 
      /varset DoDoT TRUE 
      /echo Do DoT:   ${DoDoT} 
   } else /if (${Command.Equal[dot]}) { 
      /varset DoDoT FALSE 
      /echo Do DoT:   ${DoDoT} 
   } 
    
   /if (${Command.Equal[buffs]} && ${DoBuffs}==0) { 
      /varset DoBuffs TRUE 
      /echo Do Buffs:   ${DoBuffs} 
   } else /if (${Command.Equal[buffs]}) { 
      /varset DoBuffs FALSE 
      /echo Do Buffs:   ${DoBuffs} 
   } 
    
   /if (${Command.Equal[nuke]} && ${DoNuke}==0) { 
      /varset DoNuke TRUE 
      /echo Do Nuke:   ${DoNuke} 
   } else /if (${Command.Equal[nuke]}) { 
      /varset DoNuke FALSE 
      /echo Do Nuke:   ${DoNuke} 
   } 
    
   /if (${Command.Equal[heal]} && ${DoHeal}==0) { 
      /varset DoHeal TRUE 
      /echo Do Heal:   ${DoNuke} 
   } else /if (${Command.Equal[heal]}) { 
      /varset DoHeal FALSE 
      /echo Do Heal:   ${DoNuke} 
   } 

   /if (${Command.Equal[verbose]} && ${Verbose}==0) { 
      /varset Verbose TRUE 
      /echo Verbose:   ${Verbose} 
   } else /if (${Command.Equal[verbose]}) { 
      /varset Verbose FALSE 
      /echo Verbose:   ${Verbose} 
   } 

   /if (${Command.Equal[buffpet]} && ${BuffPet}==0) { 
      /varset BuffPet TRUE 
      /echo Buff Pet:   ${BuffPet} 
   } else /if (${Command.Equal[buffpet]}) { 
      /varset BuffPet FALSE 
      /echo Buff Pet:   ${BuffPet} 
   } 
    
   /if (${Command.Equal[assistat]}) { 
      /varset AssistAt ${Command2} 
      /echo Assisting at range:   ${AssistAt} _ (Longer range then 100 is futile) 
   } 
    
   /if (${Command.Equal[dotat]}) { 
      /varset CastDoTat ${Command2} 
      /echo Casting ${SpellDoT} at ${CastDoTat}% 
   } 
    
   /if (${Command.Equal[nukeat]}) { 
      /varset NukeAt ${Command2} 
      /echo Starting to Nuke Mobs at ${NukeAt}% 
   } 
    
   /if (${Command.Equal[combatat]}) { 
      /varset CombatAt ${Command2} 
      /echo Initiate Combat at ${CombatAt}% (Malo / Slow) 
   } 
    
   /if (${Command.Equal[DoHeal]} && ${DoHeal}==0) { 
      /varset DoHeal TRUE 
      /echo Do Heal:   ${DoHoT} 
   } else /if (${Command.Equal[DoHeal]}) { 
      /varset DoHeal FALSE 
      /echo Do Heal:   ${DoHeal} 
   } 

   /if (${Command.Equal[HealPets]} && ${HealPets}==0) { 
      /varset HealPets TRUE 
      /echo HealPets:   ${HealPets} 
   } else /if (${Command.Equal[HealPets]}) { 
      /varset HealPets FALSE 
      /echo HealPets:   ${HealPets} 
   } 

   /if (${Command.Equal[DoMelee]} && ${DoMelee}==0) { 
      /varset DoMelee TRUE 
      /echo DoMelee:   ${DoMelee} 
   } else /if (${Command.Equal[DoMelee]}) { 
      /varset DoMelee FALSE 
      /echo DoMelee:   ${DoMelee} 
   } 

   /if (${Command.Equal[CastATK]} && ${CastATK}==0) { 
      /varset CastATK TRUE 
      /echo CastATK:   ${CastATK} 
   } else /if (${Command.Equal[CastATK]}) { 
      /varset CastATK FALSE 
      /echo CastATK:   ${CastATK} 
   } 

  /if (${Command.Equal[clearpathing]}) { 
  /for i 1 to ${SafeLocs.Size[1]} 
    /varset SafeLocs[${i},1] 0 
    /varset SafeLocs[${i},2] 0 
    /next i 
  } 
    
  /if (${Command.Equal[dofollow]}) { 
    /if (!${AllowAutoFollow}) /return 
    /squelch /stick off 
    /squelch /moveto off 
    /target ${Command2} 
    /delay 1s ${Target.CleanName.Equal[${Command2}]} 
    /call FollowFunction "${Target.CleanName}" 
    /varset following ${Command2} 
    /return 
  } 
    
  /if (${Command.Equal[assist]} && ${Defined[Command2]}) { 
    /varset M_Assist ${Command2} 
    /squelch /stick off 
    /squelch /moveto off 
    /sq /target pc ${M_Assist} 
    /if (!${Target.ID}) { 
      /echo ${M_Assist} is not here dude ! 
      /return 
    } 
  /echo I will assist:   ${M_Assist} 
  } 
    
  /if (${Command.Equal[test]}) { 
    /call AttemptAvoid 
    /return 
  } 

  /if (${Command.Equal[buff]} && ${Defined[Command2]}) { 
    /squelch /stick off 
    /squelch /moveto off 
    /target ${Command2} 
    /if (${Target.ID}==${Spawn[${Command2}].ID}) { 
      /declare tmpArray[${Math.Calc[${otherBuffees.Size}+1]}] string local 
      /for i 1 to ${otherBuffees.Size} 
        /if (${i}>${otherBuffees.Size}) /goto :followingBuffCommand 
        /varset tmpArray[${i}] ${otherBuffees[${i}]} 
        /if (${otherBuffees[${i}].Equal[${Command2}]}) /return 
      /next i 
      :followingBuffCommand 
      /varset tmpArray[${tmpArray.Size}] ${Command2} 
      /deletevar otherBuffees 
      /declare otherBuffees[${tmpArray.Size}] string global 
      /for i 1 to ${tmpArray.Size} 
        /if (${i}>${tmpArray.Size}) /goto :followingBuffCommand2 
        /varset otherBuffees[${i}] ${tmpArray[${i}]} 
      /next i 
      :followingBuffCommand2 
    } 
    /return 
  } 

  /if (${Command.Equal[resetbuffs]} && !${Defined[Command2]}) { 
    /if (!${SpellBuff.Size[1]}) /return 
    /for i 1 to ${SpellBuff.Size[1]} 
    /for g 0 to ${Math.Calc[${Group.Members}+${otherBuffees.Size}]} 
    /if (${g}<=${Group.Members}) { 
      /varset sID ${Group.Member[${g}].ID} 
    } else { 
      /varset sID ${Spawn[pc ${otherBuffees[${Math.Calc[${g}-${Group.Members}]}]}].ID} 
    } 
    /squelch /varset SpellBufftmr${i}${Spawn[${sID}].Name}   0 
    /next g 
    /next i 
  } 
 
  /if (${Command.Equal[resetbuffs]} && ${Defined[Command2]}) { 
    /for i 1 to ${SpellBuff.Size[1]} 
      /squelch /varset SpellBufftmr${i}${Spawn[${Command2}].Name}   0 
    /next i 
  } 

  /if (${Command.Equal[Show]}) { 
    /echo --------------------------- 
    /echo Do Malo:..............${DoDebuff} - Casting at: ${CombatAt}% (Initiate Combat*, higher then 99 is no good) 
    /echo Do Slow:..............${DoSlow} - Casting at: ${CombatAt}% (Initiate Combat*, higher then 99 is no good) 
    /echo Do Fastslow:......${FastSlow} - (Will only try to slow once!) 
    /echo Do Nuke:.............${DoNuke} - Casting at: ${NukeAt}% (Will chain nuke mob to death) 
    /echo Do Dot:................${DoDoT} - Casting at: ${CastDoTat}% 
    /echo Do Pet:................${SummonPet} 
    /echo Do Buffs:.............${DoBuffs} 
    /echo Do Root:..............${DoRoot} - Casting at: ${Rootat}% 
    /echo Do Sow:...............${DoSow} 
    /echo Do Heal:..............${DoHeal} 
    /echo Buff Pet:.............${BuffPet} 
    /echo --------------------------- 
    /echo Assist range: ${AssistAt} 
    /echo Assisting: ${M_Assist} 
    /echo Healing Casters: ${CasterHeals}% Melees: ${MeleeHeals}% 
    /echo ${M_Assist} get heals at ${TankHeal} 
    /echo Initiate Combat: ${CombatAt}% 
    /echo Verbose: ${Verbose} 
    /echo 
    /echo help - Will show help to set variables. 
  } 

  /if (${Command.Equal[help]}) { 
    /echo ___ Shaman Do Stuff Script ___ 
    /echo 
    /echo Commands that will turn ON or OFF 
    /echo /dodebuff, /doslow, /dofastslow, /dopet, /dodot, /dobuffs, /dosow, /donuke, /doheal, /dobuffpet 
    /echo 
    /echo /dofastslow will NOT check if the slow is landed or not.
    /echo Commands to change values, ie: /assistat 50 (Will start the combat routine when mob is in range 50) 
    /echo /assisat <range> - Most spells don't go longer then 100 
    /echo /combatat <% hps> - Initiate Combat when mob is at % HPs 
    /echo /healtankat <% hps> 
    /echo /healmeeleat <% hps> 
    /echo /healcastersat <% hps> 
    /echo /doassist <PC Name> 
  } 
/return 

Sub Event_OutDoor 
  /echo This is an indoor zone. Sorry. 
  /varset OutDoors FALSE 
/return 

Sub Event_Invited 
  /invite 
/return 

| ################## 

Sub Event_ImDead 
   /declare i int local 1 
   /declare g int local 0 
   /declare sID int local 0 
   /echo Bummer ! 
:Zone_Loop 
   /if ( ${Me.Bound.ID} != ${Zone.ID} ) /goto :Zone_Loop 
   /varset FollowFlag 0 
   /varset underAttackBy 0 
   /varset MobRooted FALSE 
   /varset MobDebuffed FALSE 
   /varset MobSlowed FALSE 
   /varset PetOn FALSE 
   /varset MobDoTed FALSE 
   /varset CombatOn FALSE 
   /varset DotTime 0 
   /varset TargetArray[1] NULL 
   /varset TargetArray[2] NULL 
   /varset TargetArray[3] NULL 
   /varset TargetArray[4] NULL 
   /squelch /stick off 
   /delay 5s 
   /consent group 
   /consent raid 
   /delay 5 
   /gsay Group Consented, ready for rez.
   /call MemSpells 
   /call Wait4Rez 
   /delay 20 
   /if (!${SpellBuff.Size[1]}) /return 
   /for i 1 to ${SpellBuff.Size[1]} 
   /for g 0 to ${Math.Calc[${Group.Members}+${otherBuffees.Size}]} 
    /if (${g}<=${Group.Members}) { 
       /varset sID ${Group.Member[${g}].ID} 
    } else { 
       /varset sID ${Spawn[pc ${otherBuffees[${Math.Calc[${g}-${Group.Members}]}]}].ID} 
    } 
    /squelch /varset SpellBufftmr${i}${Spawn[${sID}].Name}   0 
    /next g 
    /next i 
/return 

Sub Wait4Rez 
  :waitforrez 
  /if (!${Window[ConfirmationDialogBox].Open}) { 
    /delay 5s ${Window[ConfirmationDialogBox].Open} 
    /goto :waitforrez 
  } 
  /if (${Window[ConfirmationDialogBox].Open}) /notify ConfirmationDialogBox Yes_Button leftmouseup 
  :zonein 
  /delay 5 
  /squelch /target mycorpse 
  /delay 5 
  /if (${Target.CleanName.NotEqual[${Me}'s corpse]}) /goto :zonein 
  /if (${Target.CleanName.Equal[${Me}'s corpse]}) { 
    /delay 3s 
    /call Loot_Corpse 
    /end 
  } else /goto :zonein 
/return 

Sub Loot_Corpse 
  /declare LootTotal int local 0 
  /declare LootSlot int local 
  /squelch /target mycorpse 
  /if (${Target.Type.NotEqual[CORPSE]} || !${Target.ID}) { 
    /echo ** Can't target my corpse. 
    /return 
  }    
  /corpse 
  /delay 1s 
  /loot 
  /delay 1s 
  /if (${Me.State.NotEqual[BIND]}) { 
    /echo ** Massive lag right now... Aborting looting. 
    /return 
  } 
  :LootLag 
  /if (${LootTotal}!=${Corpse.Items}) { 
    /varset LootTotal ${Corpse.Items} 
    /delay 5 
    /goto :LootLag 
  } 
  /for LootSlot 1 to ${LootTotal} 
    :LootItem 
    /itemnotify loot${LootSlot} rightmouseup 
    /delay 3 
    /if (${Corpse.Item[${LootSlot}].ID}) { 
      /delay 2 
      /goto :LootItem 
    } 
  /next LootSlot 
  /delay 5 
  /echo ** Done looting my corpse. 
  /notify LootWnd DoneButton leftmouseup 
/return 

Sub Event_Chat(string ChatType,string ChatSender,string ChatText) 
  /if (!${ChatType.Equal[GROUP]} && !${ChatType.Equal[TELL]}) /return 
  /declare i int local 

  /if (${ChatText.Equal[heal]}) { 
    /squelch /stick off 
    /squelch /moveto off 
    /target pc ${ChatSender} 
    /if (${Target.Type.Equal[PC]} && ${Target.Distance}<=100) { 
      /squelch /stick off 
      /squelch /moveto off 
      /call cast ${SpellHeal} gem${SpellHealGem} 
      /varset tookAction 1 
    } 
    /return 
  } 

  /if (${ChatText.Equal[slow]}) { 
    /assist ${ChatSender} 
    /delay 3 
    /if (${Target.Type.Equal[NPC]} && ${Target.Distance}<=100) { 
      /squelch /stick off 
      /squelch /moveto off 
      /call cast ${SpellSlow} gem${SpellSlowGem} 6s 
      /varset tookAction 1 
      /tell ${ChatSender} %T is SLOWED 
    } 
    /return 
  } 

  /if (${ChatText.Equal["buff me"]}) { 
    /squelch /stick off 
    /squelch /moveto off 
    /target pc ${ChatSender} 
    /if (${Target.Type.Equal[PC]}) { 
      /declare tmpArray[${Math.Calc[${otherBuffees.Size}+1]}] string local 
      /for i 1 to ${otherBuffees.Size} 
      /if (${i}>${otherBuffees.Size}) /goto :followingBuffMeCommand 
      /varset tmpArray[${i}] ${otherBuffees[${i}]} 
      /if (${otherBuffees[${i}].Equal[${ChatSender}]}) /return 
      /next i 
      :followingBuffMeCommand 
      /varset tmpArray[${tmpArray.Size}] "pc ${ChatSender}" 
      /deletevar otherBuffees 
      /declare otherBuffees[${tmpArray.Size}] string global 
      /for i 1 to ${tmpArray.Size} 
        /if (${i}>${tmpArray.Size}) /goto :followingBuffMeCommand2 
        /varset otherBuffees[${i}] ${tmpArray[${i}]} 
        /next i 
      :followingBuffMeCommand2 
    } 
      /return 
  } 

  /if (${ChatText.Find[" LOM"]} || ${ChatText.Find[" OOM"]}) /if (${ChatType.Equal[GROUP]} && ${Spawn[pc ${ChatSender}].Distance} < ${Spell[perfection of Spirit].AERange}) /if (${Me.AltAbilityReady[perfection of Spirit]}) { 
    /squelch /moveto off 
    /squelch /stick off 
    /keypress forward 
    /keypress back 
    /delay 3 
    /target id ${Me.ID} 
    /if (!${perfectionAnnounced}) /g INC perfection of Spirit - Group mana/health regen! 
    /varset perfectionAnnounced 1 
    /call Cast "Perfection of Spirit" alt 
    /varset perfectionNeeded 1 
    /if (!${Macro.Return.Equal[CAST_SUCCESS]}) /varset perfectionNeeded 1 
    /if (${Macro.Return.Equal[CAST_SUCCESS]}) { 
      /varset perfectionNeeded 0 
      /varset perfectionAnnounced 0 
    } 
  } 

  /if (${ChatText.Equal["follow me"]}) { 
    /if (!${AllowAutoFollow}) /return
    /varset SAFETOCAST FALSE 
    /squelch /stick off 
    /squelch /moveto off 
    /target ${ChatSender}
    /delay 1s ${Target.CleanName.Equal[${ChatSender}]} 
    /call FollowFunction "${Target.CleanName}"
    /varset following ${ChatSender} 
    /return 
  } 
      
  /if (${ChatText.Equal["make camp"]}) { 
    /varset SAFETOCAST TRUE
    /varset FollowFlag 0 
    /varset following FALSE 
    /keypress forward
    /keypress back 
    /varset HomeX ${Me.X} 
    /varset HomeY ${Me.Y} 
    /echo No longer following. Resuming program. 
    /return 
  } 

  /if (${ChatText.Equal[mana]}) { 
    /gsay ${Me.PctMana}% Mana 
    /varset CallManaTmr 300 
    /return 
  } 
/return 

| CheckIsLookingAt 
| Used for checking if an NPC is attacking.someone.  Default PC is master 
|Usage /call CheckIsLookingAt "id of mob to check" "id of PC to check" 
Sub CheckIsLookingAt(int MobID,int PCID) 
   /declare MobHeading int local 0 
   /declare HeadingToPC int local 
   /declare DeltaX local float 
   /declare DeltaY local float 
   /declare HeadingDelta local float 
   /if (!${Defined[PCID]} || !${PCID}) /return 0 
   /if (${Spawn[id ${MobID}].ID}) { 
      /varcalc DeltaX ${Spawn[id ${PCID}].X}-${Spawn[id ${MobID}].X} 
      /varcalc DeltaY ${Spawn[id ${PCID}].Y}-${Spawn[id ${MobID}].Y} 
      /varcalc MobHeading ${Spawn[id ${MobID}].Heading.Degrees} 
      /if (${DeltaX}>0) { 
         /varcalc HeadingToPC ${Math.Atan[${DeltaY}/${DeltaX}]}+270 
      } else /if (${DeltaX}<0) { 
         /varcalc HeadingToPC ${Math.Atan[${DeltaY}/${DeltaX}]}+90 
      } else { 
         /if (${DeltaY}>0) { 
            /varcalc HeadingToPC 90 
         } else { 
            /varcalc HeadingToPC 270 
         } 
      } 
      /varcalc HeadingDelta ${Math.Abs[${HeadingToPC}-${MobHeading}]} 
      |/echo DeltaY ${DeltaY} DeltaX ${DeltaX}  Atan ${Math.Atan[${DeltaY}/${DeltaX}]} 
      |/echo Mob ${Spawn[id ${MobID}].Name} MobHeading ${MobHeading} HeadingToPC ${HeadingToPC} 
      /if (${HeadingDelta}<4 || ${HeadingDelta}>356) { 
         /return 1 
      } 
   } 
/return 0 

Sub AttemptAvoid(int pcID) 
  /declare i int local 1 
  /declare j int local 1 
  /declare final[4] float local 
  /declare tmp[2] float local 
  /declare tmp2[3] float local 
  /declare tmp3[3] float local 
  /if (!${AutoMove}) /return 
  /if (${FollowFlag}) /return 
  /varset tmp[1] ${Spawn[pc ${M_Assist}].X} 
  /varset tmp[2] ${Spawn[pc ${M_Assist}].Y} 
  /if (${Defined[pcID]} && ${pcID}) { 
    /varset tmp[1] ${Spawn[${pcID}].X} 
    /varset tmp[2] ${Spawn[${pcID}].Y} 
  } 
  /squelch /varset tmp2[1] ${Spawn[${underAttackBy}].X} 
  /squelch /varset tmp2[2] ${Spawn[${underAttackBy}].Y} 
  /squelch /varset tmp2[3] ${Spawn[${underAttackBy}].MaxRange} 
  /varset final[3] 9999 
  /for i 1 to ${SafeLocs.Size[1]} 
    /if (${SafeLocs[${i},1]}!=0 && ${SafeLocs[${i},2]}!=0) { 
      /varset final[4] ${Math.Distance[${SafeLocs[${i},1]},${SafeLocs[${i},2]}:${tmp[1]},${tmp[2]}]} 
      /if (${final[4]} < ${final[3]}) { 
        /if (${Math.Distance[${SafeLocs[${i},1]},${SafeLocs[${i},2]}:${tmp2[1]},${tmp2[2]}]} > ${tmp2[3]}) { 
          /for j 1 to ${DebuffTimers.Size} 
            /if (${DebuffTimers[${j}]}) { 
              /squelch /varset tmp3[1] ${Spawn[${DebuffTimers[${j}]}].X} 
              /squelch /varset tmp3[2] ${Spawn[${DebuffTimers[${j}]}].Y} 
              /squelch /varset tmp3[3] ${Spawn[${DebuffTimers[${j}]}].MaxRange} 
              /if (${Math.Distance[${SafeLocs[${i},1]},${SafeLocs[${i},2]}:${tmp3[1]},${tmp3[2]}]} <= ${Math.Calc[${tmp3[3]}+15]}) /next i 
            } 
          /next j 
          /varset final[1] ${SafeLocs[${i},1]} 
          /varset final[2] ${SafeLocs[${i},2]} 
          /varset final[3] ${final[4]} 
        } 
      } 
    } 
  /next i 
  /if (${underAttackBy} && !(${Defined[DebuffTimer${underAttackBy}]} && ${DebuffTimer${underAttackBy}}>0)) { 
  /echo Setting debuff timer.... 
  /call SetDebuffTimer ${underAttackBy} 50 
  } 
  /varset underAttackBy 0 
  /varset underAttack 50 
  /if (${final[1]}!=0 && ${final[2]}!=0 && !${DoMelee}) { 
    /sit off 
    /delay 1 
    /squelch /stick off 
    /squelch /moveto loc ${final[2]} ${final[1]} 
    /varset MoveToTmr 50 
    /varset DoingMove 1 
    /varset delayMoveTimer 50 
    /delay 10 
    /return 
  } 
/return 

Sub PullNearestMob 
  /declare i int local 1 
  /declare s int local 1 
  /declare h int local 1 
  /varset DidDelay 0 
  /for i 1 to 10 
  /varset s ${Me.NearestSpawn[${i},npc].ID} 
  /if (${Spawn[${s}].Speed}<100) /if (${Spawn[${s}].Distance}<=${Spell[${SpellSlow}].Range} && ${Spawn[${s}].Distance}<=${AutoPullDistance}) { 
    /if (${LineOfSight[${Me.Y},${Me.X},${Me.Z}:${Spawn[${s}].Y},${Spawn[${s}].X},${Spawn[${s}].Z}]}) { 
      /squelch /target clear 
      /target id ${s} 
      /delay 2s ${s}==${Target.ID} 
      /if (${Target.PctHPs}>=100) { 
        /varset GotMobID ${s} 
        :WaitForStop 
        /squelch /stick off 
        /squelch /moveto off 
        /keypress forward 
        /keypress right 
        /keypress left 
        /keypress back 
        /keypress strafe_left 
        /keypress strafe_right 
        /delay 1 
        /doevents 
        /if (${underAttack}) { 
          /varset GotMobID ${underAttackBy} 
          /return 1 
        } 
        /if (${Me.Moving}) /goto :WaitForStop 
        /delay 4 
        /doevents 
        /if (${underAttack}) { 
          /varset GotMobID ${underAttackBy} 
          /return 1 
        } 
        /face nolook loc ${PrevLoc[4]}, ${PrevLoc[3]} 
        /call cast ${SpellSlow} gem${SpellSlowGem} 6s 
        /varset tookAction 1 
        /if (${Macro.Return.Equal["CAST_INTERRUPTED"]}) { 
          /doevents 
          /if (${underAttack}) { 
          /varset GotMobID ${underAttackBy} 
          /return 1 
        } 
        /next i 
        } else /if (${Macro.Return.Equal["CAST_IMMUNE"]}) { 
        /if (${Verbose}) /gsay < %T > is IMMUNE to slow ! 
          /call SetDebuffTimer ${Target.ID} ${Math.Calc[${Spell[${SpellSlow}].Duration}*6000-100]} 
          /varset MobSlowed TRUE 
          /return 1 
        } else /if (${Macro.Return.Equal["CAST_RESISTED"]}) { 
            /if (!${FastSlow}) { 
            /if (${Verbose}) /gsay < %T > RESISTED slow ! Trying again... 
            /call SetDebuffTimer ${Target.ID} 60 
            /return 1 
          } 
          /call SetDebuffTimer ${Target.ID} ${Math.Calc[${Spell[${SpellSlow}].Duration}*60-100]} 
          /varset MobSlowed TRUE 
          /return 1 
        } else /if (${Macro.Return.Equal["CAST_SUCCESS"]}) { 
          /if (${Verbose}) /gsay < %T > is SLOWED 
          /varset MobSlowed TRUE 
          /call SetDebuffTimer ${Target.ID} ${Math.Calc[${Spell[${SpellSlow}].Duration}*60-100]} 
          /return 1 
        } else /if (${Macro.Return.Equal[CAST_OUTOFRANGE]} || ${Macro.Return.Equal[CAST_CANNOTSEE]}) { 
          /next i 
        } else /if (${Macro.Return.Equal["CAST_CANNOTSEE"]}) { 
          /next i 
        }  
      } 
      /squelch /target clear 
    } 
  } 
  /next i 
  /varset GotMobID 0 
/return 0 

Sub GoHome 
  /if (${AutoPull}) { 
    /call StopFunction 
    /call PlayFunction "${PathFile} 1 cr nopp noz" 
    /varset doingPath 2 
  } else /if (${TetheredToHome} && ${following.Equal[FALSE]}) { 
    /if (${Me.Sitting}) /stand 
    /squelch /stick off 
    /squelch /moveto off 
    /if (${Math.Distance[${HomeY},${HomeX}]}<15) { 
      /keypress forward 
      /keypress back 
      /return 
    } 
    /face fast nolook loc ${HomeY},${HomeX} 
    :MoveHome 
    /delay 1 
    /doevents 
    /face nolook fast loc ${HomeY},${HomeX} 
    /if (${Math.Distance[${HomeY},${HomeX}]}>10) /keypress forward hold 
    /call AreWeStuck 
    /if (${Math.Distance[${HomeY},${HomeX}]}<10) { 
      /keypress forward 
      /keypress back 
      /return 
    } 
    /goto :MoveHome 
  } 
/return 

Sub AreWeStuck 
   /doevents 
   /declare counter int local 0 
   /declare StuckXLoc int local 0 
   /declare StuckYLoc int local 0 
   /declare i int local 0 
   /varset StuckXLoc ${Me.X} 
   /varset StuckYLoc ${Me.Y} 
   /delay 5 
   /if (${StuckXLoc}==${Me.X} && ${StuckYLoc}==${Me.Y}) /call MoveAround 
/return 

Sub MoveAround 
   /doevents 
   /keypress forward 
   /keypress back hold 
   /delay 3 
   /keypress back 
   /if (${Math.Rand[2]}) { 
   /keypress strafe_right hold 
   } else { 
   /keypress strafe_left hold 
   } 
   /delay 10 
   /keypress strafe_right 
   /keypress strafe_left 
/return 

|---------------------------------------------------------------------------- 
|SUB: DoTheLooting 
|---------------------------------------------------------------------------- 
Sub DoTheLooting(int targID) 
DEBUG_2 Going to loot 
DEBUG_2 DoTheLooting Target:  ${Spawn[${targID}].Level} ${Spawn[${targID}].CleanName}, ID:${targID} 
  /declare tmptmr timer local 0 
  /target id ${targID} 
  /if (${Spawn[${targID}].Level}>LOOT_ABOVE_LEVEL) { 
    /delay 3 
DEBUG_2 Running to the corpse 
    /squelch /moveto loc ${Spawn[${targID}].Y} ${Spawn[${targID}].X} 
    /varset tmptmr 50 
    :notThereLoop 
    /if (${Spawn[${targID}].Distance}>10 && ${tmptmr} > 0) /goto :notThereLoop 
    /squelch /moveto off 
DEBUG_2 Running done 
    /if ( ${Spawn[${targID}].Type.Equal["Corpse"]} ) { 
      /varcalc lootcnt ${lootcnt}+1 
DEBUG_2 Looting corpse #${lootcnt} 
      /call LootMob 
      /doevents 
      /autoinventory 
    } 
  } else { 
DEBUG_1 This one is to low lvl. I wont loot it! 
    /squelch /if ( ${Target.ID} ) /target clear 
  } 
  /call DisplayLootRecord 
/return 

Sub LootMob 
  /declare LootSlot    int local  0 
  /declare LootCheck   int local  0 
  /declare LootTotal   int local  0 
  /declare LootLoopCnt int local  0 
  /declare LootItemName string local 
  :LootLoop 

   /if (!${Target.ID} || !${Target.Type.Equal[Corpse]}) /target corpse 

   /fastdrop on 
   /loot never 
   /loot 
   /call Delay 10 
   /if (!${Corpse.Items}) { 
      /call Delay 30 
      /if (${Corpse.Items}) /goto :LootLoop 
      /keypress ESC 
      /call Delay 2 
      /keypress ESC 
      /call Delay 2 
      /keypress ESC 
      DEBUG_2 NO LOOT! Cheap Bastard! 
      /return 
   } 

   /if (${Bool[LOOT_ITEMS]}) { 
       /varset LootTotal ${Corpse.Items} 
       /for LootSlot 1 to ${Math.Calc[${LootTotal}+0]} 
        /call Delay 2 
          /itemnotify loot${LootSlot} leftmouseup 
          /delay 2s ${Cursor.ID} 
          /if (${Bool[LOOT_ALL_ITEMS]}) { 
             /call CopperToMoney ${Cursor.Value} 
             DEBUG_1 Keeping a ${Cursor.Name} of value ${Macro.Return}... WOOT! 
          /if (${Bool[LOOT_KEEP_RECORD]}) { 
             /call LootRecord "${Cursor.Name}" 
          } 
             /autoinventory 
             /delay 2s !${Cursor.ID} 
          } else { 
             /for LootCheck 1 to ${LootList.Size} 
                /if (${Cursor.Name.Find[${LootList[${LootCheck}]}]}) { 
                   /call CopperToMoney ${Cursor.Value} 
                   DEBUG_1 Keeping a ${Cursor.Name} of value ${Macro.Return}... WOOT! 
                   |/varcalc RV_LootStats[${LootCheck}] ${RV_LootStats[${LootCheck}]}+1 
                /if (${Bool[LOOT_KEEP_RECORD]}) { 
                 /call LootRecord "${Cursor.Name}" 
               } 
                   /autoinventory 
                   /delay 2s !${Cursor.ID} 
                } 
             /next LootCheck 
              
             |If the item was not found in our list, Check if it should be looted anyway 
             /if ( ${Cursor.ID} ) { 
                /if ((!${Cursor.Lore}) && (!${Cursor.NoDrop}) && (${Cursor.Value} >= LOOT_STACKABLE_ITEMS_IF_VALUE_IS_ABOVE) && (${Cursor.Stackable})) { 
                   /call CopperToMoney ${Cursor.Value} 
                   DEBUG_1 This Stackable Item is of great Value. LOOT IT! (${Macro.Return}) ${Cursor.Value} 
                 /if (${Bool[LOOT_KEEP_RECORD]}) { 
                    /call LootRecord "${Cursor.Name}" 
                   } 
                   /autoinventory 
                   /delay 2s !${Cursor.ID} 
                } else /if ((${Cursor.Value} >= LOOT_NORMAL_ITEMS_IF_VALUE_IS_ABOVE)  && (!${Cursor.NoDrop})) { 
                   /call CopperToMoney ${Cursor.Value} 
                   DEBUG_1 This Item is of great Value. LOOT IT! (${Cursor.Value}) 
                 /if (${Bool[LOOT_KEEP_RECORD]}) { 
                    /call LootRecord "${Cursor.Name}" 
                 } 
                   /autoinventory 
                   /delay 2s !${Cursor.ID} 
                } 
             } 
              
          } 
          
          |Drop if droppable, destroy if not 
          |/if (${Bool[LOOT_DESTROY]}) { 
            | 
            /call CopperToMoney ${Cursor.Value} 
            /if (${Cursor.ID} && (!${Cursor.NoDrop}) ) { 
                DEBUG_1 Dropping a ${Cursor.Name} of value ${Macro.Return}... 
                /drop            
               /delay 2s !${Cursor.ID} 
            } 
            /if (${Cursor.ID}) { 
                DEBUG_1 Destroying a ${Cursor.Name} of value ${Macro.Return}... 
                /destroy 
               /delay 2s !${Cursor.ID} 
             } 
          |} 
        /next LootSlot 

     /if (${Corpse.Items}) { 
      /keypress ESC 
      /call Delay 2 
      /keypress ESC 
      /call Delay 2 
      /keypress ESC 
      /call Delay 2 
      /keypress ESC 

   /goto :LootLoop 
     } 

   } 
   /keypress ESC 
   /call Delay 2 
   /keypress ESC 
   /call Delay 2 
   /keypress ESC 

/return 


|---------------------------------------------------------------------------- 
|SUB: CopperToMoney - Returns pp,gp,sp,cp of pure cp values 
|---------------------------------------------------------------------------- 
Sub CopperToMoney(int copper) 
    /declare pp int local 0 
    /declare gp int local 0 
    /declare sp int local 0 
:plat 
    /if (${copper}>=1000) { 
        /varcalc pp ${pp}+1 
        /varcalc copper ${copper}-1000 
        /goto :plat        
    } 
:gold 
    /if (${copper}>=100) { 
        /varcalc gp ${gp}+1 
        /varcalc copper ${copper}-100 
        /goto :gold        
    } 
:silver 
    /if (${copper}>=10) { 
        /varcalc sp ${sp}+1 
        /varcalc copper ${copper}-10 
        /goto :silver        
    } 
    /declare ret string local 
    /if (${pp}>0) /varset ret ${ret}, ${pp}pp 
    /if (${gp}>0) /varset ret ${ret}, ${gp}gp 
    /if (${sp}>0) /varset ret ${ret}, ${sp}sp 
    /if (${copper}>0) /varset ret ${ret}, ${copper}cp 
    /if ( ${ret.Length}>0 ) { 
        /varset ret ${ret.Right[${Math.Calc[${ret.Length}-1]}]} 
    } else { 
        /varset ret Nothing! 
    } 
/return ${ret} 


|---------------------------------------------------------------------------- 
|SUB: LootRecord - Keeps record of your looting 
|---------------------------------------------------------------------------- 
Sub LootRecord(string item) 
    /declare tmp string local "${item}" 
    |Removing variable letters that wont be accepted, add illegal variable letters here 
    /call ReplaceString "${item}" " " "_" 
    /varset item ${Macro.Return} 
    /call ReplaceString "${item}" "'" "_" 
    /varset item ${Macro.Return} 
    /call ReplaceString "${item}" "-" "_" 
    /varset item ${Macro.Return} 
    DEBUG_3 Variable name: ${item} 
    /if ( !${Defined[Loot_Item_${item}]} ) { 
        /declare Loot_Item_Name_${item} string outer ${tmp} 
        /declare Loot_Item_${item} int outer 0 
        /call AddToArray LootedList string ${item} 
    } 
    /varcalc Loot_Item_${item} ${Loot_Item_${item}} + 1 
    
/return 

Sub DisplayLootRecord 
    |Display what we have so far: 
    /declare i int local 
    /declare output string local 
    /for i 1 to ${LootedList.Size} 
        /varset output ${output}, ${Loot_Item_${LootedList[${i}]}} ${Loot_Item_Name_${LootedList[${i}]}} 
    /next i output ${output.Right[${Math.Calc[${output.Length}-1]}]} 
    DEBUG_1 Items looted:  ${output} 
/return 


|---------------------------------------------------------------------------- 
|SUB: AddToArray - Dynamically adds elements to an array. 
|---------------------------------------------------------------------------- 
Sub AddToArray(string varname, string vartype, targID) 
  /declare i int local 
  /declare copyofarr[0] ${vartype} local 
  /if (${Defined[${varname}]}) { 
    /deletevar copyofarr 
    /declare copyofarr[${${varname}.Size}] ${vartype} local 
    /for i 1 to ${${varname}.Size} 
      /varset copyofarr[${i}] ${${varname}[${i}]} 
    /next i 
    /deletevar ${varname} 
    /declare ${varname}[${Math.Calc[${copyofarr.Size}+1]}] ${vartype} outer 
    /for i 1 to ${Math.Calc[${copyofarr.Size}]} 
DEBUG_3 varset ${varname}[${i}] ${copyofarr[${i}]} 
      /varset ${varname}[${i}] ${copyofarr[${i}]} 
    /next i 
    /varset ${varname}[${${varname}.Size}] ${targID} 
  } else { 
    /declare ${varname}[1] ${vartype} outer 
    /varset ${varname}[1] ${targID} 
  } 
/return 

Sub ReplaceString(string str, string find, string replace) 
  /declare stringcnt int local 
  /declare i int local 
  /declare ret string local 
  /if ( ${str.Length}==0 ) /return "" 
  /if ( ${find.Length}<=1 ) { 
    /varcalc stringcnt ${str.Count["${find}"]} + 1 
    /if ( ${stringcnt}==0 ) /return "${str}" 
    /for i 1 to ${stringcnt} 
      /varset ret ${ret}${replace}${str.Token[${i},"${find}"]} 
    /next i 
    /varset ret ${ret.Right[${Math.Calc[${ret.Length}-${replace.Length}]}]} 
  } else { 
    /varset ret ${str} 
    :GoAgain 
    /if ( ${ret.Find["${find}"]} ) { 
      /varset i ${ret.Find["${find}"]} 
      /varset ret ${ret.Left[${Math.Calc[${i}-1]}]}${replace}${ret.Right[${Math.Calc[${ret.Length}-${i}-${find.Length}+1]}]} 
      /if ( ${ret.Find["${find}"]} ) /goto :GoAgain 
    } 
  } 
/return ${ret} 

Sub Event_Zoned(string Line) 
  /declare i int local 
  /for i 1 to ${SafeLocs.Size[1]} 
    /varset SafeLocs[${i},1] 0 
    /varset SafeLocs[${i},2] 0 
  /next i 
  /if (${quitOnZone}) { 
    /quit 
    /end 
  } 
/return 

Sub Event_UnderAttack(string Line) 
  /declare i int local 
  /if (!${underAttack}) { 
  |/echo Under Attack! Not sitting for 5 seconds. 
  /for i 1 to 10 
    /varset underAttackBy ${Me.NearestSpawn[npc].ID} 
    /if (${Line.Find[${Spawn[${underAttackBy}].CleanName}]}) { 
      /call CheckIsLookingAt ${underAttackBy} ${Me.ID} 
      /if (!${Macro.Return}) { 
        /varset underAttackBy 0 
        /next i 
      } 
      /varset underAttack 80 
      /if (!${PathingFlag}) /if (!${DoMelee}) /call AttemptAvoid 
      /stand 
      /return 
    } 
    /varset underAttackBy 0 
    /next i 
  } 
  /varset underAttack 50 
/return 

Sub Event_GMInZone 
   /end 
/return 

Process
a lesser mummy
a lesser mummy
Posts: 73
Joined: Fri Jun 25, 2004 5:30 pm

Post by Process » Wed Jul 06, 2005 3:16 pm

I can't seem to get this macro to put ferocity of irionu on my pet, or myself. Nor can I get it to rebuff my pet with growl of the leopard. It does it buffs it with growl of the leopard when the macro starts, then never puts it back (Maybe because it only has a 2 min duration?).

Here are my settings:

Code: Select all

  /declare SpellPetBuff[3] string outer 
  /varset  SpellPetBuff[1] "Growl of the Beast" 
  /varset  SpellPetBuff[2] "Spirit of Irionu" 
  /varset  SpellPetBuff[3] "Growl of the leopard" 
Any ideas? I was also getting a string error when the pet would try to buff my pet. I replaced the spell_routines.inc with a_druid_00's newer version and that stopped, however with the new spell_routines.inc file it wont' even try to buff my pet with growl of the leopard at all, even initially.

Any ideas?

Process[/code]

DigitalMocking
a grimling bloodguard
a grimling bloodguard
Posts: 620
Joined: Mon Apr 04, 2005 5:53 pm

Post by DigitalMocking » Wed Jul 06, 2005 6:49 pm

Its not my macro, so I'm not really interested in supporting it.

This is what I use for my beastlord, I don't bother with growl of the leapard actually, its a pain in the ass to keep up.

Code: Select all


  /declare SpellPetBuff[5] string outer 
  /varset  SpellPetBuff[1] "Growl of the Beast" 
  /varset  SpellPetBuff[2] "Spirit of Irionu"
  /varset  SpellPetBuff[3] "Ferocity" 
  /varset  SpellPetBuff[4] "Focus of Alladnu" 
  /varset  SpellPetBuff[5] "Infusion of Spirit"

that's with druid's new spell_routines and the macro I posted above.

DigitalMocking
a grimling bloodguard
a grimling bloodguard
Posts: 620
Joined: Mon Apr 04, 2005 5:53 pm

Post by DigitalMocking » Thu Jul 14, 2005 5:32 pm

Much updated/rewritten version of this macro has been posted in ViP

xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

Re: Beastlord bot (Updated 05/07/05)

Post by xyilla » Wed May 07, 2025 6:28 pm


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

Re: Beastlord bot (Updated 05/07/05)

Post by xyilla » Wed May 07, 2025 6:29 pm


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

Re: Beastlord bot (Updated 05/07/05)

Post by xyilla » Wed May 07, 2025 6:30 pm


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

Re: Beastlord bot (Updated 05/07/05)

Post by xyilla » Wed May 07, 2025 6:31 pm


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

Re: Beastlord bot (Updated 05/07/05)

Post by xyilla » Wed May 07, 2025 6:32 pm


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

Re: Beastlord bot (Updated 05/07/05)

Post by xyilla » Wed May 07, 2025 6:34 pm


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

Re: Beastlord bot (Updated 05/07/05)

Post by xyilla » Wed May 07, 2025 6:35 pm


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

Re: Beastlord bot (Updated 05/07/05)

Post by xyilla » Wed May 07, 2025 6:36 pm