Encbot help

Status
Not open for further replies.

pablohoney

I got a question!
Joined
Apr 24, 2006
Messages
37
Reaction score
0
Points
0
Taron here is the section that is not working atm

/if (${ChatText.Equal[slow]}) {
/assist ${ChatSender}
/if (${Target.Type.Equal[NPC]} && ${Target.Distance}<=100) {
/call cast ${SpellDebuff} gem3 6s
:SSlow_Loop
/call cast ${SpellSlow} gem7 6s
/if (${Macro.Return.Equal["CAST_INTERRUPTED"]}) /goto :SSlow_Loop {
/if (${Macro.Return.Equal["CAST_IMMUNE"]}) {
/if (${Verbose}) /gsay *** %T is IMMUNE to my Slow!
/return
}
/if (${Macro.Return.Equal["CAST_RESISTED"]}) {
/if (${Verbose}) /gsay *** %T RESISTED Slow ! Trying again asap
/goto :SSlow_Loop
}
/if (${Macro.Return.Equal["CAST_SUCCESS"]}) {
/if (${Verbose}) /gsay *** %T is Slowed
/return
}
}
 
this area also

938
823
301
I believe those are the problem lines..the macro ends and it says {} pairing ran into another subroutine
 
Code:
/if (${ChatText.Equal[slow]}) {
   /assist ${ChatSender}
   /if (${Target.Type.Equal[NPC]} && ${Target.Distance}<=100) {
      /call cast ${SpellDebuff} gem3 6s
:SSlow_Loop
     /call cast ${SpellSlow} gem7 6s
     /if (${Macro.Return.Equal["CAST_INTERRUPTED"]}) /goto :SSlow_Loop {
       /if (${Macro.Return.Equal["CAST_IMMUNE"]}) {
           /if (${Verbose}) /gsay *** %T is IMMUNE to my Slow!
           /return
           }
       /if (${Macro.Return.Equal["CAST_RESISTED"]}) {
          /if (${Verbose}) /gsay *** %T RESISTED Slow ! Trying again asap
          /goto :SSlow_Loop
       }
       /if (${Macro.Return.Equal["CAST_SUCCESS"]}) {
          /if (${Verbose}) /gsay *** %T is Slowed
          /return
          }
      }
[COLOR="Red"]}[/COLOR]

That will fix it from running into the other subroutine.
 
for fry

ty pete and this is the full mac for fry
Code:
| Encbot Version 1.1    by Coder456 
|_______________________________________________________________| 
| 
| 
| Upgrades from 1.0 - Removed Dotting, just makes sense if want a solid crowd control function and replace DoT 
| spell slot with Boggle.  Added a Gather Mana function - it will use Gather Mana if 5 percent or less it.  
| Added a Pacify function.  Added ITU request. 
| 
| I started with the Excellent Base routine by Ramna and Hubba and changed it for use with 
| an enchanter.  For the Add control, this is based on code developed by Fez_ajer. 
| 
| Usage: 
| 1. Target player you like to assist (main tank is good) 
| 2. Start the script with: /mac <scriptname> [main assist] [chat channel] [controller] 
| 3. Parameters are optional defaults are built in 
| 
| 
| Features: commands work in tell or group 
| 
| The following commands will target the sender and cast the spells 
| requested on the sender: [NDT] [c6] [MR] [lev] [haste] [see] [invis] [Rune] [Cha] [ITU] 
| 
| The following commands will assist the sender and cast the spells 
| requested on the target: [Slow] [root] [dot] [nuke] [mez] [cripple] 
| (The [Mez] is for a single target mez whereas add is for crowd control) 
| 
| The following command will instruct the enchanter to engage in crowd control. 
| It will cycle through mobs within range and check aggro and mez adds: [add] 
| 
| The following commands: [buff] [buff me] will rebuff a person 
| 
| The following commands: [Buff them] will rebuff another group 
|  
| The following commands: [Follow me] [end follow] [stop] are for moving enchanter 
| 
| During combat he will only do requests for detrimentals 
| 
| [buff pet] works properly now, targets the senders pet and buffs 
| 
| [gate now] will memorize the gate spell and gate to bind, must be a tell  
| 
| Added a chat channel to echo all non command word tells to controller 
| added a vtell to controller on incomming tells 
| 
| Use "help" for more help ( !help is incomplete! ) 
|_______________________________________________________________| 
| 
| -!- Basis of this script is Version: v1.0c by Ranma 
| Awesome script, I hope you like what I have added 
| 
|_______________________________________________________________| 
| -!- This Script Uses spell_routines.inc by Rusty 
| -!- Exptrack snippet from exptracker.mac by Raebis, with tweaks from Phoenix (not tested) 
| 
|_______________________________________________________________| 


#Event   Enrageon         "#*#ENRAGED#*#" 
#Event   Enrageoff        "#*#no longer enraged#*#" 
#Event   ImDead           "You have been slain by#*#" 
#Event   Invited          "#*#To join the group, click on the 'FOLLOW' option, or 'DISBAND' to cancel#*#" 
#Event   NoDaggers        "You are missing Tiny Dagger" 
#Event   NoDots           "You are missing Peridot"  
#cHAT    Raid
#CHAT    Group
#CHAT    Chat
#CHAT    Tell
#Event TAGME            "#1# tells the#*#TAGME#*#"
#Event TAGME            "#1# tells you#*#TAGME#*#"
#Event CAMPALL           "#1# tells the#*#CAMPALL#*#"
#Event CAMPALL           "#1# tells you#*#CAMPALL#*#"
#Event SUCCORALL        "#1# tells the#*#SUCCORALL#*#"
#Event SUCCORALL        "#1# tells you#*#SUCCORALL#*#"

#include Spell_Routines.inc 



Sub Main 

| The spell will be memmed in the listed order. 
| Gem1 = Nuke1 
| Gem2 = DoT 
| Gem3 = Tash 
| Gem4 = Ward of Bedazzlement
| Gem5 = Pet, buffs, Boggle 
| Gem6 = Cripple 
| Gem7 = Slow 
| Gem8 = Mez 
| Gem9 = gate and root and rune 

| ########### Make changes in spells as you need. 

| ########### Default  Channel, Controller 

   /declare CChannel       outer "gameslah:nigs" 
   /declare ChatController outer "cupcakez" 
  
| ########### Your Spell List - update as needed  

   /declare SpellSlow          outer "Forlorn Deeds" 
   /declare SpellDoT           outer "Asphyxiate" 
   /declare SpellPet           outer "Salik's Animation" 
   /declare SpellDeBuff        outer "Howl of Tashan" 

   /declare SpellRoot          outer "Greater Fetter" 
   /declare SpellNuke          outer "Psychosis" 
   /declare SpellMez           outer "Euphoria" 
   /declare SpellCripple       outer "Synapsis Spasm" 
   /declare SpellBoG           outer "Boggle" 
  
   /declare SpellATK           outer "Night`s Dark Terror" 
   /declare SpellHASTE         outer "Speed of Salik" 
   /declare Spellc6            outer "Clairvoyance" 
   /declare SpellMR            outer "Guard of Druzzil" 
   /declare SpellRune          outer "Rune of Zebuxoruk" 
   /declare SpellSRune         outer "Ethereal Rune" 
   /declare SpellCha           outer "Overwhelming Splendor" 

   /declare SpellLEV           outer "Levitation" 
   /declare SpellINV           outer "Cloud of Indifference" 
   /declare SpellSEE           outer "Leviathan Eyes" 
   /declare SpellITU           outer "Invisibility to Undead" 
   /declare SpellPac           outer "Placate" 

   /declare SpellGATE          outer "Gate" 


| ########### My Pet Buff Spell List 

   /declare SpellPetBuff[2] string outer 
   /varset SpellPetBuff[1] "Speed of Salik" 
|  /varset SpellPetBuff[2] "Night`s Dark Terror" 

| ########### Other Pet Buff Spell List 

   /declare SpellPetBuffo[1] string outer 
   /varset SpellPetBuffo[1] "Speed of Salik" 

| ############ Group Buff List. 

   /declare SpellGrpBuff[4] string outer 
   /varset SpellGrpBuff[1] "Guard of Druzzil" 
   /varset SpellGrpBuff[2] "Hastening of Salik" 
   /varset SpellGrpBuff[3] "Voice of Clairvoyance" 
   /varset SpellGrpBuff[4] "Circle of Alendar" 
    
| ############ Single Buff List.    

   /declare SpellSingleBuff[4] string outer 
   /varset SpellSingleBuff[1] "Guard of Druzzil" 
   /varset SpellSingleBuff[2] "Speed of Salik" 
   /varset SpellSingleBuff[3] "Clairvoyance" 
   /varset SpellSingleBuff[4] "Wall of Alendar" 

| ############ Combat Variables 

   /declare AssistAt      int   outer 100
   /declare CombatAt      int   outer 95 

   /declare Rootat        int   outer 40 
   /declare RootMana      int   outer 40 

   /declare NukeAt        int   outer 80 
   /declare NukeMana      int   outer 50 

   /declare SitAt         int   outer 60 
   /declare BuffMana      int   outer 30 
   /declare MinMana       int   outer 15 
    
   /declare following     int   outer 0 
   /declare follname      string outer NULL 

| ############ To Do List 

   /declare DoTash             outer TRUE    
   /declare DoCripple          outer TRUE 
   /declare DoSlow             outer TRUE 
   /declare FastSlow           outer FALSE 
   /declare DoRoot             outer TRUE 
   /declare DoMez              outer TRUE 
   /declare CrowdControl       outer FALSE  

   /declare SummonPet          outer TRUE 
   /declare BuffPet            outer TRUE 
  
   /declare DoBoG              outer TRUE 
   /declare DoBuffs            outer TRUE 
   /declare DoNuke             outer TRUE 
   /declare Verbose            outer TRUE 

| ########### ! No Changes From Here Is Needed ! 

   /declare AlertList int outer
   /declare AlertResetTimer timer outer 10m 
   /declare CurZoneName string outer ${Zone.Name} 
   /declare MobList[CONTROLMAX,2] int outer 0 
   /declare MobNames[CONTROLMAX] string outer 
   /declare NonAggroList[CONTROLMAX,2] int outer 0 
   /declare MobAggroChecks int outer 2 
   /declare CrowdScanDelay timer outer 10s 
   /declare ControlRadius int outer 75 

   /squelch /alias tash /echo toggle tash 
   /squelch /alias slow /echo toggle slow 
   /squelch /alias cripple /echo toggle cripple 
   /squelch /alias fastslow /echo toggle fastslow 
   /squelch /alias root /echo toggle root 
   /squelch /alias pet /echo toggle pet 
   /squelch /alias dot /echo toggle dot 
   /squelch /alias nuke /echo toggle nuke 
   /squelch /alias nukeat /echo toggle nukeat    
   /squelch /alias buffs /echo toggle buffs 
   /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 assist /echo toggle assist 
   /squelch /alias status /echo toggle show 
   /squelch /alias show /echo toggle show    
   /squelch /alias help /echo toggle help 
   /squelch /alias verbose /echo toggle verbose    
    
   /declare TargetArray[4] string outer 
   /declare MobTashed      outer FALSE 
   /declare MobSlowed      outer FALSE 
   /declare MobCrippled    outer FALSE 
   /declare MobBoG         outer FALSE 
   /declare PetOn          outer FALSE 
   /declare MobRooted      outer FALSE 
   /declare MobDoTed       outer FALSE 
   /declare CombatOn       outer FALSE 
   /declare Engaged        outer FALSE    

   /declare M_Assist       string outer 

   /declare Exper float outer 
   /declare AAExp float outer 
        
   /varset Exper ${Me.Exp} 
   /varset AAExp ${Me.AAExp} 
    
   /call MemSpells 
    
| ############### Target a player as Main Assist 
    
      /if (${Defined[Param0]}) {  
          /varset M_Assist ${Param0} 
          /echo Assist set to ${M_Assist} 
      } else { 
          /if (!${Target.ID} || ${Target.Type.NotEqual[PC]}) { 
              /echo Your Do not have a main assist, make sure its a player character! 
              /endmacro 
          } 
          /varset M_Assist ${Target.CleanName} 
          /echo Assist set to ${M_Assist} 
      } 

      /assist off 

      /if (${Defined[Param1]}) /varset CChannel ${Param1} 
      /leaveall 
      /join ${CChannel} 
      /1 I am here! 
      /echo Joined channel ${CChannel} 

      /if (${Defined[Param2]}) /varset ChatController ${Param2} 
      /vtell ${ChatController} 005 
      /tell ${ChatController} I am here! 
      /echo My master is ${ChatController} 


| ###############    
| ############### Main Loop Starts 
| ###############  

:Main_Loop 

   |- Check for Standing if less than sitat then sit 
   |/if ( ${Me.State.Equal[Stand]} && ${Me.PctMana}<${SitAt} && !{CombatOn}) /sit 

   |- Check for new events in chat etc etc... 
   /doevents 
    
   |- Do we move? 
   :Hold_Main 
   /if (${Me.Moving}) /goto :Hold_Main 
    
   |- Check for crowdcontrol 
   /call MezAdds 
    
   |- Check for mobs and do combat stuff 
   /call GetTarget 
   /if (${CombatOn}) /call Combat        

   |- Check Ethereal Rune 
   /if (!${Me.Buff[${SpellSRune}].ID}) /call cast ${SpellSRune} gem9 5s 

   |- Check to see need to use Gather Mana 
   /call GatherMana 

   |- Group Buffs if more than BuffMana mana 
   |/if (${Me.PctMana}>=${BuffMana} && ${DoBuffs} && !${CombatOn}) /call GrpBuffs 

   |- Pet 
   /if (!${CombatOn}) /call PET

   /goto :Main_Loop 
/return 

| ###############    
| ############### Main Loop Ends 
| ############### 

  
| ############### Mem Spells in Spell List 

Sub MemSpells 

   /echo Memming spells. Hang on. 
   /if ( !${Me.Gem[${SpellNuke}]} ) { 
      /memspell 1 ${SpellNuke} 
      /delay 30 
   } 
   /if ( !${Me.Gem[${SpellBoG}]} ) { 
      /memspell 2 ${SpellBoG} 
      /delay 30 
   } 
   /if ( !${Me.Gem[${SpellDeBuff}]} ) { 
      /memspell 3 ${SpellDeBuff} 
      /delay 30 
   } 
   /if ( !${Me.Gem[${SpellATK}]} ) { 
      /memspell 4 ${SpellATK} 
      /delay 30 
   } 
   /if ( !${Me.Gem[${SpellPet}]} ) { 
      /memspell 5 ${SpellPet} 
      /delay 30 
   } 
   /if ( !${Me.Gem[${SpellCripple}]} ) { 
      /memspell 6 ${SpellCripple} 
      /delay 30 
   } 
   /if ( !${Me.Gem[${SpellSlow}]} ) { 
      /memspell 7 ${SpellSlow} 
      /delay 30 
   } 
   /if ( !${Me.Gem[${SpellMez}]} ) { 
      /memspell 8 ${SpellMez} 
      /delay 30 
   } 

   /if ( !${Me.Gem[${SpellSRune}]} ) { 
      /memspell 9 ${SpellSRune} 
      /delay 30 
   } 

   |/if ( ${Window[SpellBookWnd].Open} ) /windowstate SpellBookWnd close 
   /echo Spells are memmed. 

/return 

| ################### CrowdControl - Mez Adds 
#define CONTROLMAX 20 


Sub MezAdds 
 /if (${ChatText.Equal[Add]} && ${ChatType.Equal[TELL]}) { 
    /varset CrowdControl TRUE 
    /call CheckCrowdControl 
    } 
/return 

Sub CheckCrowdControl 
  | Bail if we're not on duty 
  /if (!${CrowdControl}) /return 
 
   /varset AlertList 20 
   /varset AlertResetTimer 10m 
   /varset CurZoneName ${Zone.Name} 
   /varset MobAggroChecks 2 
   /varset CrowdScanDelay 10s 
   /varset ControlRadius 75

  | Save the original target 
  /declare origtarget int local ${Target.ID} 

  | Clean up the control list 
  /call EmptyMobList 

  | Scan for mobs 
  /call ScanForNewMobs 

  | Control is the key 
  /call ControlMobList 

  | Reset to the original target 
  /if (${origtarget}!=0 && ${Spawn[id ${origtarget}].ID}) /target id ${origtarget} 
/return 

| Scan for Mobs 

Sub ScanNewMobs 
  /if (${CrowdScanDelay}>0) /return 
  /varset CrowdScanDelay 3s 
  /declare npcid int local 0 
  /declare TempNpcCount int local 0 

| Find all the NPC mobs in the camp radius around me 
  :mobfinder 
  /varset npcid ${Me.NearestSpawn[${Math.Calc[${TempNpcCount}+1]},npc radius ${ControlRadius} zradius 10 noalert ${AlertList}].ID} 
     /if (${npcid}==0) /goto :finderdone 
  /varset TempNpcCount ${Math.Calc[${TempNpcCount}+1]} 
     /if (${TempNpcCount}>CONTROLMAX) /goto :finderdone 
     /call CheckMobInControlList ${npcid} 
  /goto :mobfinder 
  | We're done finding mobs, now do something about them 
  :finderdone 
/return 

Sub ControlMobList 
  /declare tempvar int local 
  /declare npcid int local 
  /declare npccount int local 0 
  /declare retries int local 0 
  /declare mastertarget int local 0 
  /declare curmezspell string local 

  /for tempvar 1 to CONTROLMAX 
    /if (${MobList[${tempvar},1]}!=0 && ${Spawn[id ${npcid}].ID} && ${Spawn[id ${npcid}].State.NotEqual[DEAD]} && ${Spawn[id ${npcid}].Distance}<400 && ${MobList[${tempvar},2]}!=-1 && ${MobList[${tempvar},2]}<${Macro.RunTime}) /varset npccount ${Math.Calc[${npccount}+1]} 
  /next tempvar 

  /if (${npccount}==0) /return 

  /if (${npccount}>1) { 
    /squelch /target clear 
    /target ${M_Assist} 
    /delay 1s ${Target.CleanName.Equal[${M_Assist}]} 
    /if (${Target.CleanName.Equal[${M_Assist}]}) { 
      /assist ${M_Assist} 
      /delay 1s ${Target.CleanName.NotEqual[${M_Assist}]} 
      /if (${Target.CleanName.NotEqual[${M_Assist}]} && ${Target.ID}!=${Me.ID}) { 
         /varset mastertarget ${Target.ID} 
      } 
    } 
    /if (${mastertarget}==0) /echo DBG I couldn't figure out who ${M_Assist} is fighting 
  } 

  /for tempvar 1 to CONTROLMAX 
    /varset npcid ${MobList[${tempvar},1]} 
    /if (${npcid}!=0 && ${Spawn[id ${npcid}].ID} && ${Spawn[id ${npcid}].State.NotEqual[DEAD]} && ${Spawn[id ${npcid}].Distance}<100 && ${MobList[${tempvar},2]}!=-1 && ${MobList[${tempvar},2]}<${Macro.RunTime} && ${mastertarget}!=${npcid} && ${npccount}>1) { 
      /target id ${npcid} 
      /delay 2s ${Target.ID}==${npcid} 
      /if (${Target.ID}!=${npcid}) /goto :controlnext 
      | Try to check if it is aggro'd first 
      /assist 
      /delay 2s ${Target.ID}!=${npcid} 
      /if (${Target.ID}==${npcid}) { 
        /echo DBG ${Target.CleanName} doesn't appear to be aggro'd 
        /goto :controlnext 
      } 
      /target id ${npcid} 
      /delay 2s ${Target.ID}==${npcid} 
      /if (${Target.ID}!=${npcid}) /goto :controlnext 
      /echo DBG Casting ${SpellMez} on ${MobNames[${tempvar}]} 
      /varset retries 0 
      :mezmob 
      /if (${Verbose}) /gsay "Mezzing [[ %T ]]" 
    /if (${Target.PctHPs}<=${CombatAt} && ${Target.ID}==${TargetArray[4]}) { 
      /if (${Me.CurrentMana}<${Spell[${SpellMez}].Mana}) { 
         /echo Shid ! I don't have mana to Mez %T 
      } else { 
         /call cast ${SpellDebuff} gem3 6s 
      :Mez_Loop 
         /call cast ${SpellMez} gem8 6s 
         /if (${Macro.Return.Equal["CAST_INTERRUPTED"]}) /goto :Mez_Loop 
         /if (${Macro.Return.Equal["CAST_IMMUNE"]}) { 
            /if (${Verbose}) /gsay *** %T is IMMUNE to my Mez!            
            /varset MobList[${tempvar},2] -1 
            /goto :controlnext 
  
         } 
         /if (${Macro.Return.Equal["CAST_RESISTED"]}) { 
               /if (${Verbose}) /gsay *** %T RESISTED Mez! Trying again asap 
 		    :Bog_Loop 
		         /call cast ${SpellBoG} gem2 6s 
		         /if (${Macro.Return.Equal["CAST_INTERRUPTED"]}) /goto :Bog_Loop 
		         /if (${Macro.Return.Equal["CAST_RESISTED"]}) { 
		               /if (${Verbose}) /gsay *** %T RESISTED Boggle! Trying again asap 
		                /goto :Bog_Loop 
		            } 
		         /if (${Macro.Return.Equal["CAST_SUCCESS"]}) { 
		            /if (${Verbose}) /gsay *** %T is Boggled - attempting to mez again
		          } 
                /goto :Mez_Loop 
             } 
         /if (${Macro.Return.Equal["CAST_SUCCESS"]}) { 
            /if (${Verbose}) /gsay *** %T is Mezzed 
            /goto :controlnext 
          } 

      } 
   } 
/return 

      } else { 
        /varset MobList[${tempvar},2] ${Math.Calc[${Macro.RunTime}+${Spell[${MezSpell}].Duration.TotalSeconds}-8]} 
        /if (${Verbose}) /gsay "[[ %T ]] mezzed... dinner is served..." 
      } 
    } 
    :controlnext 
  /next tempvar 
/return 


Sub CheckMobInControlList(int npcid) 
  /call FindMobInControlList ${npcid} 
  /if (${Macro.Return}>0) /return 

  /target id ${npcid} 
  /delay 5 ${Target.ID}==${npcid} 
  /if (${Target.ID}!=${npcid}) { 
    /echo DBG Could not target ID ${npcid} 
    /return 
  } 
  /assist 
  /delay 5 ${Target.ID}!=${npcid} 
  /if (${Target.ID}==${npcid}) { 
    /declare listIdx int local 0 
    | Has this mob been found to be non-aggro before? 
    /call FindMobInNonAggroList ${npcid} 
    /varset listIdx ${Macro.Return} 
    /if (${listIdx}>0) { 
      | Update non-aggro count 
      /varset NonAggroList[${listIdx},2] ${Math.Calc[${NonAggroList[${listIdx},2]}+1]} 
      | How many times has it been tested? 
      /if (${NonAggroList[${listIdx},2]}>=${MobAggroChecks}) { 
        /echo DBG ${Target.CleanName} does not appear to be aggro'd, ignoring it 
        /alert add ${AlertList} id ${npcid} 
        /call ClearNonAggroListSlot ${listIdx} 
      } 
    } else { 
      | Add to non aggro list with a count of 1 
      /call AddMobToNonAggroList ${npcid} 
    } 
    /return 
  } 

  /call AddMobToControlList ${npcid} 
/return 

Sub ClearMobListSlot(int slot) 
  /varset MobList[${slot},1] 0 
  /varset MobList[${slot},2] 0 
  /varset MobNames[${slot}] 
/return 

Sub ClearNonAggroListSlot(int slot) 
  /varset NonAggroList[${slot},1] 0 
  /varset NonAggroList[${slot},2] 0 
/return 

Sub EmptyMobList 
  /declare tempvar int local 

  /for tempvar 1 to CONTROLMAX 
    /if (${MobList[${tempvar},1]}!=0) /echo DBG Removing [${MobList[${tempvar},1]}] ${MobNames[${tempvar}]} from crowd control list 
    /call ClearMobListSlot ${tempvar} 
    /if (${NonAggroList[${tempvar},1]}!=0) /echo DBG Removing [${NonAggroList[${tempvar},1]}] from non-aggro list 
    /call ClearNonAggroListSlot ${tempvar} 
  /next tempvar 
/return 

Sub FindMobInControlList(int npcid) 
  /declare listIdx int local 0 
  /declare tempvar int local 

  /for tempvar 1 to CONTROLMAX 
    /if (${MobList[${tempvar},1]}==${npcid}) { 
      /varset listIdx ${tempvar} 
      /goto :foundmob 
    } 
  /next tempvar 
  :foundmob 
/return ${listIdx} 

Sub FindMobInNonAggroList(int npcid) 
  /declare listIdx int local 0 
  /declare tempvar int local 

  /for tempvar 1 to CONTROLMAX 
    /if (${NonAggroList[${tempvar},1]}==${npcid}) { 
      /varset listIdx ${tempvar} 
      /goto :foundmob 
    } 
  /next tempvar 
  :foundmob 
/return ${listIdx} 

Sub AddMobToControlList(int npcid) 
  /declare listIdx int local 0 
  /declare tempvar int local 

  /call FindMobInNonAggroList ${npcid} 
  /if (${Macro.Return}>0) /call ClearNonAggroListSlot ${Macro.Return} 

  /call FindMobInControlList ${npcid} 
  /varset listIdx ${Macro.Return} 
  /if (${listIdx}>0) /goto :doneadding 

  /for tempvar 1 to CONTROLMAX 
    /if (${MobList[${tempvar},1]}==0) { 
      /varset listIdx ${tempvar} 
      /varset MobList[${tempvar},1] ${npcid} 
      /varset MobList[${tempvar},2] 0 
      /varset MobNames[${tempvar}] ${Spawn[id ${npcid}].CleanName} 
      /echo DBG Added [${npcid}] ${MobNames[${tempvar}]} to crowd control list 
      /goto :doneadding 
    } 
  /next tempvar 
  :doneadding 
/return ${listIdx} 

Sub AddMobToNonAggroList(int npcid) 
  /declare listIdx int local 0 
  /declare tempvar int local 

  /call FindMobInNonAggroList ${npcid} 
  /varset listIdx ${Macro.Return} 
  /if (${listIdx}>0) /goto :doneadding 

  /for tempvar 1 to CONTROLMAX 
    /if (${NonAggroList[${tempvar},1]}==0) { 
      /varset listIdx ${tempvar} 
      /varset NonAggroList[${tempvar},1] ${npcid} 
      /varset NonAggroList[${tempvar},2] 1 
      /echo DBG Added [${npcid}] to non-aggro list 
      /goto :doneadding 
    } 
  /next tempvar 
  :doneadding 
/return ${listIdx} 


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

Sub Combat 
   /if (${CombatOn} && !${MobTashed} && ${DoTash} && ${Target.ID}==${TargetArray[4]}) /call DeBuff 
   /if (${CombatOn} && !${MobSlowed} && ${DoSlow} && ${Target.ID}==${TargetArray[4]}) /call Slow  
   /if (${CombatOn} && !${MobCrippled} && ${DoCripple} && ${Target.ID}==${TargetArray[4]}) /call Cripple 
   /if (${CombatOn} && !${MobBoG} && ${DoBoG} && ${Target.ID}==${TargetArray[4]}) /call Bog 
   /if (${CombatOn} && !${PetOn} && ${Target.ID}==${TargetArray[4]}) { 
      /pet attack 
      /varset PetOn TRUE 
      /varset Engaged TRUE  
   } 

   |- Check for new events in chat etc etc... 
   /doevents 

   /if (${CombatOn} && ${DoNuke} && ${Me.PctMana}>=${NukeMana} && ${Target.PctHPs}<=${NukeAt}) { 
      /call cast ${SpellNuke} gem1 
   } 
   /if (${CombatOn} && ${DoRoot} && ${Me.PctMana}>=${RootMana} && ${Target.PctHPs}<=${RootAt}) { 
      /call cast "Ring of Immobilization" item 
      /varset MobRooted TRUE 
   } 

   |- Check for new events in chat etc etc... 
   /doevents 

|- EndCombat 

   /target ${TargetArray[3]} 
    
   /if (!${Target.Name.Equal[${TargetArray[3]}]} || !${Target.ID}) { 
      /echo ${TargetArray[1]} is dead 
      /varset MobRooted FALSE 
      /varset MobTashed FALSE 
      /varset MobSlowed FALSE 
      /varset MobCrippled FALSE 
      /varset PetOn FALSE 
      /varset MobBoG FALSE 
      /varset CombatOn FALSE 
      /varset Engaged FALSE    
      
      /varset TargetArray[1] NULL 
      /varset TargetArray[2] NULL 
      /varset TargetArray[3] NULL 
      /varset TargetArray[4] NULL 

  } 
/return 
  
| ############### Debuff 

Sub DeBuff 
:DeBuff_Loop 
   /if (${Target.PctHPs}<=${CombatAt} && ${Target.ID}==${TargetArray[4]}) { 
      /if (${Me.CurrentMana}<${Spell[${SpellDeBuff}].Mana}) { 
         /echo *** Shid ! I don't have mana to Tash %T 
      } else { 
         /call cast ${SpellDeBuff} gem3 6s 
         /if (${Macro.Return.Equal["CAST_INTERRUPTED"]}) /goto :DeBuff_Loop 
         /varset MobTashed TRUE 
      } 
   } 
/return 
  
| ############### Slowing 

Sub Slow 
   /if (${Target.PctHPs}<=${CombatAt} && ${Target.ID}==${TargetArray[4]}) { 
      /if (${Me.CurrentMana}<${Spell[${SpellSlow}].Mana}) { 
         /echo Shid ! I don't have mana to Tash %T 
      } else { 
      :Slow_Loop 
         /call cast ${SpellSlow} gem7 6s 
         /if (${Macro.Return.Equal["CAST_INTERRUPTED"]}) /goto :Slow_Loop 
         /if (${Macro.Return.Equal["CAST_IMMUNE"]}) { 
            /if (${Verbose}) /gsay *** %T is IMMUNE to my slow ! 
          
            /varset MobSlowed TRUE 
         } 
         /if (${Macro.Return.Equal["CAST_RESISTED"]}) { 
            /if (!${FastSlow}) { 
               /if (${Verbose}) /gsay *** %T RESISTED slow ! Trying again asap 
                /goto :Slow_Loop 
             } 
            /varset MobSlowed TRUE 
          } 
         /if (${Macro.Return.Equal["CAST_SUCCESS"]}) { 
            /if (${Verbose}) /gsay *** %T is SLOWED 
            /varset MobSlowed TRUE 
          } 

      } 
   } 
/return 

| ############### Crippling 

Sub Cripple 
   /if (${Target.PctHPs}<=${CombatAt} && ${Target.ID}==${TargetArray[4]}) { 
      /if (${Me.CurrentMana}<${Spell[${SpellCripple}].Mana}) { 
         /echo Shid ! I don't have mana to Tash %T 
      } else { 
      :Cripple_Loop 
         /call cast ${SpellCripple} gem6 6s 
         /if (${Macro.Return.Equal["CAST_INTERRUPTED"]}) /goto :Cripple_Loop 
         /if (${Macro.Return.Equal["CAST_IMMUNE"]}) { 
            /if (${Verbose}) /gsay *** %T is IMMUNE to my Cripple ! 
          
            /varset MobCrippled TRUE 
         } 
         /if (${Macro.Return.Equal["CAST_RESISTED"]}) { 
               /if (${Verbose}) /gsay *** %T RESISTED Cripple ! Trying again asap 
                /goto :Cripple_Loop 
          } 
         /if (${Macro.Return.Equal["CAST_SUCCESS"]}) { 
            /if (${Verbose}) /gsay *** %T is Crippled 
            /varset MobCrippled TRUE 
          } 

      } 
   } 
/return 

| ############## Boggle 

Sub Bog 
   /if (${Target.PctHPs}<=${CombatAt} && ${Target.ID}==${TargetArray[4]}) {  
      /if (${Me.CurrentMana}<${Spell[${SpellCripple}].Mana}) { 
         /echo Shid ! I don't have mana to Tash %T 
      } else { 
      :Bog_Loop 
         /call cast ${SpellBoG} gem2 6s 
         /if (${Macro.Return.Equal["CAST_INTERRUPTED"]}) /goto :Bog_Loop 
         /if (${Macro.Return.Equal["CAST_RESISTED"]}) { 
               /if (${Verbose}) /gsay *** %T RESISTED Boggle! Trying again asap 
                /goto :Bog_Loop 
            } 
         /if (${Macro.Return.Equal["CAST_SUCCESS"]}) { 
            /if (${Verbose}) /gsay *** %T is Boggled 
            /varset MobBoged TRUE 
          } 
   } 
/return 

Sub GetTarget 
   /target clear
   /assist ${M_Assist} 
   /delay 1s ${Target.ID}
   /if (${Target.Type.Equal[NPC]} && ${Target.Distance}<=${AssistAt} && ${Target.ID}!=${TargetArray[4]} && ${Target.PctHPs}<=${CombatAt}) { 
      /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 MobTashed FALSE 
      /varset MobSlowed FALSE 
      /varset MobCrippled FALSE 
      /varset MobBog FALSE 
      /varset PetOn FALSE 
      /varset MobDoTed FALSE 

      /varset AAExp ${Math.Calc[${Me.PctAAExp}-${AAExp}]} 
      /varset Exper ${Math.Calc[${Me.PctExp}-${Exper}]} 

      /echo EXP: ${Exper}:${Me.PctExp}% - AAXP: ${AAExp}:${Me.PctAAExp}% - ${Math.Calc[${Macro.RunTime}/60]} minutes 
      /popup EXP: ${Exper}:${Me.PctExp}% - AAXP: ${AAExp}:${Me.PctAAExp}% - ${Math.Calc[${Macro.RunTime}/60]} minutes 
      /varset Exper ${Me.PctExp} 
      /varset AAExp ${Me.PctAAExp} 
   } 
/return 

| ################### Buff the group with buffs from the SpellGrpBuff array 


Sub GrpBuffs 
   /declare i int local 1 
   /for i 1 to ${SpellGrpBuff.Size} 
      /doevents 
      /if (${Spell[${SpellGrpBuff[${i}]}].Mana} > ${Me.CurrentMana}) {
          /if (${Verbose}) /gsay Not enough mana to rebuff!!
          /return 
      }
      /if ( !${Me.Buff[${SpellGrpBuff[${i}]}].ID} ) { 
         /target pc ${M_Assist} 
         /delay 3 
         /echo *** Hang on ! Rebuffing ${SpellGrpBuff[${i}]} 
         /call cast ${SpellGrpBuff[${i}]} gem5 10s 
      } 
   /next i 
/return 

| ################## Summon pet and buff with spells from SpellPetBuff array 

Sub Pet 
   /if (!${Me.Pet.ID} && ${SummonPet} && ${Spell[${SpellPet}].Mana}<=${Me.CurrentMana}) { 
      /call cast ${SpellPet} gem5 25s 
      /echo Buff ${Me.Pet.ID} with ${SpellPet} 
   } 
   /declare i int local 
   /for i 1 to ${SpellPetBuff.Size} 
   /if (!${Me.PetBuff[${SpellPetBuff[${i}]}]} && ${Spell[${SpellPetBuff[${i}]}].Mana}<=${Me.CurrentMana}) { 
      /pet target 
      /delay 3 
      /call cast ${SpellPetBuff[${i}]} gem5 9s 
      /doevents          
    } 
   /next i 
/return 

| ################# Check Mana 

Sub GatherMana 
   /if (${Gather Mana} && ${Me.AltAbilityReady[57]} && ${Me.PctMana}<=5) /call Gather Mana 

/return 

| ################# No Components 

Sub NoDaggers 

  /echo I have No Tiny Daggers to Summon a Pet 
  /popup Out of components! 
  /squelch /endmac 

/return 
  
Sub NoDots 

  /echo I have no Peridots to Rune 
  /gsay I have no Peridots 
  /squelch /endmac 

/return 

| ##################  ENRAGE ON 

Sub Event_Enrageon 
    /if (${PetOn}) { 
       /echo Mob is ENRAGED! 
       /pet back off 
    } 
/return 

| ##################  ENRAGE OFF 

Sub Event_Enrageoff 
    /if (${PetOn}) { 
       /echo Mob is no longer Enraged! 
       /pet attack  
    } 
/return 

| ##################  Group Invite 

Sub Event_Invited 
   /invite 
/return 

| ################## I Died 

Sub Event_ImDead 
   /echo Bummer ! 
   :Zone_Loop 
      
   /delay 5s 
   /consent group 
   /delay 5 
   /gsay Im ready to get rez. 
   /gsay I have consented group.  
   /delay 20 
   /call MemSpells 
   /if (${Me.State.Equal[Stand]}) /sit 

| We do some short meditate before we start again. 

   :Meditate 
      /delay 1s 
      /if (${Me.CurrentMana} < 300) /goto :Meditate 
   /return 


| ################# 
| ################# Tells n Hells 
| ################# 

Sub Event_Chat(string ChatType,string ChatSender,string ChatText) 

      /if (!${ChatType.Equal[GROUP]}) && (!${ChatType.Equal[TELL]}) /return 
}
        
| ################# Mob Requests      

      /if (${ChatText.Equal[slow]}) { 
         /assist ${ChatSender} 
         /if (${Target.Type.Equal[NPC]} && ${Target.Distance}<=100) { 
            /call cast ${SpellDebuff} gem3 6s 
         :SSlow_Loop 
            /call cast ${SpellSlow} gem7 6s 
            /if (${Macro.Return.Equal["CAST_INTERRUPTED"]}) /goto :SSlow_Loop {
            /if (${Macro.Return.Equal["CAST_IMMUNE"]}) { 
                /if (${Verbose}) /gsay *** %T is IMMUNE to my Slow!            
                /return 
            } 
            /if (${Macro.Return.Equal["CAST_RESISTED"]}) { 
                /if (${Verbose}) /gsay *** %T RESISTED Slow ! Trying again asap 
                /goto :SSlow_Loop 
            } 
            /if (${Macro.Return.Equal["CAST_SUCCESS"]}) { 
                /if (${Verbose}) /gsay *** %T is Slowed 
                /return 
            } 
         } 


      /if (${ChatText.Equal[Pacify]}) { 
         /assist ${ChatSender} 
         /if (${Target.Type.Equal[NPC]} && ${Target.Distance}<=100) { 
         :Pacify_Loop 
            /call cast ${SpellPac} gem5 6s 
            /if (${Macro.Return.Equal["CAST_INTERRUPTED"]}) /goto :Pacify_Loop 
            /if (${Macro.Return.Equal["CAST_IMMUNE"]}) { 
                /if (${Verbose}) /gsay *** %T is IMMUNE to my Pacify !            
                /return 
            } 
            /if (${Macro.Return.Equal["CAST_RESISTED"]}) { 
                /if (${Verbose}) /gsay *** %T RESISTED Pacified ! Trying again asap 
                /goto :Pacify_Loop 
            } 
            /if (${Macro.Return.Equal["CAST_SUCCESS"]}) { 
                /if (${Verbose}) /gsay *** %T is Pacified 
                /return 
            } 
         } 

     /if (${ChatText.Equal[cripple]}) { 
         /assist ${ChatSender} 
         /if (${Target.Type.Equal[NPC]} && ${Target.Distance}<=100) { 
            /call cast ${SpellDebuff} gem3 6s 
            /call cast ${SpellCripple} gem6 6s 
            /tell ${ChatSender} %T is ${SpellDeBuff} and crippled with ${SpellCripple} 
            } 
      /return 
      } 

      /if (${ChatText.Equal[root]}) { 
         /assist ${ChatSender} 
         /if (${Target.Type.Equal[NPC]} && ${Target.Distance}<=100) { 
            /call cast ${SpellDebuff} gem3 6s              
            /call cast "Ring of Immobilization" item 
            /tell ${ChatSender} %T is Tashed and Rooted with Immobilization 
            } 
      /return 
      } 


      /if (${ChatText.Equal[nuke]}) { 
         /assist ${ChatSender} 
         /if (${Target.Type.Equal[NPC]} && ${Target.Distance}<=100) { 
            /call cast ${SpellNuke} gem1  
            } 
      /return 
      } 
        
      /if (${ChatText.Equal[dot]}) { 
         /assist ${ChatSender} 
         /if (${Target.Type.Equal[NPC]} && ${Target.Distance}<=100) { 
            /call cast ${SpellDot} gem2 5s 
            } 
      /return 
      } 

     /if (${ChatText.Equal[Mez]}) { 
         /assist ${ChatSender} 
         /if (${Target.Type.Equal[NPC]} && ${Target.Distance}<=100) { 
            /call cast ${SpellDebuff} gem3 6s 
         :SMez_Loop 
            /call cast ${SpellMez} gem5 6s 
            /if (${Macro.Return.Equal["CAST_INTERRUPTED"]}) /goto :SMez_Loop 
            /if (${Macro.Return.Equal["CAST_IMMUNE"]}) { 
                /if (${Verbose}) /gsay *** %T is IMMUNE to my Mez !            
                /return 
            } 
            /if (${Macro.Return.Equal["CAST_RESISTED"]}) { 
                /if (${Verbose}) /gsay *** %T RESISTED Mez ! Trying again asap 
                /goto :SMez_Loop 
            } 
            /if (${Macro.Return.Equal["CAST_SUCCESS"]}) { 
                /if (${Verbose}) /gsay *** %T is Mezzed 
                /return 
            } 
        } 
  
      /if (${Engaged}) /return    

| ################# Buff Requests 

      /if (${ChatText.Equal[NDT]}) { 
         /target pc ${ChatSender} 
         /if (${Target.Type.Equal[PC]} && ${Target.Distance}<=100) { 
             /tell ${ChatSender} ${SpellATK} is incomming to you ${ChatSender}!!! 
             /call cast ${SpellATK} gem4 4s 
        }    
         /return 
      }  
    
      /if (${ChatText.Equal[c6]}) { 
         /target pc ${ChatSender} 
         /if (${Target.Type.Equal[PC]} && ${Target.Distance}<=100) { 
             /tell ${ChatSender} ${Spellc6} is incomming to you ${ChatSender}!!! 
             /call cast ${Spellc6} gem5 5s 
        }    
         /return 
      }  

      /if (${ChatText.Equal[haste]}) { 
         /target pc ${ChatSender} 
         /if (${Target.Type.Equal[PC]} && ${Target.Distance}<=100) { 
             /tell ${ChatSender} ${SpellHASTE} is incomming to you ${ChatSender}!!! 
             /call cast ${SpellHASTE} gem5 5s 
        }    
         /return 
      }  

      /if (${ChatText.Equal[invis]}) { 
         /target pc ${ChatSender} 
         /if (${Target.Type.Equal[PC]} && ${Target.Distance}<=100) { 
             /tell ${ChatSender} ${SpellINV} is incomming to you ${ChatSender}!!! 
             /call cast ${SpellINV} gem5 5s 
        }    
         /return 
      }  

      /if (${ChatText.Equal[ITU]}) { 
         /target pc ${ChatSender} 
         /if (${Target.Type.Equal[PC]} && ${Target.Distance}<=100) { 
             /tell ${ChatSender} ${SpellITU} is incomming to you ${ChatSender}!!! 
             /call cast ${SpellITU} gem5 5s 
        }    
         /return 
      }  

      /if (${ChatText.Equal[Rune]}) { 
         /target pc ${ChatSender} 
         /if (${Target.Type.Equal[PC]} && ${Target.Distance}<=100) { 
             /tell ${ChatSender} ${SpellRune} is incomming to you ${ChatSender}!!! 
             /call cast ${SpellRune} gem5 10s 
             /doevents 
        }    
         /return 
      }  

      /if (${ChatText.Equal[lev]}) { 
         /target pc ${ChatSender} 
         /if (${Target.Type.Equal[PC]} && ${Target.Distance}<=100) { 
             /tell ${ChatSender} ${SpellLEV} is incomming to you ${ChatSender}!!! 
             /call cast ${SpellLEV} gem5 5s 
        }    
         /return 
      }  

      /if (${ChatText.Equal[see]}) { 
         /target pc ${ChatSender} 
         /if (${Target.Type.Equal[PC]} && ${Target.Distance}<=100) { 
             /tell ${ChatSender} ${SpellSEE} is incomming to you ${ChatSender}!!! 
             /call cast ${SpellSEE} gem5 5s 
        }    
         /return 
      } 

      /if (${ChatText.Equal[MR]}) { 
         /target pc ${ChatSender} 
         /if (${Target.Type.Equal[PC]} && ${Target.Distance}<=100) { 
             /tell ${ChatSender} ${SpellMR} is incomming to you ${ChatSender}!!! 
             /call cast ${SpellMR} gem5 4s 
        }    
         /return 
      }  

      /if (${ChatText.Equal[Cha]}) { 
         /target pc ${ChatSender} 
         /if (${Target.Type.Equal[PC]} && ${Target.Distance}<=100) { 
             /tell ${ChatSender} ${SpellCha} is incomming to you ${ChatSender}!!! 
             /call cast ${SpellCha} gem5 6s 
        }    
         /return 
      }  


| ################# Follow me 

   /if (${ChatText.Equal[Follow me]}) { 
      /delay 5 
      /if (!${Spawn[${Sender}].ID}) { 
         /e ${Sender} is not in zone for me to follow! 
         /return 
      } 
      /varset follname ${Sender} 
      /varset following 1 
      :targetfoll 
      /target pc ${follname} 
      /delay 1s ${Target.Name.Equal[${follname}]} 
      /if (${Target.Name.Equal[${follname}]}) { 
         /goto :Loop 
      } else /goto :targetfoll 
      :Loop 
      /face fast 
      /if (${Target.Distance}>10) /keypress forward hold 
      /if (${Target.Distance}<9) /keypress back 
      /if (!${Target.ID}) /varset following 0 
      /call CheckEvents 
      /if ((${Target.Name.Equal[${follname}]})&&(${following}>0)) { 
         /goto :Loop 
      } else { 
         /keypress forward 
         /keypress back 
      } 
   } 

| ################# Stop Following me 

 /if (${ChatText.Equal[End follow]} || ${ChatText.Equal[stop]}) { 
    /varset following 0 
    /keypress forward 
    /keypress back 
    /timed 50 /face pc ${follname} 
    /tell ${ChatSender} I Stopped following you!!! 
    /return  
 } 

| ################# Single Rebuff 

/if (${ChatText.Equal[buff me]}) { 
   /echo Request for Single Buff 
   /declare i int local 1 
   /for i 1 to ${SpellSingleBuff.Size} 
   /if (${Spell[${SpellSingleBuff[${i}]}].Mana} > ${Me.CurrentMana}) { 
      /tell ${ChatSender} ${ChatSender} Sorry I am getting LOM        
       :Hold_Single_Rebuff 
          /if (${Spell[${SpellSingleBuff[${i}]}].Mana} > ${Me.CurrentMana}) { 
             /goto :Hold_Single_Rebuff              
           } 
    } 
   /target pc ${ChatSender} 
   /delay 3 
   /echo *** Hang on ! Buffing ${SpellSingleBuff[${i}]} 
   /tell ${ChatSender} Buffing ${SpellSingleBuff[${i}]} now... 
   /call cast ${SpellSingleBuff[${i}]} gem5 5s      
   /next i 
   /return 
} 

| ################# Single Rebuff other 

 /if (${ChatText.Equal[buff]}) { 
    /echo Request for Single Buff other 
    /assist ${ChatSender} 
    /declare i int local 1 
    /for i 1 to ${SpellSingleBuff.Size} 
    /if (${Spell[${SpellSingleBuff[${i}]}].Mana} > ${Me.CurrentMana}) { 
       /tell ${ChatSender} ${ChatSender} Sorry I am getting LOM        
       :Hold_Single_Rebuff 
          /if (${Spell[${SpellSingleBuff[${i}]}].Mana} > ${Me.CurrentMana}) { 
             /goto :Hold_Single_Rebuff              
           } 
    } 
    /delay 3 
    /echo *** Hang on ! Rebuffing ${SpellSingleBuff[${i}]} 
    /tell ${ChatSender} Buffing ${SpellSingleBuff[${i}]} now... 
    /call cast ${SpellSingleBuff[${i}]} gem5 7s      
    /next i 
    /return 
 } 

| ################# Group Rebuff other group 

 /if (${ChatText.Equal[buff them]}) { 
    /assist ${ChatSender} 
    /declare i int local 1 
    /for i 1 to ${SpellGrpBuff.Size}        
    /if (${Spell[${SpellGrpBuff[${i}]}].Mana} > ${Me.CurrentMana}) { 
       /tell ${ChatSender} ${ChatSender}, Sorry I am getting LOM                  
       :Hold_Group_Rebuff 
          /if (${Spell[${SpellGrpBuff[${i}]}].Mana} > ${Me.CurrentMana}) { 
          /goto :Hold_Group_Rebuff              
          } 
    } 
    /delay 3 
    /echo *** Hang on ! Rebuffing ${SpellGrpBuff[${i}]} 
    /tell ${ChatSender} Buffing ${SpellGrpBuff[${i}]} now... 
    /call cast ${SpellGrpBuff[${i}]} gem5 7s      
    /next i 
    /return 
 } 


| ################# Other Pet Buffing 

 /if (${ChatText.Equal[buff pet]}) { 
    /echo Request for Pet Buffs 
    /target id ${Spawn[pc ${ChatSender}].Pet.ID} 
    /delay 3 
    /tell ${ChatSender} Targetting your pet, %T for buffs... 
    /declare i int local 1 
    /for i 1 to ${SpellPetBuffo.Size} 
    /if (${Spell[${SpellPetBuffo[${i}]}].Mana} > ${Me.CurrentMana}) { 
       /tell ${ChatSender} ${ChatSender} Sorry I am getting LOM 
       :Hold_Pet_Rebuff 
          /if (${Spell[${SpellPetBuffo[${i}]}].Mana} > ${Me.CurrentMana}) { 
             /goto :Hold_Pet_Rebuff 
          }        
    } 
    /delay 3 
    /echo *** Hang on ! Rebuffing ${SpellPetBuffo[${i}]} 
    /tell ${ChatSender} buffing ${SpellPetBuffo[${i}]} now... 
    /call cast ${SpellPetBuffo[${i}]} gem5 5s      
    /next i 
    /return 
 } 

| ################### Go Home 

 /if (${ChatText.Equal[gate now]} && ${ChatType.Equal[TELL]}) { 
    /call cast ${SpellGATE} gem9  
    /return 
    } 

 /if (${ChatType.Equal[TELL]}) { 
    /1 [${ChatSender}]:${ChatText} 
    /vtell ${ChatController} 001 
    /return 
    } 
/return 

Sub event_TAGME(string Line,string Tagee)

/tar ${Tagee}
/delay 1s
/warp target
/delay 2s
/keypress back hold
/delay .4s
/keypress forward
/delay 2s
/echo I have just tagged ${Tagee}
/delay 2s
/return

Sub event_CAMPALL(string Line,string Tagee)

/sit
/delay 5s
/camp
/end

Sub event_SUCCORALL(string Line,string Tagee)

/tar ${Tagee}
/delay 1s
/warp succor
/delay 2s
/keypress back hold
/delay .4s
/keypress forward
/delay 2s
/echo I have just succored
/delay 2s
/return
 
real enc mac i needed help with bah=)

sorry guys this is the enc mac i needed help with and it just wont slow or nuke or stun atm

Code:
| autoenc.mac 
| By Rusty~ 
| Last update 10/27/2005 
| 
| /macro autoenc [ma name][sa name][radius #][minhp #] 
| 
| Description: 
|   Will assist the person set as main assist. If the main assist dies, it will assist the person 
|   set as secondary assist if there is one. Once a target is aquired, and is varified as being aggro 
|   it will then wait till the mob is engaged by the tank. Then it will wait till mob is under the spcified hp, 
|   or the specified time has expired since the tank has engaged, and it will tash, slow, and nuke, if enabled. 
|   Will mez any adds within the set radius, and debuff them if it's enabled. 
|   This will also keep self buffs up, and buff people on request (with the spells specified in ini). 
| 
| 
|   After running the macro for the first time, you should open the ini file generated (Auto_Yourname.ini) 
|   Most of the options are self explanatory 
|   Here's an example how the ini based buffs work: 
| 
|      BuffList1=c6 
|      BuffName1=clairvoyance 
|      BuffType1=gem4 
| 
|   BuffList is a list of words (or phrases) that will trigger the buff, separated by commas 
|   BuffName is the name of the spell or item 
|   BuffType is either item, gem1-9, or alt, for items, spells, or aa abilities respectively 
| 
|   BuffName can also be a "shortcut" name. Shortcut names will cast different buffs depending on certain 
|   circumstances. For example, putting "c6" as the BuffName, will cast Voice of Clairvoyance if it's up, 
|   or else it will cast Clairvoyance. Following is a list of shortcut buffs and what they do: 
| 
|     c6      - Will cast Voice of Clairvoyance if you have no C6 on and are in a group, else will cast Clairvoyance 
|     c5      - Voice of Quellious 
|     c4      - Will use C4 pants if you have them, else will cast Tranquility 
|     c3      - Will use C3 wand if you have it, else will cast Koadic's Endless Intellect 
|     c2      - Clairty II 
|     c1      - Will cast Rod of Infinite thought if you have, else will cast Clarity 
|     haste   - If you have group haste memmed (spell name specified in ini), it will cast group haste 
|               else it will cast single haste. If you are under 60% mana and have elemental legs 
|               it will cast them instead of single or group haste spells 
|     shissar - Will cast epic 1.0 
|      
| 
| 
|   For each self buff and clicky buff, there's a place to put all the buffs that don't stack with it: 
| 
|      Clicky1=Velium Coldain Insignia Ring 
|      ClickyNoStack1=Call of Earth,Call of the Rathe,Guard of the Earth,Illusion Fire Elemental 
| 
|   *note* To mem spells after death, save a spellset, and put the name of it in your ini under SpellSet 
| 
| 
|----------------------------------------------------------------------------------------------------------+ 
|  slash commands:                                                                                         | 
|----------------------------------------------------------------------------------------------------------+ 
|  /setma name                             - sets main assist                                              | 
|  /setsa name                             - sets secondary assist                                         | 
|  /buff #                                 - mode 1 buffs all the time, self buff and tells                | 
|                                          - mode 2 does self buffs and tells when you have no target      | 
|                                          - mode 3 does self buffs only, all the time                     | 
|                                          - mode 4 does self buffs only, only when you have no target     | 
|  /debuff on|off                          - turns auto debuffing on or off                                | 
|  /mez on|off                             - turns auto mezzing on or off                                  | 
|  /mount on|off                           - turns auto mounting on or off                                 | 
|  /nukedelay #                            - sets the minimum amount of deciseconds between nukes          | 
|  /engagedelay #                          - amount of deciseconds before you start nuking mob             | 
|  /anchor #                               - sets the leash length when using an anchor                    | 
|  /minhp #                                - sets the minimum hp % that you'll begin nuking at             | 
|  /cleanup on|off                         - turns on auto looting of any droppable loot                   | 
|  /checknamed on|off                      - turns alerts on for named in your current zone                | 
|  /runehp #                               - sets the health % at which you'll cast your rune item or spell| 
|  /nukemode 0, 1, 2                       - mode 0 turns nukes off completely                             | 
|                                          - mode 1 uses robe if enabled, and slows nukes if low mana      | 
|                                          - mode 2 chain nukes, with only delay being the set /nukedelay  | 
|  /manarobe mode #|min #|max #            - mode 1 uses manrobe all the time                              | 
|                                          - mode 2 uses your set % to start robing                        | 
|  /radius #                               - sets the distance at which you'll engage the main assist's    | 
|                                            target                                                        | 
|----------------------------------------------------------------------------------------------------------+ 

#include spell_routines.inc 
#include gen_routines.inc 
#include move.inc 
|#include irc.inc
|#include givecrystals.inc
#define DEBUG_1 "/squelch /echo "

#turbo 40 

#chat group 
#chat tell 
#chat chat 
#chat say 

#event AutoStun "[MQ2] AutoStun #1#" 
#event Gate "|${Target.DisplayName}| begins to cast the gate spell#*#" 
#event Mez "[MQ2] mez" 
#event RageOff "#*#is no longer enraged#*#" 
#event RageOn "#*#has become ENRAGED#*#" 

Sub Main 
   /call GeneralDeclares 
   /declare MasterList string outer "MASTER"
   /declare MasterOnly outer TRUE
|# Calling IRC Declares and joining channel...
|   /call IRCDeclares

   /call DeclareIniVar mainAssist      string Settings
   /call DeclareIniVar secondAssist    string Settings 
   /call DeclareIniVar privateChannel  string Settings 
   /call DeclareIniVar maxMezLevel     int    Settings 73
   /call DeclareIniVar mezzImmuneList  string Settings
   /call DeclareIniVar maxAEMezLevel   int    Settings 70
   /call DeclareIniVar maxPBAEMezLevel int    Settings 65 
   /call DeclareIniVar minRadius       int    Settings 150 /radius 
   /call DeclareIniVar engageDelay     int    Settings 55 /engagedelay 
   /call DeclareIniVar minHP           int    Settings 85 /minhp 
   /call DeclareIniVar autoBuff        int    Settings 1 /buff 
   /call DeclareIniVar useMount        int    Settings 0 /mount 
   /call DeclareIniVar useMez          int    Settings 1 /mez 
   /call DeclareIniVar useDebuff       int    Settings 1 /debuff
   /call DeclareIniVar useTashOnly     int    Settings 0 /tashonly
   /call DeclareIniVar nukeMode        int    Settings 1 /nuke 
   /call DeclareIniVar useCharm        int    Settings 0 /charm 
   /call DeclareIniVar useTashFocus    int    Settings 0 /tash 
   /call DeclareIniVar useDPS          int    Settings 0 /dps 
   /call DeclareIniVar hasteGroup      int    Settings 0 /haste 
   /call DeclareIniVar channelAnnounce int    Settings 1 
   /call DeclareIniVar noInterrupt     int    Settings 0 
   /call DeclareIniVar useManaStone    int    Settings 0 /manastone 
   /call DeclareIniVar checkNamed      int    Settings 0 /checknamed 
   /call DeclareIniVar noInvis         int    Settings 1 
   /call DeclareIniVar useManaRobe     int    Settings 0
   /call DeclareIniVar manaRobeMode    int    Settings 1 
   /call DeclareIniVar manaRobeMinMana int    Settings 70 
   /call DeclareIniVar manaRobeMaxMana int    Settings 90 
   /call DeclareIniVar nukeMana        int    Settings 50 /nukemana 
   /call DeclareIniVar nukeDelay       int    Settings 0 /nukedelay 
   /call DeclareIniVar nukeMode        int    Settings 1 /nukemode 
   /call DeclareIniVar ignoreList      string Settings 
   /call DeclareIniVar runeHP          int    Settings 70 
   /call DeclareIniVar cleanUp         int    Settings 0 /cleanup 
   /call DeclareIniVar spellSet        string Settings "spells" 
   /call DeclareIniVar mezDuration     string Settings 500 
   /call DeclareIniVar tashDuration    string Settings 14m 
   /call DeclareIniVar slowDuration    string Settings 2100 
   /call DeclareIniVar autoAnnounce    string Settings 1    
   /call DeclareIniVar announceTells   string Settings 0 /announcetells 
   /call DeclareIniVar rodBitch        string Settings 
   /call DeclareIniVar noKnockBack     string Settings 0 /usezoom 
   /call DeclareIniVar usePet          int    Settings 1 /companion 

   /call DeclareIniVar rootSpell string Spells "Greater Fetter" 
   /call DeclareIniVar stunSpell string Spells "Color Slant"
   /call DeclareIniVar nuke1 string Spells "Psychosis" 
   /call DeclareIniVar nuke2 string Spells "Insanity"
   /call DeclareIniVar mezSpell string Spells "Euphoria" 
   /call DeclareIniVar mezGem int Spells "1"
   /call DeclareIniVar tashSpell string Spells "Howl of Tashan" 
   /call DeclareIniVar slowSpell string Spells "Forlorn Deeds" 
   /call DeclareIniVar slowType string Spells "item" 
   /call DeclareIniVar charmSpell string Spells "Compel" 
   /call DeclareIniVar aeMezSpell string Spells "Word of Felicity" 
   /call DeclareIniVar pbaeMezSpell string Spells "Word of Morell"
   /call DeclareIniVar shielding string spells "Mystic Shield" 
   /call DeclareIniVar singleHasteSpell string Spells "Speed of Salik" 
   /call DeclareIniVar groupHasteSpell string Spells "Vallon's Quickening" 
   /call DeclareIniVar selfRune string Spells "Ethereal Rune" 
   /call DeclareIniVar petSpell string Spells "Salik's Animation" 
   /call DeclareIniVar selfBuff1 string Spells " " 
   /call DeclareIniVar selfBuffNoStack1 string Spells " " 
   /call DeclareIniVar selfBuff2 string Spells " " 
   /call DeclareIniVar selfBuffNoStack2 string Spells " " 
   /call DeclareIniVar selfBuff3 string Spells " " 
   /call DeclareIniVar selfBuffNoStack3 string Spells " " 
   /call DeclareIniVar selfBuff4 string Spells " " 
   /call DeclareIniVar selfBuffNoStack4 string Spells " " 
   /call DeclareIniVar selfBuff5 string Spells " " 
   /call DeclareIniVar selfBuffNoStack5 string Spells " " 
   /call DeclareIniVar buffList1 string Spells "c6,crack,clarity,c5,c" 
   /call DeclareIniVar buffName1 string Spells "c6" 
   /call DeclareIniVar buffType1 string Spells "gem8" 
   /call DeclareIniVar buffList2 string Spells "haste,sov,salik,speed,pants" 
   /call DeclareIniVar buffName2 string Spells "haste" 
   /call DeclareIniVar buffType2 string Spells "gem8" 
   /call DeclareIniVar buffList3 string Spells " " 
   /call DeclareIniVar buffName3 string Spells " " 
   /call DeclareIniVar buffType3 string Spells " " 
   /call DeclareIniVar buffList4 string Spells "tranq,c4" 
   /call DeclareIniVar buffName4 string Spells "Tranquility" 
   /call DeclareIniVar buffType4 string Spells "gem8" 
   /call DeclareIniVar buffList5 string Spells "c3,kei,c3" 
   /call DeclareIniVar buffName5 string Spells "koadic's endless intellect" 
   /call DeclareIniVar buffType5 string Spells "gem8" 

   /call DeclareIniVar hpRobe string Items "${InvSlot[chest].Item.Name}" 
   /call DeclareIniVar clicky1 string Items " " 
   /call DeclareIniVar clickyNoStack1 string Items " " 
   /call DeclareIniVar clicky2 string Items " " 
   /call DeclareIniVar clickyNoStack2 string Items " " 
   /call DeclareIniVar clicky3 string Items " " 
   /call DeclareIniVar clickyNoStack3 string Items " " 
   /call DeclareIniVar clicky4 string Items " " 
   /call DeclareIniVar clickyNoStack4 string Items " " 
   /call DeclareIniVar clicky5 string Items " " 
   /call DeclareIniVar clickyNoStack5 string Items " " 
   /call DeclareIniVar useFood int Items 1 
   /call DeclareIniVar statFood string Items " " 
   /call DeclareIniVar food1 string Items " " 
   /call DeclareIniVar food2 string Items " " 
   /call DeclareIniVar food3 string Items " " 
   /call DeclareIniVar food4 string Items " " 
   /call DeclareIniVar food5 string Items " " 
   /call DeclareIniVar meleeWep string Items " " 
   /call DeclareIniVar invisItem string Items " " 
   /call DeclareIniVar dispellItem string Items " " 
   /call DeclareIniVar tashFocusItem string Items " " 
   /call DeclareIniVar normalMainhand string Items "${InvSlot[mainhand].Item.Name}" 

   /squelch /custombind add ma 
   /squelch /custombind add sa 
   /squelch /alias /anchor /echo SetAnchor 
   /squelch /alias /manarobe /echo Mana Robe 
   /squelch /alias /setma /custombind set ma /assist 
   /squelch /alias /setsa /custombind set sa /assist 
    
   /declare  HomeX             int    outer ${Me.X}
   /declare  HomeY             int    outer ${Me.Y}
   /declare  TetheredToHome           outer TRUE
   /declare i int local 
   /declare j int local 
   /declare oldTarget int local 
   /declare Following outer FALSE
   /declare tempTimer timer local 0 
   /varset castSub CheckForAdds 
:check_params 
   /if ( ${Defined[Param${i}]} ) { 
      /if ( ${Param${i}.Equal[ma]} ) { 
         /varcalc i ${i}+1 
          /call SetIniVar mainAssist Settings "${Param${i}}" 
      } else /if ( ${Param${i}.Equal[sa]} ) { 
         /varcalc i ${i}+1 
         /call SetIniVar secondAssist Settings "${Param${i}}" 
      } else /if ( ${Param${i}.Equal[radius]} ) { 
         /varcalc i ${i}+1 
         /call SetIniVar minRadius Settings "${Param${i}}" 
      } else /if ( ${Param${i}.Equal[minhp]} ) { 
         /varcalc i ${i}+1 
         /call SetIniVar minHP Settings "${Param${i}}" 
      } else /if ( ${Param${i}.Equal[buff]} ) { 
         /call SetIniVar autoBuff Settings 1 
      } else /if ( ${Param${i}.Equal[nobuff]} ) { 
         /call SetIniVar autoBuff Settings 0 
      } else /if ( ${Param${i}.Equal[nuke]} ) { 
         /call SetIniVar nukeMode Settings 1 
      } else /if ( ${Param${i}.Equal[nonuke]} ) { 
         /call SetIniVar nukeMode Settings 0 
      } else /if ( ${Param${i}.Equal[mez]} ) { 
         /call SetIniVar useMez Settings 1 
      } else /if ( ${Param${i}.Equal[nomez]} ) { 
         /call SetIniVar useMez Settings 0 
      } else /if ( ${Param${i}.Equal[debuff]} ) { 
         /call SetIniVar useDebuff Settings 1 
      } else /if ( ${Param${i}.Equal[nodebuff]} ) { 
         /call SetIniVar useDebuff Settings 0 
      } 
      /varcalc i ${i}+1 
      /goto :check_params 
   }    
   /if ( !${Me.Gem[${mezSpell}]} ) { 
      /if ( ${Me.Gem[bliss]} ) { 
         /call SetIniVar mezSpell Spells Bliss 
      } else /if ( ${Me.Gem[sleep]} ) { 
         /call SetIniVar mezSpell Spells Sleep 
      } else /if ( ${Me.Gem[apathy]} ) { 
         /call SetIniVar mezSpell Spells Apathy 
      } else /if ( ${Me.Gem[glamour of kintaz]} ) { 
         /call SetIniVar mezSpell Spells "Glamour of Kintaz" 
      } else /if ( ${Me.Gem[felicity]} ) { 
         /call SetIniVar mezSpell Spells Felicity 
      } else /if ( ${Me.Gem[euphoria]} ) { 
         /call SetIniVar mezSpell Spells Euphoria 
      } 
   } 
   /if ( !${InvSlot[chest].Item.Name.Equal[mana robe]} ) /call SetIniVar hpRobe Items "${InvSlot[chest].Item.Name}" 
   /call SwapStatFood 1 
   /squelch /alert clear 6 
   /if ( ${autoAnnounce} ) /announce on 
   /echo AutoEnc Mode Activated 
   /1 Teh Mighty Enchanter Is Here! 
   /if ( ${nukeMode} || ${useDebuff} || ${useMez} ) { 
      /echo Main Assist: ${mainAssist} 
      /if ( ${Bool[${secondAssist}]} ) /echo Secondary Assist: ${secondAssist} (if ${mainAssist} dies) 
   } 
   /if ( ${nukeMode} ) /echo Nuke Mode: ${nukeMode} 
   /if ( ${useDebuff} ) /echo Auto Debuffs Enabled 
   /if ( ${useMez} ) { 
      /echo Auto Mez adds within a radius of ${minRadius} 
      /if ( !${Me.Gem[${mezSpell}]} ) /memspell 7 "${mezSpell}" 
   } 
   /if ( ${autoBuff} ) /echo AutoBuff Mode: ${autoBuff} 
   /if ( ${useMount} ) /echo Mount is enabled. 
   /if ( ${manaRobeMode} ) /echo ManaRobe Mode: ${manaRobeMode} 
  :wait_for_target 
   /if ( ${nukeMode} || ${useDebuff} || ${useMez} ) /echo Waiting for target... 
   /varset newAdds 0 
   /varset validTarget 0 
  :wait_for_target2 
   /if ( ${Spawn[pc ${secondAssist}].ID} && ( !${Spawn[pc ${mainAssist}].ID} || ${Spawn[corpse ${mainAssist} radius ${minRadius}].ID} ) ) { 
      /varset mainTank ${secondAssist} 
   } else { 
      /varset mainTank ${mainAssist} 
   } 
   /if ( !${Corpse.Open} && ${Spawn[${mainAssist}].NearestSpawn[npc radius ${Math.Calc[${minRadius}*2]}].ID} && ( ${nukeMode} || ${useDebuff} || ${useMez} ) ) { 
      /if ( ${Me.Casting.ID} ) /call WaitCast 
      /assist ${mainTank} 
      /call ManaRobe 
      /varset oldTarget ${Target.ID} 
      /varset tempTimer 5 
      /call CheckRune 100 
   :wait_for_assist1 
      /call CheckTarget 
      /if ( ${tempTimer} && !${validTarget} ) /goto :wait_for_assist1 
   } 
   /call CheckTarget 
   /if ( !${validTarget} || ( !${nukeMode} && !${useDebuff} && !${useMez} ) ) { 
      /doevents 
      /call CheckBuffs 
      /call CheckPet 
      /call CheckRune ${runeHP} 
      /if ( ${useAnchor} ) /call CheckLoc 
      /call ManaRobe 
      /goto :wait_for_target2 
   } 
   /echo Target Aquired >> ${Target.DisplayName} << 
   /varset petAttacking false 
   /varset engaged 0 
   /varset nukeWaitTimer 0 
   /varset mobID ${Target.ID} 
   /varset mobHPStart ${Target.PctHPs} 
   /call UpdateMobList 
   /call AddToList mobList ${mobID} 
   /if (${Defined[mezTimer${mobID}]}) /deletevar mezTimer${mobID} 
DEBUG_1 declare meztimer 3
   /declare mezTimer${mobID} int outer -1 
   /varset newAdds 0 
   /varset nukeWaitTimer 0 
   /varset fightStartTime 0 
   /varset totalNonMeleeDmg 0 
   /varset totalMeleeDmg 0 
   /if ( ${Defined[waitTimer${mobID}]} ) /deletevar waitTimer${mobID} 
   /declare waitTimer${mobID} int outer -1 
   :check_add_loop 
   /if ( ( ${Target.PctHPs}>${minHP} && ${waitTimer${mobID}} ) || !${assistWaitTimer} ) { 
      /if ( ${Spawn[pc ${secondAssist}].ID} && ( !${Spawn[pc ${mainAssist}].ID} || ${Spawn[corpse ${mainAssist} radius ${minRadius}].ID} ) ) { 
         /varset mainTank ${secondAssist} 
      } else { 
         /varset mainTank ${mainAssist} 
      } 
      /if ( ${Me.Casting.ID} ) /call WaitCast 
      /assist ${mainTank} 
      /if ( ${useManaRobe} && ( ${refreshTime} || ${nukeWaiTimer} || !${nukeMode} ) ) /call ManaRobe 
      /varset tempTimer 8 
      :wait_for_assist 
      /call CheckForAdds 
      /doevents Timer 
      /if ( ${tempTimer} && ${Target.ID}==${mobID} ) /goto :wait_for_assist 
      /if ( ${Target.ID} && ${Target.ID}!=${mobID} ) { 
         /if ( ${Defined[mezTimer${mobID}]} ) /deletevar mezTimer${mobID} 
         /call DeleteFromList mobList ${mob} 
         /goto :wait_for_target 
      } 
      /varset assistWaitTimer 5s 
   } 
   /varset addIndex 1 
   :check_add_loop2 
   /call CheckForAdds 
   /if ( ${addIndex}>1 ) /goto :check_add_loop2 
   /if ( ${newAdds} ) /call MezAdds 
   /call CheckPet 
   /if ( !${Spawn[${mobID}].Type.Equal[NPC]} && !${Spawn[${mobID}].Type.Equal[pet]} ) /goto :mob_dead 
   /if ( !${nukeMode} && !${useDebuff} && !${useMez} ) /goto :wait_for_target 
   /target id ${mobID} 
   /delay 1s ${Target.ID} == ${mobID}
   /delay 1
   /if ( ( ${Target.PctHPs}<${mobHPStart} ) && ${Spawn[pc ${mainTank}].NearestSpawn[radius ${Math.Calc[${Spawn[${mobID}].MaxRangeTo}+10]} id ${mobID}].ID} && ${waitTimer${mobID}}<0  && ${Spawn[${mobID}].Distance3D}<=${minRadius} ) {  
      /deletevar waitTimer${mobID} 
      /declare waitTimer${mobID} timer outer ${engageDelay} 
   } 
   /doevents 
   /target id ${mobID} 
   /delay 1s ${Target.ID} == ${mobID}
   /delay 1
   /if ( ${Target.PctHPs}>${minHP} && ${waitTimer${mobID}} ) /goto :check_add_loop 
   /if ( ${newAdds} ) /call MezAdds 
   /if ( !${engaged} ) { 
      /varset engaged 1 
      /echo Engaging >> ${Target.DisplayName} << 
   } 
   /if ( ${Me.Pet.ID} && !${petAttacking} && !${Me.PetBuff[word of worell]} ) { 
      /pet attack 
      /varset petAttacking true 
   } 
   /call UpdateMobList 
   /doevents Timer 
   /if ( ${useDebuff} && !${newAdds} ) /call DebuffMobs 
   /if ( ${Spawn[${mobID}].Type.Equal[NPC]} || ( !${Spawn[${mobID}].Master.Type.Equal[PC]} && ${Spawn[${mobID}].Type.Equal[pet]} ) ) { 
      /target id ${mobID} 
      /delay 1s ${Target.ID} == ${mobID}
      /delay 1
   } else { 
      /goto :mob_dead 
   } 
   /if (!${newAdds} && (${slowTimer${mobID}} != 0 || !${useDebuff} || ${useTashOnly})) { 
      /call CheckRune 100 
      /call CheckBuffs 
      /target id ${mobID} 
      /delay 1s ${Target.ID} == ${mobID}
      /delay 1
      /if (${Target.Type.Equal[npc]} && (${Target.Class.CanCast} || ${Zone.ID}>=300 )) { 
         /if (${Me.SpellReady[Scryer's Trespass]}) /call Cast "Scryer's Trespass" spell 0 CheckForAdds 
         /if (${Me.SpellReady[Theft of Thought]}) /call Cast "Theft of Thought" spell 0 CheckForAdds 
      } 
      /target id ${mobID}
      /delay 1s ${Target.ID} == ${mobID}
      /delay 1
      /if ( ${refreshTime}<20 && ( ${Target.PctHPs}<${mobHPStart} || ${minHP}==100 ) && !${newAdds} && ${Target.LineOfSight} && !${Me.TargetOfTarget.Name.Equal[${Me.Name}]} && !${nukeWaitTimer} && ${nukeMode} && ( ${Me.PctMana}>=${nukeMana} || ${nukeMode}==2 ) && ( ${Target.Type.Equal[NPC]} || ${Target.Type.Equal[pet]} ) ) { 
         /if ( !${fightStartTime} ) /varset fightStartTime ${MacroQuest.Running} 
         /call Cast "${nuke1}" gem4 0 CheckForAdds 
         /if ( ${Macro.Return.Equal[CAST_NOTREADY]} ) { 
            /if ( ${Me.Gem[${nuke2}]} ) { 
/1 Nuking >> %t
               /call Cast "${nuke2}" gem9 0 CheckForAdds 
            } else { 
               /call ManaRobe 
            } 
         } 
         /if ( ${Macro.Return.Equal[CAST_SUCCESS]} || ${Macro.Return.Equal[CAST_RESISTED]} ) { 
            /if ( ${nukeMode}==1 ) { 
               /varcalc nukeWaitMod 5*(90 - ${Me.PctMana}) 
            } else { 
               /varset nukeWaitMod 0                
            } 
            /if ( ${nukeDelay}>${nukeWaitMod} ) { 
               /varset nukeWaitTimer ${nukeDelay} 
            } else { 
               /varset nukeWaitTimer ${nukeWaitMod} 
            } 
         } 
      } else { 
         /call ManaRobe 
      } 
   } 
   /goto :check_add_loop 
   :mob_dead 
   /call UpdateMobList 
   /echo Target Dead! 
   /if ( ${cleanUp} ) /call CleanUp ${mobID}
   /doevents 
   /if ( ${useDPS} ) /call DisplayDPS 
/goto :wait_for_target

Sub CheckForAdds 
   /if (${Me.Casting.ID}) { 
      /doevents gate 
      /doevents rageon 
      /doevents rageoff 
      /doevents uquakey 
      /doevents setvar 
      /if (${castEndTime} > 5) /doevents chat 
      /if (${useMez} && ${newAdds} && !${Me.Casting.Name.Equal[${mezSpell}]} && !${Spawn[${petID}].Type.Equal[NPC]} ) /call Interrupt 
   } 
   /if ( ${Target.ID}==${mobID} && ${Me.TargetOfTarget.Type.Equal[pc]} && ${Me.TargetOfTarget.Class.Name.Equal[cleric]} && ${Me.TargetOfTarget.PctHPs}<=50 && ${Me.AltAbilityReady[soothing words]} ) { 
      /if ( ${Me.TargetOfTarget.ID}==${Group.Member[1].ID} || ${Me.TargetOfTarget.ID}==${Group.Member[2].ID} || ${Me.TargetOfTarget.ID}==${Group.Member[3].ID} || ${Me.TargetOfTarget.ID}==${Group.Member[4].ID} || ${Me.TargetOfTarget.ID}==${Group.Member[5].ID} ) { 
         /if ( ${Me.Casting.ID} && !${Me.Casting.Name.Equal[${mezSpell}]} && !${Spawn[${petID}].Type.Equal[NPC]} ) /call Interrupt 
         /call Cast "soothing words" alt 
      } 
   } 
   /if ( ${useCharm} ) /call CheckPet2 
   :check_add_loop 
   /if ( !${Spawn[${mobID}].Type.Equal[NPC]} && !${Spawn[${mobID}].Master.Type.Equal[NPC]} && !${petOff} ) { 
      /varset addIndex 1 
      /varset newAdds 0 
      /return 
   } 
   /if ( ${petCheck} ) { 
      /varset addID ${NearestSpawn[${addIndex},npc radius ${minRadius}].ID} 
   } else { 
      /varset addID ${NearestSpawn[${addIndex},pet radius ${minRadius}].ID} 
   } 
   /if ( ${addID} ) { 
      /if ( ( ${mezTimer${addID}}<=${Math.Calc[${mezDuration}-50]} || !${mezTimer${addID}} ) && ${Spawn[${addID}].Distance3D}<=${minRadius} && ${addID}!=${petID} && ${Spawn[${addID}].LineOfSight} && ${aggroAnim.Find[|${Spawn[${addID}].Animation}|]} && ${mezTimer${addID}}!=-1 && ( ( !${Spawn[${addID}].Master.Type.Equal[PC]} && ${Spawn[${addID}].Type.Equal[pet]} ) || ( ${Spawn[${addID}].Type.Equal[NPC]} && ${addID}!=${Spawn[${mobID}].Master.ID} ) ) ) { 
         /call AddToList addList ${addID} 
         /call AddToList mobList ${addID} 
         /if ( ${Macro.Return.Equal[1]} ) { 
            /if ( !${Defined[waitTimer${addID}]} ) /declare waitTimer${addID} timer outer ${engageDelay} 
            /echo Add detected! >> ${Spawn[${addID}].DisplayName} << 
            /1 Add detected! >> ${Spawn[${addID}].DisplayName} << 
         } 
         /varset newAdds 1 
      } 
      /varcalc addIndex ${addIndex}+1 
   } else { 
      /varcalc petCheck !${petCheck} 
      /varset addIndex 1 
   } 
/return 

Sub CheckPet2 
   /if ( ${Zone.ID}!=${currentZone} ) /call Event_Zone 
   /if ( ${petOff} && ${Me.Pet.ID} ) { 
      /varset petOff 0 
      /if ( !${addList.Find[[]} ) /varset newAdds 0 
   } 
   /if ( ${Spawn[${petID}].Type.Equal[NPC]} && !${petOff} && ${useCharm} && ${petID} ) { 
      /echo Pet Off! 
      /varset petAttacking false 
      /varset newAdds 1 
      /varset petOff 1 
      /if ( ${useCharm}==1 && ${Me.Casting.ID} && ${useMez} && ${newAdds} && !${Me.Casting.Name.Equal[${mezSpell}]} && !${Me.Casting.Name.Equal[${pbaeMezSpell}]} && !${Me.Casting.Name.Equal[${tashSpell}]} && !${Me.Casting.Name.Equal[${charmSpell}]} ) /call Interrupt 
      /if ( ${useCharm}==1 ) { 
         /beep 
         /timed 7 /g PET OFF!! snare/malo pls! 
         /target id ${petID} 
      } 
   } 
/return 

Sub CheckPet 
   /if ( !${FindItem[${normalOffhand}].ID} && ${InvSlot[offhand].Item.ID} ) /varset normalOffhand ${InvSlot[offhand].Item.Name} 
   /doevents rageon rageoff
   /declare i int local 
   /declare tempID int local 
   /call CheckPet2 
   /if ( ${petOff} ) { 
      /if ( ${useCharm}==1 ) { 
         /call Charm ${petID} 
      } 
   } 
   /for i 1 to ${Group} 
      /varset tempID ${Group.Member[${i}].Pet.ID} 
      /if ( ${tempID} ) { 
         /if ( !( ${slowTimer${tempID}}<0 ) ) { 
            /if ( ${Defined[mezTimer${tempID}]} ) /deletevar mezTimer${tempID} 
            /if ( ${Defined[slowTimer${tempID}]} ) /deletevar slowTimer${tempID} 
            /if ( ${Defined[tashTimer${tempID}]} ) /deletevar tashTimer${tempID} 
DEBUG_1 declare meztimer 4
            /declare mezTimer${tempID} int outer -1 
            /declare tashTimer${tempID} int outer -1 
            /declare slowTimer${tempID} int outer -1 
         } 
      } 
   /next i 
/return 

Sub MezAdds 
   /if (!${useMez}) {
     /varset newAdds 0
     /return
   }
   /declare tempID string local 
   /declare AEmezzed int local 0 
   :mez_adds_loop 
   /if ( ${addList.Find[[]} ) { 
      /if ( ${addList.Find[[]}>1 ) /varset addList ${addList.Right[-${Math.Calc[${addList.Find[[]}-1]}]} 
      /if ( !${Spawn[${mobID}].Type.Equal[NPC]} && !${Spawn[${mobID}].Master.Type.Equal[NPC]} ) /return 
      /varset tempID ${addList.Arg[1,[].Left[-1]} 
      /if ( !${Spawn[${tempID}].Type.Equal[NPC]} && !${Spawn[${tempID}].Master.Type.Equal[NPC]} ) { 
         /if ( ${Defined[mezTimer${tempID}]} ) /deletevar mezTimer${tempID} 
         /if ( ${Defined[slowTimer${tempID}]} ) /deletevar slowTimer${tempID} 
         /if ( ${Defined[tashTimer${tempID}]} ) /deletevar tashTimer${tempID} 
      } else { 
         /squelch /target id ${tempID}
         /delay 5 ${Target.ID} == ${tempID}
         /delay 1
         /if (!${AEmezzed} && ${Spawn[${tempID}].NearestSpawn[2,npc radius 30].ID} && ${Spawn[${tempID}].Distance3D} < 30 && ${addList.Count[[]} > 2 && ${Me.SpellReady[${aeMezSpell]}]}) { 
            /call Cast "${aeMezSpell}" 
            /varset AEmezzed 1 
         } 
         /echo Calling Mez on ${Target.DisplayName} with ID: ${Target.ID}
         /call Mez 
      } 
      /call DeleteFromList addList ${tempID} 
      /goto :mez_adds_loop 
   } 
   /varset newAdds 0 
/return 

Sub DebuffMobs 
   /declare i int local 
   /declare tempID string local 
   /if ( ${mobList.Find[[]} ) { 
      /if ( ${mobList.Find[[]}>1 ) /varset mobList ${mobList.Right[-${Math.Calc[${mobList.Find[[]}-1]}]} 
      /for i 1 to ${mobList.Count[[]} 
         /varset tempID ${mobList.Arg[${i},[].Left[-1]} 
         /if ( !${Defined[slowTimer${tempID}]} ) { 
            /if ( !${Spawn[${tempID}].Type.Equal[npc]} ) { 
               /declare slowTimer${tempID} int outer 0 
            } else /if ( ( ( !${waitTimer${tempID}} || ${mezTimer${tempID}}>0 ) && ( ${slowTimer${mobID}} || ${waitTimer${mobID}} ) ) || ${tempID}==${mobID} ) { 
               /call UpdateMobList 
               /doevents Timer 
               /target id ${tempID} 
               /delay 1s ${Target.ID} == ${tempID}
               /delay 1
               /if (!${tashTimer${tempID}}) /call Tash 
               /if (${useTashOnly}) /goto :noslow
               /if (${newAdds}) /return 
               /call Slow 
               :noslow
               /if (${addList.Find[[]}) /varset newAdds 1 
               /if (${newAdds}) /return 
               /if (${Macro.Return.Equal[CAST_CANCELLED]}) /return 
               /if (${newAdds}) /return 
            } 
         } 
      /if (!${Spawn[${mobID}].Type.Equal[NPC]} && !${Spawn[${mobID}].Master.Type.Equal[NPC]}) /return 
      /next i 
   } 
/return 

Sub Charm(int tempID) 
   /target id ${tempID} 
   /if (${Spawn[${tempID}].Distance} > 80 && ${Me.SpellReady["${mezSpell}"]} && ${Me.CurrentMana} >= ${Spell["${mezSpell}"].Mana} && ${Spawn[${tempID}].LineOfSight}) {
     /fast fast nolook
     /call cast "${mezSpell}" gem1 6s CheckForAdds
   } else /if (${Spawn[${tempID}].Distance} > 60 && ${Me.Gem["${rootSpell}"]} && ${Me.SpellReady["${rootSpell}"]} && ${Me.CurrentMana} >= ${Spell["${rootSpell}"].Mana} && ${Spawn[${tempID}].LineOfSight}) {
     /fast fast nolook
     /call cast "${rootSpell}" gem8 6s CheckForAdds
   } else /if (${Me.Gem[${pbaeMezSpell}]} && ${Spawn[${tempID}].Level} <= ${maxPBAEMezLevel}) { 
      :MoveLoop
      /if (${Target.Distance} > 45) { 
         /face fast nolook 
         /keypress forward hold 
         /delay 1
         /goto :MoveLoop
       }
       /keypress forward
       /keypress back
       /delay 1
       :WaitLoop
       /if ( ${Target.Distance3D}<=35 ) { 
         /call Cast "${pbaeMezSpell}" gem6 6s CheckForAdds 
       } else {
         /delay 1
         /goto :WaitLoop
       }
   } else {
     /call cast "${mezSpell}" gem1 6s CheckForAdds
   }
   /target id ${tempID} 
   /delay 1
   /if ( ${tashTimer${tempID}}<5500 ) /call Tash 
   /call Cast "${charmSpell}" gem7
   /if (${Me.Pet.ID}) /target id ${Me.Pet.ID}
/return 

Sub Tash 
   :spell_loop 
   /if (!${Me.SpellReady[${Me.Gem[1]}]} && !${Me.SpellReady[${Me.Gem[2]}]} && !${Me.SpellReady[${Me.Gem[3]}]} && !${Me.SpellReady[${Me.Gem[4]}]}) {
     /delay 2
     /goto :spell_loop
   }
   /declare tempID int local ${Target.ID} 
   /if (${useTashFocus}) /call SwapItem "${tashFocusItem}" ${FindItem[${tashFocusItem}].WornSlot[1]} 
   /echo Casting: ${tashSpell} on ${Target.CleanName}
   /1 Casting: ${tashSpell} on ${Target.CleanName}
   /call Cast "${tashSpell}" gem2 1s 
   /if (!${Defined[tashTimer${tempID}]}) /declare tashTimer${tempID} timer outer 
   /if (${Macro.Return.Equal[CAST_SUCCESS]}) { 
      /varset tashTimer${tempID} ${tashDuration} 
   } else { 
      /varset tashTimer${tempID} 1 
   } 
   /if (${useTashFocus}) /call SwapItem "${normalMainhand}" mainhand 
/return ${Macro.Return} 

Sub Slow 
   /declare tempID int local ${Target.ID} 
   /doevents Hit 
   /call Cast "${slowSpell}" ${slowType} 6s CheckForAdds 
   /if ( !${Defined[slowTimer${tempID}]} ) /declare slowTimer${tempID} timer outer 
   /if ( ${Macro.Return.Equal[CAST_IMMUNE]} ) { 
      /deletevar slowTimer${tempID} 
      /declare slowTimer${tempID} int outer -1 
   } else /if ( ${Macro.Return.Equal[CAST_SUCCESS]} ) { 
      /varset slowTimer${tempID} ${slowDuration} 
   } else /if ( ${newAdds} || ${Macro.Return.Equal[CAST_OUTOFMANA]} || ${Macro.Return.Equal[CAST_OUTOFRANGE]} || ${Macro.Return.Equal[CAST_CANNOTSEE]} ) { 
      /varset slowTimer${tempID} 50      
   } else { 
      /varset slowTimer${tempID} 1 
   } 
/return ${Macro.Return} 

Sub Mez
   /declare tempID int local ${Target.ID} 
   /declare resistCount int local 0 
   /if (${Defined[mezTimer${tempID}]} && ${mezTimer${tempID}} > ${Math.Calc[${mezDuration}-20]}) /return  
   :mez_loop 
   /if (!${Me.SpellReady[${Me.Gem[1]}]} && !${Me.SpellReady[${Me.Gem[2]}]} && !${Me.SpellReady[${Me.Gem[3]}]} && !${Me.SpellReady[${Me.Gem[4]}]}) {
     /delay 2
     /goto :mez_loop
   }
   /if (${Spawn[${tempID}].Type.Equal[PC]}) { 
      /call UpdateMobList
      /squelch /target clear
      /return 
   } 
   /if (${Target.PctHPs} < 97 && ${mezTimer${tempID}} != -1) {
      /if (${Defined[mezTimer${tempID}]}) {
DEBUG_1 set meztimer 1
        /varset mezTimer${tempID} int outer -1
      } else { 
DEBUG_1 declare meztimer 1
        /declare mezTimer${tempID} int outer -1
      }
      /1 %T is being killed, no mezz 4 u!
      /return
   } 
   /if (!${Defined[mezTimer${tempID}]}) {
DEBUG_1 set meztimer 2
     /declare mezTimer${tempID} timer outer
   }
   /doevents Hit
   /if (${mezzImmuneList.Find[${Target.DisplayName}]}) {
DEBUG_1 set meztimer 2
     /varset mezTimer${tempID} -1
     /1 %T CANNOT BE MEZZED!  OFFTANK!
     /return
   }
   /echo Casting: ${mezSpell} on ${Target.CleanName}
   /1 Casting: ${mezSpell} on ${Target.CleanName}
   /if (!${mezzImmuneList.Find[${Target.DisplayName}]}) /call Cast "${mezSpell}" ${mezzGem} 3s
   /if ( ${Macro.Return.Equal[CAST_IMMUNE]} || ${Macro.Return.Equal[CAST_CANCELLED]} ) { 
DEBUG_1 set meztimer 6
     /varset mezTimer${tempID} int outer 10000
     /1 %T Is IMMUNE TO MEZZ!  OFFTANK!
   } else /if ( ${Macro.Return.Equal[CAST_SUCCESS]} ) { 
DEBUG_1 set meztimer 7
     /varset mezTimer${tempID} ${mezDuration} 
     /1 %T is MEZZED!  NO TOUCH!
   } else /if ( ${Macro.Return.Equal[CAST_OUTOFMANA]} || ${Macro.Return.Equal[CAST_OUTOFRANGE]} || ${Macro.Return.Equal[CAST_CANNOTSEE]} ) { 
DEBUG_1 set meztimer 8
     /varset mezTimer${tempID} 50      
   } else { 
     /if ( ${Macro.Return.Equal[CAST_INTERRUPTED]}) {
       /if (${Me.SpellReady["${stunSpell}"]}) {
         /call Cast "${stunSpell}" gem7 2s 
       } else /if (${Me.SpellReady["${pbaeMezSpell}"]} && ${Spawn[${tempID}].Level} <= ${maxPBAEMezLevel}) {
         /call Cast "${pbaeMezSpell}" gem4 3s 
       }
     }
     /if ( ${Macro.Return.Equal[CAST_RESISTED]} ) { 
       /varcalc resistCount ${resistCount}+1 
       /if ( ${resistCount}==2 && !${tashTimer${addID}} ) /call Tash 
     } 
     /if ( !${Spawn[${mobID}].Type.Equal[NPC]} && !${Spawn[${mobID}].Master.Type.Equal[NPC]} && ${useMez} ) /return 
     /goto :mez_loop 
   }
/return ${Macro.Return} 

Sub Event_Timer(string timerName,int timerValue) 
   /if ( !${Defined[${timerName}]} ) /return 
   /declare tempID int local 0 
   /declare oldTargetID int local ${Target.ID} 
   /if ( ${timerName.Left[9].Equal[tashTimer]} ) { 
      /varset tempID ${timerName.Right[-9]} 
      /if ( ${Spawn[${tempID}].Type.Equal[NPC]} || ${Spawn[${tempID}].Master.Type.Equal[NPC]} ) { 
         /target id ${tempID} 
         /call Tash 
      } else { 
         /deletevar ${timerName} 
      } 
   } else /if ( ${timerName.Left[9].Equal[slowTimer]} ) { 
      /varset tempID ${timerName.Right[-9]} 
      /if ( ${Spawn[${tempID}].Type.Equal[NPC]} || ${Spawn[${tempID}].Master.Type.Equal[NPC]} ) { 
         /target id ${tempID} 
         /call Slow 
      } else { 
         /deletevar ${timerName} 
      } 
   } else /if ( ${timerName.Left[8].Equal[mezTimer]} ) { 
      /varset tempID ${timerName.Right[-8]} 
      /if ( ${Spawn[${tempID}].Type.Equal[NPC]} || ${Spawn[${tempID}].Master.Type.Equal[NPC]} ) { 
         /target id ${tempID} 
         /delay 1s ${Target.ID} == ${tempID}
         /delay 1
         /call Mez 
      } else { 
         /deletevar ${timerName} 
      } 
   } else { 
      /return ${Macro.Return} 
   } 
   /if ( ${Target.ID}==${tempID} ) { 
      /if ( ${Spawn[${oldTargetID}].ID} ) { 
         /target id ${oldTargetID} 
      } else { 
         /squelch /target clear 
      } 
   } 
/return ${Macro.Return} 

Sub ClickOffIllusion 
   /declare i int local 
   /for i 1 to 20 
      /if ( ${Me.Buff[${i}].Name.Find[illusion:]} ) /notify BuffWindow buff${Math.Calc[${i}-1].Int} leftmouseup 
   /next i 
/return 

Sub CheckBuffs 
   /if ( ${Zone.ID}!=${currentZone} ) /call Event_Zone 

   /varset deathFlag ${Math.Calc[!(${InvSlot[chest].Item.ID}>0)]} 
   /if ( ${deathFlag} ) /goto :dead    
   /declare i int local 
   /declare oldTarget int local ${Target.ID} 
   /declare oldItemName string local 
   /declare foodName string local 
   /declare oldSlotID int local 
   /declare spellName string local 
   /declare buffText string local 
   /declare targetName string local 
   /declare spellName2 string local 
   /declare spellType string local 
   /declare spellRange int local 118 
   /declare tempID int local 
   /declare focusList string local Wunshi's Focusing,Focus of Alladnu,Focus of Soul,Talisman of Kragg,Focus of the Seventh,Talisman of Wunshi 
   /declare shaman bool local false 
   /declare targetType string local 

   /doevents Indoors 
   /if ( !${Me.Pet.ID} && ${usePet} && !${petOff} && ${Me.CurrentMana}>=900 ) /call SumPet 
   /if ( ${Me.Pet.ID} && ${petID}!=${Me.Pet.ID} ) { 
      /varset petID ${Me.Pet.ID} 
      /if ( ${Defined[mezTimer${petID}]} ) /deletvar mezTimer${petID} 
      /if ( ${Defined[slowTimer${petID}]} ) /deletvar slowTimer${petID} 
      /declare mezTimer${petID} int outer -1 
      /declare slowTimer${petID} int outer -1 
   } 
   /if ( !${Me.Casting.ID} ) { 
      /if ( ${Me.Combat} ) { 
         /call SwapItem "${meleeWep}" mainhand 
      } else { 
         /call SwapItem "${normalMainhand}" mainhand 
      } 
   } 
   /if ( ${Cursor.Name.Equal[Rod of Mystical Transvergance]} ) /autoinventory 
   /if ( !${FindItem[Rod of Mystical Transvergance].ID} && ${Spawn[pc ${rodBitch} radius 200].ID} && !${askedForRodTimer} ) { 
      ;tell ${rodBitch} rod pls! 
      /varset askedForRodTimer 5m 
   } 
   /if ( ${FindItem[Rod of Mystical Transvergance].ID} && !${modRodTimer} && ${Me.PctHPs}>50 && ${Me.PctMana}<=95 ) { 
      /call Cast "Rod of Mystical Transvergance" item 
      /varset modRodTimer 3100 
   } 
   /if ( ${checkNamed} ) /call CheckNamed 

   /if ( ${Me.Hunger}<5000 && ${useFood} ) { 
      /call GetFoodName 
      /varset foodName ${Macro.Return} 
      /if ( ${Bool[${foodName}]} ) { 
         /varset oldSlotID ${FindItem[${foodName}].InvSlot.ID} 
         /call SwapItem "${foodName}" "pack8" 
         /nomodkey /itemnotify pack8 rightmouseup 
         /call SwapItem "${foodName}" "${oldSlotID}" 
      } 
   } 
   /if ( !${autoBuff} ) /goto :skip_buffs 
   /if ( ( ${autoBuff}==2 || ${autoBuff}==4 ) && ${Target.ID} ) /return 

   /call CheckIniBuffs 

   /if ( ${Me.Pet.ID} ) { 
      /if ( !${Me.PetBuff[${charmSpell}]} && !${Me.PetBuff[speed of vallon]} && !${Me.PetBuff[speed of salik]} && !${Me.PetBuff[hastening of salik]} && ${Me.Pet.Distance3D}<=120 ) /call AddToQueue "haste,${Me.Pet.Name}" 
      /if ( !${Me.PetBuff[Night`s Dark Terror]} && ${Me.Pet.Distance3D}<=120 && ${Me.SpellReady[Night`s Dark Terror]} ) /call AddToQueue "Night`s Dark Terror,${Me.Pet.Name}" 
   } 
   /if ( ${Me.Buff["Clairvoyance"].Duration}<=5 && ${Me.Buff["Voice of Clairvoyance"].Duration}<=5 ) { 
      /if ( !${Me.Buff["Voice of Quellious"].ID} && !${Me.Buff["Tranquility"].ID} ) { 
         /if ( ${Me.PctMana}<50 && ${FindItem[Silken Augmenter's Pantaloons].ID} && !${Me.Buff["Clairvoyance"].ID} && !${Me.Buff["Voice of Clairvoyance"].ID} ) { 
            /call AddToQueue "c4,${Me.Name}" 
         } else { 
            /call AddToQueue "c6,${Me.Name}" 
         } 
      } else /if ( ${Me.PctMana}>=90 && ( ${Me.Book[clairvoyance]} || ${Me.Book[voice of clairvoyance]} ) ) { 
         /call AddToQueue "c6,${Me.Name}" 
      } 
   } 
   /if ( ${hasteGroup} ) { 
      /for i 1 to ${Group} 
         /varset tempID ${Group.Member[${i}].ID} 
         /if ( ${tempID} ) { 
            /if ( !${Defined[hasteTimer${tempID}]} ) /declare hasteTimer${tempID} timer outer 
            /if ( ${Spawn[${tempID}].Type.Equal[pc]} ) { 
               /if ( !${hasteTimer${tempID}} ) { 
                  /if ( ${Group.Member[${i}].Class.PureCaster} ) { 
                     /deletevar hasteTimer${tempID} 
                     /declare hasteTimer${tempID} int outer -1 
                  } else { 
                     /call AddToQueue "sos,${Group.Member[${i}].Name}" 
                     /varset hasteTimer${tempID} 62m 
                  } 
               } 
            } else /if ( ${Spawn[${tempID}].Type.Equal[corpse]} ) { 
               /varset hasteTimer${tempID} 0 
            } 
         } else /if ( ${Defined[hasteTimer${tempID}]} ) { 
            /deletevar hasteTimer${tempID} 
         } 
      /next i 
   } 
   /if ( ${Spawn[pc class shaman].ID} ) { 
      /if ( ${Raid.Members} ) { 
         /if ( ${Spawn[pc guild "${Me.Guild}" shm].ID} ) /varset shaman true 
      } else { 
         /for i 1 to ${Group} 
            /if ( ${Group.Member[${i}].Class.Name.Equal[shaman]} ) /varset shaman true 
         /next i 
      } 
   } 
   /if ( ${shaman} ) { 
      /if ( ${Me.Buff["${shielding}"].ID} ) /call ClickOffBuff "${shielding}" 
   } else { 
      /for i 1 to ${focusList.Length} 
         /if ( ${Me.Buff[${focusList.Arg[${i},,]}].ID} ) /goto :skip_buffs 
      /next i 
      /if ( !${Me.Buff[${shielding}].ID} ) /call AddToQueue "${shielding}" 
   } 
:skip_buffs 
   /if ( !${Me.Mount.ID} && ${useMount} ) /call Cast "${InvSlot[ammo].Item.Name}" item 2s CheckForAdds 
   /if ( ${buffQueue.Find[[]} ) { 
      /if ( ${buffQueue.Find[[]}>1 ) /varset buffQueue ${buffQueue.Right[-${Math.Calc[${buffQueue.Find[[]}-1]}]} 
      /for i 1 to ${buffQueue.Count[[]} 
         /varset buffText [${buffQueue.Arg[${i},[]} 
         /varset spellName ${buffText.Arg[1,,].Right[-1]} 
         /if ( ${spellName.Right[1].Equal["]"]} ) /varset spellName ${spellName.Left[-1]} 
         /varset targetName ${buffText.Arg[2,,].Left[-1]} 
         /call GetBuffName "${spellName}" 
         /varset spellName ${Macro.Return.Arg[1,,]} 
         /varset spellType ${Macro.Return.Arg[2,,]} 
         /if ( ${spellType.Equal[item]} ) { 
            /varset spellName2 ${FindItem[${spellName}].Spell.Name} 
         } else { 
            /varset spellName2 ${spellName} 
         } 
         /if ( ${Spell[${spellName2}].TargetType.Equal[Group v2]} ) { 
            /varcalc spellRange 1.18*${Spell[${spellName2}].AERange} 
         } else { 
            /varcalc spellRange 1.18*${Spell[${spellName2}].Range} 
         } 
         /varset targetType pc 
         /if ( !${Spawn[pc ${targetName}].ID} ) /varset targetType pet          
         /if ( ${Bool[${spellName}]} ) { 
            /if ( ${Me.CurrentMana}>=${Math.Calc[${Spell[${spellName}].Mana}+${Me.ManaRegen}]} || ${spellType.Equal[item]} || ${spellType.Equal[alt]} ) { 
               /if ( !${Bool[${targetName}]} ) { 
                  /call Cast "${spellName}" ${spellType} 4s CheckForAdds 
               } else /if ( ${Spawn[${targetType} ${targetName}].ID} && ( ${Spawn[pc ${targetName}].Distance3D}<=${spellRange} || !${spellRange} ) ) { 
                  /target ${targetType} ${targetName} 
                  /call Cast "${spellName}" ${spellType} 4s CheckForAdds 
                  /if ( ${Spawn[${oldTarget}].ID} ) { 
                     /if ( ${Target.Name.Equal[${targetName}]} ) /target id ${oldTarget} 
                  } else { 
                     /squelch /target clear 
                  }    
               } 
               /if ( ${Macro.Return.Equal[CAST_SUCCESS]} || ${Macro.Return.Equal[CAST_UNKNOWNSPELL]} || ${Macro.Return.Equal[CAST_NOTARGET]} || ( ${Macro.Return.Equal[CAST_CANCELLED]} && ( !${newAdds} || !${useMez} ) ) ) { 
                  /call DeleteFromQueue "${buffText}" 
                  /varcalc i ${i}-1 
               } 
            } 
         } else { 
            /call DeleteFromQueue "${buffText}" 
            /varcalc i ${i}-1 
         } 
      /next i 
   } 
   /return 
:dead 
   /declare i int local 
   /varset mobList 
   /varset addList 
   /varset buffQueue 
   /varset mobID 0 
   /varset petID 0 
   /varset useAnchor 0 
   /squelch alert clear 6 
   /call ClearMobList 
:wait_for_loot 
   /varset deathFlag ${Math.Calc[!(${InvSlot[chest].Item.ID}>0)]} 
   /if ( ${Spawn[corpse radius 100 ${Me.Name}].ID} && ${deathFlag} ) { 
      /target mycorpse 
      /call LootCorpse 
      /delay 5 
      /goto :wait_for_loot 
   } 
   /if ( ${deathFlag} ) { 
      /memspellset ${spellSet} 
      /echo You're dead! Consenting and waiting for rez... 
      /consent guild 
      /delay 25 
      /consent raid 
      /delay 25 
      /consent group 
   :wait_for_rez 
      /doevents 
      /delay 1s 
      /if ( !${Window[ConfirmationDialogBox].Open} ) /goto :wait_for_rez 
      /delay 18s !${Window[SpellBookWnd].Open} 
      /echo Yay a rez! 
      /target id ${Me.ID} 
      /call cast "Clairvoyance" gem4 5s RezBuff 
      /call TakeRez 
      /delay 5s ${Spawn[corpse radius 100 ${Me.Name}].ID} 
      /goto :wait_for_loot 
   } 
/return 

Sub RezBuff 
   /if ( ${Me.Casting.ID} && ${castEndTime}<=5 ) { 
      /varset castReturn CAST_CANCELLED 
      /call TakeRez 
   } 
/return 

Sub TakeRez 
:wait_for_rez2 
   /if ( ${Window[ConfirmationDialogBox].Open} ) { 
      /delay 1 
      /notify ConfirmationDialogBox Yes_Button leftmouseup 
      /goto :wait_for_rez2 
   } 
/return 

Sub GetBuffName(string spellName) 
   /declare i int local 
   /declare buffText string local 
   /declare spellType string local 
   /if ( !${Me.Gem[4].SpellType.Equal[detrimental]} ) { 
      /varset spellType gem4 
   } else { 
      /varset spellType gem8
   } 
   /if ( ${spellName.Equal[gom]} ) /varset spellName Gift of Magic 
   /if ( ${spellName.Equal[c1]} ) { 
      /if ( ${FindItem[rod of infinite thought].ID} ) { 
         /varset spellName rod of infinite thought 
         /varset spellType item 
      } else { 
         /varset spellName clarity 
      } 
   } 
   /if ( ${spellName.Equal[c2]} ) /varset spellName Clarity II 
   /if ( ${spellName.Equal[c3]} ) { 
      /if ( ${FindItem[Wand of Tranquility].ID} ) { 
         /varset spellName Wand of Tranquility 
         /varset spellType item 
      } else { 
         /varset spellName Koadic's Endless Intellect 
      } 
   } 
   /if ( ${spellName.Equal[c4]} ) { 
      /if ( ${FindItem[Silken Augmenter's Pantaloons].ID} ) { 
         /varset spellName Silken Augmenter's Pantaloons 
         /varset spellType item 
      } else { 
         /varset spellName Tranquility 
      } 
   } 
   /if ( ${spellName.Equal[mgb]} ) { 
      /varset spellName Mass Group Buff 
      /varset spellType alt 
   } 
   /if ( ${spellName.Equal[c5]} ) /varset spellName Voice of Quellious 
   /if ( ${spellName.Equal[c6]} ) { 
      /if ( ${Group} && ${Me.Book[Voice of Clairvoyance]} && ${Me.Buff[Clairvoyance].Duration}<=5 && ${Me.Buff[Voice of Clairvoyance].Duration}<=5 ) { 
         /varset spellName Voice of Clairvoyance 
      } else { 
         /varset spellName Clairvoyance 
      } 
   } 
   /if ( ${spellName.Equal[haste]} ) { 
      /if ( ${Me.PctMana}>60 || !${FindItem[Romar's Pantaloons of Visions].ID} ) { 
         /varset spellType gem8
         /if ( ${Me.Gem[${groupHasteSpell}]} ) { 
            /varset spellName ${groupHasteSpell} 
         } else { 
            /varset spellName ${singleHasteSpell} 
         } 
      } else { 
         /varset spellName Romar's Pantaloons of Visions 
         /varset spellType item 
      } 
   } 
   /if ( ${spellName.Equal[sov]} || ${spellName.Equal[speed of vallon]} || ${spellName.Equal[vallon]} ) { 
      /varset spellName Romar's Pantaloons of Visions 
      /varset spellType item 
   } 
   /if ( ${spellName.Equal[shissar]} || ${spellName.Equal[snake]} ) { 
      /varset spellName Staff of the Serpent 
      /varset spellType item 
   } 
   /if ( ${spellName.Equal[see invis]} ) { 
      /varset spellName bracer of the hidden 
      /varset spellType item 
   } 
   /if ( ${spellName.Equal[mr]} || ${spellName.Equal[grm]} || ${spellName.Equal[gmr]} || ${spellName.Equal[god]} || ${spellName.Equal[magic resist]} ) /varset spellName Guard of Druzzil 
   /if ( ${spellName.Equal[lev]} ) /varset spellName Levitation 
   /if ( ${spellName.Equal[sos]} ) /varset spellName Speed of Salik 
   /if ( ${spellName.Equal[imp invis]} ) /varset spellName Improved Invisibility 
   /if ( ${spellName.Equal[invis]} ) /varset spellName Cloud of Indifference 
   /if ( ${spellName.Equal[ivu]} ) /varset spellName Invisibility versus Undead 
   /if ( ${spellName.Equal[rune]} ) /varset spellName Rune of Zebuxoruk 
   /if ( ${spellName.Left[3].Equal[pac]} ) /varset spellName Pacification 
   /if ( ${Me.Book[illusion: ${spellName}]} ) /varset spellName illusion: ${spellName} 
   /if ( ${spellName.Equal[tash]} ) { 
      /varset spellName ${tashSpell} 
      /varset spellType gem3 
   } 
   /if ( ${spellName.Equal[slow]} ) { 
      /varset spellName ${slowSpell} 
      /varset spellType ${slowType} 
   } 
   /if ( ${spellName.Equal[mez]} ) { 
      /varset spellName ${mezSpell} 
      /varset spellType gem7 
   } 
   /if ( ${spellName.Left[6].Equal[dispel]} ) { 
      /if ( ${Me.Gem[recant magic]} ) { 
         /varset spellName Recant Magic 
      } else { 
         /varset spellName ${dispellItem} 
         /varset spellType item 
      } 
   } 
   /for i 1 to 5 
      /if ( ${spellName.Equal[${buffName${i}}]} ) /varset spellType ${buffType${i}} 
   /next i 
   /if ( ( ${spellType.Find[gem]} || ${spellType.Equal[spell]} ) && !${Int[${Me.Book[${spellName}]}]} ) { 
      /if ( ${FindItem[${spellName}].ID} ) { 
         /varset spellType item 
      } else /if ( ${Me.AltAbility[${spellName}]} || ${spellName.Equal[${Int[${spellName}]}]} ) { 
         /varset spellType alt 
      } else { 
         /return 
      } 
   } 
/return ${spellName},${spellType} 

Sub CheckRune(int tempHP) 
   /if ( !${Me.Buff["${selfRune}"].ID} && !${Me.Buff["Eldritch Rune"].ID} && ${autoBuff} && ( ${Me.PctHPs}<=${tempHP} || ${Me.PctMana}==100 ) ) { 
      /call AddToQueue "${selfRune}" 
   } 
/return 

Sub SumPet 
   /declare i int local 
   /if ( ${Me.AltAbilityReady[persistent minion]} ) /alt activate 176 
   /delay 10s !${Me.Casting.ID} 
   /delay 5s ${Me.Pet.ID} 
   /if ( !${Me.Pet.ID} ) { 
      /call cast "${petSpell}" gem4 5s 
   } 
/return 

| ======================== EVENTS ======================== 

Sub Event_Chat2(string chatType,string chatSender,string chatText) 
   /if ( ${chatText.Equal[camp]} && ${chatType.Equal[tell]} ) { 
      /if ( ${Me.Mount.ID} ) /dismount 
      /camp desktop 
   } 
   /if ( ${ignoreList.Find[|${chatSender}|]} || ${chatText.Left[4].Equal[cast]} || !${autoBuff} || ${Spawn[${chatSender}].Type.Equal[NPC]} ) /return 
   /if ( !${Defined[buffQueue]} ) /declare buffQueue string outer 
   /if ( !${Defined[chatTimer]} ) /declare chatTimer float outer 
   /declare chatTime float local ${MacroQuest.Running} 
   /declare oldTarget int local ${Target.ID} 
   /declare n int local 
   /declare spellName string local 
   /declare i int local 
   /declare j int local 
   /declare please bool local 
   /declare inGroup bool local false 
   /declare tempStr string local /\.,?!() 
   /declare tempChar string local 
   /declare tempStr2 string local 

   /for i 1 to ${tempStr.Length} 
      /varset tempChar ${tempStr.Mid[${i},1]} 
   :remove_char 
      /if ( ${chatText.Find[${tempChar}]} ) { 
         /varset chatText ${chatText.Left[${Math.Calc[${chatText.Find[${tempChar}]}-1]}]} ${chatText.Right[-${chatText.Find[${tempChar}]}]} 
         /goto :remove_char 
      } 
   /next i 
    
   /varset n ${chatText.Count[ ]} 

:count_spaces 
   /if ( ${chatText.Arg[${Math.Calc[${n}+1]}].Length} ) { 
      /varcalc n ${n}+1 
      /goto :count_spaces 
   } 
   /if ( ${chatText.Find[please]} || ${chatText.Find[pls]} || ${chatText.Find[plz]} ) /varset please true  
   /if ( ${chatText.Arg[${n}].Find[please]} || ${chatText.Arg[${n}].Find[pls]} || ${chatText.Arg[${n}].Find[plz]} || ${chatText.Arg[${n}].Equal[me]} ) /varcalc n ${n}-1 
   /if ( ${Spawn[pc ${chatText.Arg[${n}]}].Name.Left[3].Equal[${chatText.Arg[${n}].Left[3]}]} ) { 
      /if ( !${Spawn[pc ${chatText.Arg[${n}]}].Name.Equal[${Me.Name}]} ) /varset chatSender ${Spawn[pc ${chatText.Arg[${n}]}]} 
      /varcalc n ${n}-1 
   } 
    
   /if ( ${n}==1 && ${chatText.Arg[1].Equal[invite]} && ${GroupLeader.ID}==${Me.ID} ) { 
      /tar pc ${chatSender} 
      /if ( ${Me.Casting.ID} ) /call WaitCast 
      /invite 
   } 
    
   /for j 1 to 5 
      /if ( ${Group.Member[${j}].Name.Equal[${chatSender}]} ) /varset inGroup true 
   /next j 
    
   /if ( !${Spawn[${chatSender}].ID} ) /return 

   /for i 1 to ${n} 
      /if ( ( ${chatText.Equal[plead]} && !${Spawn[pc ${chatSender}].Class.PureCaster} ) || ${chatText.Arg[${i}].Left[5].Equal[haste]} || ${chatText.Arg[${i}].Left[3].Equal[sov]} || ${chatText.Arg[${i}].Left[5].Equal[speed]} || ${chatText.Arg[${i}].Left[2].Equal[vq]} || ${chatText.Arg[${i}].Left[4].Equal[pant]} || ( ${chatText.Arg[${i}].Left[6].Equal[vallon]} && !${chatText.Find[zek]} ) ) { 
         /if ( ${Me.Gem[speed of salik]} && ${Me.PctMana}>50 ) { 
            /call AddToQueue "sos,${chatSender}" 
         } else { 
            /call AddToQueue "sov,${chatSender}" 
         } 
      } 
      /if ( ${chatText.Arg[${i}].Left[3].Equal[VoQ]} || ${chatText.Arg[${i}].Left[2].Equal[c5]} ) { 
         /call AddToQueue "c6,${chatSender}" 
      } 
      /if ( ( ( ${chatText.Equal[plead]} && ${Spawn[pc ${chatSender}].Class.CanCast} ) || ${chatText.Arg[${i}].Left[2].Equal[c6]} || ${chatText.Arg[${i}].Equal[c]} || ${chatText.Arg[${i}].Left[7].Equal[clarity]} || ${chatText.Arg[${i}].Left[8].Equal[clairity]} || ${chatText.Arg[${i}].Left[5].Equal[crack]} ) && !${chatText.Find[i c]} && !${chatText.Find[AE c]} && !${chatText.Find[inc c]} ) { 
         /call AddToQueue "c6,${chatSender}" 
      } 
      /if ( ( ( ${chatText.Arg[${i}].Left[3].Equal[god]} || ${chatText.Arg[${i}].Left[4].Equal[druz]} || ${chatText.Arg[${i}].Left[2].Equal[mr]} ) && ( ${please} || ${chatText.Find[can i get]} ) ) || ${chatText.Arg[${i}].Left[3].Equal[gmr]} || ${chatText.Arg[${i}].Left[3].Equal[grm]} || ( ${chatText.Arg[${i}].Left[5].Equal[magic]} && ${chatText.Arg[${Math.Calc[${i}+1]}].Find[resist]} ) ) {    
         /call AddToQueue "mr,${chatSender}" 
      } 
      /if ( ${chatText.Arg[${i}].Equal[gom]} ) { 
         /call AddToQueue "gom,${chatSender}" 
      } 
      /if ( ${chatText.Arg[${i}].Equal[insight]} ) { 
         /call AddToQueue "insight,${chatSender}" 
      } 
      /if ( ${chatText.Arg[${i}].Left[2].Equal[c1]} ) { 
         /call AddToQueue "c1,${chatSender}" 
      } 
      /if ( ${chatText.Arg[${i}].Left[2].Equal[c2]} ) { 
         /call AddToQueue "c2,${chatSender}" 
      } 
      /if ( ${chatText.Arg[${i}].Left[2].Equal[c3]} ) { 
         /call AddToQueue "c3,${chatSender}" 
      } 
      /if ( ${chatText.Arg[${i}].Equal[shissar]} ) { 
         /call AddToQueue "shissar,${chatSender}" 
      } 
      /if ( ${chatText.Arg[${i}].Equal["make camp"]} ) { 
         /squelch /stick off
      }
      /if ( ( ${Me.Book[illusion: ${chatText.Arg[${i}]}]} || ${Me.Book[illusion: ${chatText.Arg[${i}]} ${chatText.Arg[${Math.Calc[${i}+1]}]}]} ) && ( ${please} || ${n}==1 || ${chatText.Arg[${Math.Calc[${i}+1]}].Left[2].Equal[me]} || ${chatText.Arg[${Math.Calc[${i}+2]}].Left[2].Equal[me]} ) ) { 
         /if ( ${inGroup} ) { 
            /if ( ${Me.Book[illusion: ${chatText.Arg[${i}]}]} ) { 
               /call AddToQueue "${chatText.Arg[${i}]},${chatSender}" 
            } else { 
               /call AddToQueue "${chatText.Arg[${i}]} ${chatText.Arg[${Math.Calc[${i}+1]}]},${chatSender}" 
            } 
         } 
      } 
   /next i 
   /varcalc chatTimer (${MacroQuest.Running}-${chatTime})/1000 
   /echo ${chatTimer} secs to parse chat 
/return 

Sub Event_AutoStun(string line,string toggle) 
   /if ( !${Defined[useStun]} ) /declare useStun int outer 0 
   /if ( ${toggle.Equal[on]} ) { 
      /varset useStun 1 
   } else { 
      /varset useStun 0 
   } 
:stun_loop 
   /if ( ${useStun} ) { 
      /if ( ${refreshTime} ) /call ManaRobe 
      /call Cast "Color Cloud" 
      /call Cast "Color Slant" 
      /if ( ${Macro.Return.Equal[CAST_INTERRUPTED]} ) /call Cast "Color Flux" 
      /if ( ${Macro.Return.Equal[CAST_NOTREADY]} ) /call Cast "Color Shift" 
      /if ( ${Macro.Return.Equal[CAST_NOTREADY]} ) /call Cast "Color Skew" 
      /call CheckRune 90 
      /doevents AutoStun 
      /doevents chat 
      /doevents setvars 
      /goto :stun_loop 
   } 
/return 

Sub Event_RageOn(string line) 
   /if ( ( ${line.Find[${Spawn[${mobID}].DisplayName}]} || ${line.Find[${Target.DisplayName}]} ) && ${Me.Pet.ID} ) { 
      /echo calling off pet... 
      /pet back off 
   } 
/return 

Sub Event_RageOff(string line) 
   /if ( ( ${line.Find[${Spawn[${mobID}].DisplayName}]} || ${line.Find[${Target.DisplayName}]} ) && ${Me.Pet.ID} ) { 
      /target id ${mobID} 
      /pet attack 
   } 
/return 

Sub Event_Mez 
   /if ( ${Defined[mezTimer${Target.ID}]} ) /deletevar mezTimer${Target.ID} 
   /call Mez 
/return 

Sub Event_Gate(string line,string mobName) 
   /if ( !${Me.Casting.Name.Equal[${mezSpell}]} ) /call Interrupt 
   /call Cast "${mezSpell}" gem7 3s CheckForAdds 
/return
 
HOLLY MOLLY! thats a long mac

HOLLY MOLLY! thats a long mac :eek:
 
Last edited:
Status
Not open for further replies.