Ranger.mac Updated by HardOne

HardOne

Rawk On!
Joined
Sep 27, 2008
Messages
344
Reaction score
1
Points
0
Here is an updated version of Nils Ranger.mac

I've made a few changes over the years, so I'll try to list all the ones I can remember

  • Removed the pull code, I never used it
  • removed buffbeg, never used it
  • Changed the default snare to use AA version
  • Modified the macro to use Ranger jolting Kicks line for Mitigation
  • Added support to cast Hail of Arrows
  • Added extra DPS AA's to be used for named mobs (Hard Coded) such as: Third Spire, Auspice, Pack Hunt, Group Guardian.
  • Removed the Wait for Rez sub, and added a loop, to wait for a rez (I use the AutoRez Plugin)
  • The Ranger is now smarter when returning home, he will face the direction he was when starting the macro
  • If mobs are present (multi pull) he wont run to anchor after each kill
  • Converted all channel output to use EQBC
  • You can now define a Bandolier to use, as well as your spell set
  • Because I've done it a few times, macro now will shut off MQ2Melee use of aggro (i.e. /melee aggro=0)
  • Added command /cleancorpses which will trigger ninjadvloot to loot all nearby corpses

I'm sure I forgot something that I changed, but I've been using this for a long time without trouble, although there are a couple thigns I edited today during the server downtime that havent been tested.

Below is the macro file, and the ini I use, you will also need spell_routines, and ninjadvloot, MQ2Debuffs, MQ2MoveUtils, and MQ2Melee is always nice to have.
 

Attachments

  • ranger.mac
    72.1 KB · Views: 363
  • CharName_RangerBot.ini
    9.9 KB · Views: 327
Last edited:
Ranger.mac
Code:
|Ranger.mac Assist and Kill Macro with archery and Hail of Arrows Support v2.0 08-12-2009
|Ripped From: ** Ranger PullAssist/Kill Macro v1.0 by Nils Updated 2008-01-24 **|
|Removal of pull code & Random updates by HardOne
|I removed the pull code, and made some updates because I didn't need to pull.
|I also removed the buff beg, I don't like automated buff requesting, I prefer automated buff recasting.

#event AutoFireOn      "Auto fire on."
#event AutoFireOff     "Auto fire off."
#event CastSpell       "#*# castspell #1# on #2#"
#event DamageMelee     "You #*# for #1# points of damage#*#"
#event DamageMelee     "|${Me.Pet.DisplayName}| #*# for #1# points of damage#*#"
#event DamageNonMelee  "|${Me.Name}| hit #*# for #1# points of non-melee damage#*#"
#event DeTarget        "Try attacking someone other than yourself, it's more productive."
#event Enrageon        "#*#|${Target.CleanName}| has become ENRAGED#*#"
#event Enrageoff       "#*#|${Target.CleanName}| is no longer enraged#*#"
#event EQBC            "<#1#> #2#"
#event EQBC            "[#1#(msg)] #2#"
#event ExcludeMob      "#*# excludemob #1#"
#event Gate            "|${Target.DisplayName}| begins to cast the gate spell#*#"
#event Gate            "|${Target.DisplayName}| begins to cast a spell. <Complete Healing>#*#"
#event ImDead          "#*#You have been slain by#*#"
#event ImDead          "Returning to home point, please wait..."
#event ImDead          "#*#Returning to Bind Location#*#"
#event Invite          "#*#invites you to join a group.#*#"
#event MobDead         "#*#You have slain#*#"
#event MobDead         "#*#has been slain by#*#"
#event NoSnare         "#*#is immune to changes in its#*#"
#event NoSnareHold     "#*#Your spell did not take hold.#*#"
#event Outdoors        "#*#You can only cast this spell in the outdoors#*#"
#event Outdoors        "#*#This spell does not work here#*#"
#event RaidBuff        "#*# raidbuff #1#"
#event SayZone         "#*# sayzone #1#"
#event SetAnchor       "[MQ2] Setting Anchor"
#event SnareResist     "#*#Your target resisted the Ensnare spell#*#"
#event SnareResist     "#*#Your target resisted the Tangling Weeds spell#*#"
#event SnareResist     "#*#Your target resisted the Entangle spell#*#"
#event SnareResist     "#*#Your target resisted the Earthen Shackles spell#*#"
#event Snareon         "#*#has been ensnared#*#"
#event Snareon         "#*#movements slow as their feet are covered in tangling weeds#*#"
#event Snareon         "#*#has been entangled#*#"
#event Snareon         "#*#has been entrapped in living earth#*#"
#event Snareoff        "#*#Your ensnare spell has worn off#*#"
#event Snareoff        "#*#Your tangling weeds spell has worn off#*#"
#event Snareoff        "#*#Your entangle spell has worn off#*#"
#event Snareoff        "#*#Your earthen shackles spell has worn off#*#"
#event SwitchTarget    "#*# switchtarget #1#"
#event ToggleMT        "[MQ2] Setting new main tank to: #*#"
#event ToggleVar       "[MQ2] ToggleVar #1#,#2#,#3#,#4#,#5#"
#event ToggleString    "[MQ2] ToggleString #1#,#2#,#3#,#4#,#5#"
|#event TooFarAway      "#*#Your target is too far away, get closer#*#"
#event WornOff         "#*#Your #1# spell has worn off of #2#."
#event Zoned           "You have entered#*#"
#event Zoned           "LOADING, PLEASE WAIT..."
#event CleanCorpses       "[MQ2] Clean Corpses"


#include Ninjadvloot.inc
#include spell_routines.inc


#Chat Chat
#Chat Tell

Sub main
	
	/echo Ranger.mac Starting up... Please Wait...
	/bc Ranger.mac Starting up... Please Wait...
	
	/if (${Me.State.NotEqual[STAND]}) {
		/stand
		/delay 10
	}
	
	/declare Version string outer 2.00
	/declare IniFile string outer ${Me.Name}_RangerBot.ini
	/declare LootINIFile string outer "Loot.ini"
	/declare Camp_Zone int outer ${Zone.ID}
	
	/echo Loading information from your ini, this may take some time...
	/call LoadIni "${Me.CleanName}_RangerBot.ini" LOAD
	/call SetupAdvLootVars
	/delay 5s
	/echo Load complete!
	
	/bc Joining bc channel: ${bcChannel}
	/bccmd channels ${bcChannel}
	
	/bandolier Activate ${MyBandolier}
	/memspellset ${MySpellSet}
	:waitForMem
		/if (${Me.State.NotEqual[STAND]}) {
			/delay 1s
			/goto :waitForMem
		}
		
	/melee aggro=0
	/if (${Version.NotEqual[${Ini[${Me.Name}_RangerBot.ini,Misc,Version]}]}) /call SetAliases
	/if (!${Target.ID} || ${Target.Type.NotEqual[PC]} || ${Target.Type.Equal[Corpse]} || ${Target.Type.Equal[PET]} || ${Target.ID} == ${Me.ID}) {
		/varset TankName ${DefaultMT}
		/squelch /target ${TankName}
		/delay 1s ${Target.Name.Equal[${TankName}]}
		/varset TankID ${Target.ID}
    } else {
		/varset TankID ${Target.ID}
		/varset TankName ${Target.CleanName}
    }
    /varset HomeX ${Me.X}
    /varset HomeY ${Me.Y}
    /varset MyHeading ${Me.Heading.DegreesCCW}
    /varset Anchor TRUE
    /echo ******************************
    /echo Ranger.mac Version: ${Version} Initialized
    /echo Anchor: ${Me.X}, ${Me.Y}, Facing: ${Me.Heading.DegreesCCW}
    /echo ${TankName} is the Tank. ID: ${TankID}
    /echo ******************************
    /bct ${bcChannel} ******************************
    /bct ${bcChannel} Ranger.mac Version: ${Version} Initialized
	/bct ${bcChannel} Anchor: ${Me.X}, ${Me.Y}, Facing: ${Me.Heading.DegreesCCW}
    /bct ${bcChannel} ${TankName} is the Tank. ID: ${TankID}
    /bct ${bcChannel} ******************************

:Main_Loop
	/doevents
	/if (${GameState.Equal[CHARSELECT]}) /end
	
	/if (${Me.State.Equal[Hover]} || ${Me.State.Equal[Dead]} || ${Window[RespawnWnd].Open}) /call Event_ImDead
	
	/if (${Me.Pet.ID}) {
		/echo Killing Flappy now
		/pet get lost
		}
		
	/if (${Tank.ID} == ${Me.ID}) {
		/call Check_grpHPs
		/if (${MoveHome}) /varset MoveHome FALSE
		/if (!${Me.Combat} && !${Me.Invis} && !${Me.Moving} && !${SpawnCount[npc radius 20 zradius 30]} && !${Me.Casting.ID} && !${Following}) {
			/if (${SelfBuffs} && !${SelfBuffTimer}) /call MaintainSelfBuffs
			/if (${QueueCount} && ${Me.PctMana}>${DoBuffMana} && ${DoBuffs}) /call DoBuffEvents
			/if (${RaidQueueCount} && ${Me.PctMana}>${DoBuffMana} && ${DoRaidBuffs}) /call RaidBuffEvents
			/if (!${Following}) /call MedTime
			/delay 15 !${Me.Moving}
		}
	
		/if (${AutoCombat}) {
			/if (!${Engaged} && !${Paused} && ${NearestSpawn[1, NPC radius 75 zradius 75].ID}) /call KillTarget
			/if (${Engaged} && ${TargetArray[4]} && !${Paused}) {
				/if (${Me.Sitting}) /stand
				/call KillTarget
			}
		}
	}
	
	/if (${Tank.ID} != ${Me.ID}) {
		/call Check_grpHPs
		/if (!${Me.Combat} && !${Me.Invis} && !${Me.Moving} && !${SpawnCount[npc radius 20 zradius 30]} && !${Me.Casting.ID} && !${Following}) {
			/if (${SelfBuffs} && !${SelfBuffTimer}) /call MaintainSelfBuffs
			/if (${QueueCount} && ${Me.PctMana}>${DoBuffMana} && ${DoBuffs}) /call DoBuffEvents
			/if (${RaidQueueCount} && ${Me.PctMana}>${DoBuffMana} && ${DoRaidBuffs}) /call RaidBuffEvents
			/if (!${Following}) /call MedTime
			/delay 15 !${Me.Moving}
		}

		/if (!${Engaged} && !${Paused} && ${NearestSpawn[1, NPC radius ${AssistDistance} zradius ${AssistDistance}].ID}) /call AssistTank
		
		/if (${PreEngaged} && ${TargetArray[4]} && !${Paused} && ${Target.PctHPs}<=${AssistAt} && ${Target.Type.Equal[NPC]}) {
			/if (${Me.Sitting}) /stand
			/call KillTarget2
		}
	}
	
	/call ReadyForNext
	/call ResetVars
	/goto :Main_Loop
/return

Sub ReturnHome2
	/if (!${AutoCombat} || !${MoveHome}) /return
	/if (${Following}) /return
	/if (${Math.Distance[${HomeY},${HomeX}]}<20) {
		/keypress forward
		/keypress back
		/keypress left
		/keypress right
		/delay 2
    /return
	}
	:MoveHome2
		/doevents
		/if (${Math.Distance[${HomeYLoc},${HomeXLoc}]}>30 && ${Me.CombatState.Equal[COMBAT]}) {
			/face fast nolook loc ${HomeYLoc},${HomeXLoc}
			/if (${Math.Distance[${HomeYLoc},${HomeXLoc}]}>10) /keypress forward hold
			/if (${Math.Distance[${HomeYLoc},${HomeXLoc}]}>20) /call AreWeStuck
			/if (${Math.Distance[${HomeYLoc},${HomeXLoc}]}<10) {
				/keypress forward
				/keypress back
				/delay 1s
				/face fast nolook heading ${MyHeading}
			/return
			}
		} else {
			/if (${SpawnCount[npc radius 30 zradius 30 LOS]}) {
				/keypress forward
				/keypress back
				/delay 1s
			/return
			}
			/face fast nolook loc ${HomeY},${HomeX}
			/if (${Math.Distance[${HomeY},${HomeX}]}>20) {
				/if (${Me.Sitting}) /stand
				/keypress forward hold
			}
			/if (${Math.Distance[${HomeYLoc},${HomeXLoc}]}>20) /call AreWeStuck
			/if (${Math.Distance[${HomeY},${HomeX}]}<10) {
				/keypress forward
				/keypress back
				/keypress left
				/keypress right
				/delay 1s
				/face fast nolook heading ${MyHeading}
			/return
			}
		}
	/goto :MoveHome2
/return

Sub AreWeStuck
	/doevents
	/varset StuckXLoc ${Me.X}
	/varset StuckYLoc ${Me.Y}
	/delay 2
	/if (${StuckXLoc}==${Me.X} && ${StuckYLoc}==${Me.Y}) {
		/call MoveAround
	}
/return

Sub MoveAround
	/if (${Stick.Status.Equal[ON]}) /squelch /stick pause
	/keypress forward
	/keypress back hold
	/delay 3
	/keypress back
	/if (${Math.Rand[2]}) {
		/keypress strafe_right hold
	} else {
		/keypress strafe_left hold
	}
	/delay 3
	/keypress strafe_right
	/keypress strafe_left
	/if (${Stick.Status.Equal[PAUSED]}) /squelch /stick unpause
/return

Sub AssistTank
	/if (${Spawn[${TankName}].ID} != ${Spawn[${Me.CleanName}].ID}) /assist ${TankName}
	/if (${Target.ID} && ${Target.PctHPs}<=${AssistAt} && ${Target.Distance}<${AssistDistance} && !${Target.Type.Equal[PC]} && !${Target.Type.Equal[Corpse]} && !${Target.Type.Equal[PET]} && !${ExcludeList.Find[${Spawn[${Target.ID}]}].CleanName}) {
		/face fast nolook
		/varset TargetArray[1] ${Target.CleanName}
		/varset TargetArray[2] ${Target.Level}
		/varset TargetArray[3] ${Target.Name}
		/varset TargetArray[4] ${Target.ID}
		/if (${Me.Sitting}) /stand
		/varset PreEngaged TRUE
	}
/return

Sub KillTarget
	/delay 1
	/if (!${Target.ID} || ${ExcludeList.Find[${Spawn[${Target.ID}]}].CleanName}) {
		/return
	}
	/if (${Target.ID} && ${Target.Type.Equal[NPC]}) {
		/face fast nolook
		/varset TargetArray[1] ${Target.CleanName}
		/varset TargetArray[2] ${Target.Level}
		/varset TargetArray[3] ${Target.Name}
		/varset TargetArray[4] ${Target.ID}
		/if (${Target.Distance}>=500) /squelch /target clear
	}
	/declare counter int local 0
	/declare RangeFire local FALSE
	/varset RunHome FALSE
	:WaitForMob
		/if (!${RangeFire} && ${Target.ID}!=${NearestSpawn[npc named].ID} && ${Target.Distance}>80 && ${Target.Distance}<340 && ${Target.LineOfSight}) {
			/if (${Stick.Status.Equal[ON]}) /squelch /stick off
			/keypress forward
			/keypress back
			/if (${AutoArchery}) /autofire
			/varset RangeFire TRUE
			/doevents
		}
		/if (${RangeFire} && ${Target.Distance}<80) {
			/if (${AutoArchery}) /autofire off
			/varset RangeFire FALSE
			/doevents
		}
		/if (${Target.Distance}>80) {
			/delay 5
			/varcalc counter ${counter}+5
			/if (${counter}>100) /goto :Combat
			/goto :WaitForMob
		}
	:Combat
		
		/if (${Target.ID} && ${Target.Type.Equal[NPC]}) {
			/face fast nolook
			/varset TargetArray[1] ${Target.CleanName}
			/varset TargetArray[2] ${Target.Level}
			/varset TargetArray[3] ${Target.Name}
			/varset TargetArray[4] ${Target.ID}
			/call Check_grpHPs
			/if (${Me.Sitting}) /stand
			/varset Engaged TRUE
			/varset HandToHand TRUE
			/if (${Target.Distance}>12) /squelch /stick 8 moveback
			/delay 5
			/if (${HoldAgro}) {
				/if (!${Me.TargetOfTarget.Name.Equal[${Me}]} && ${Target.Distance} < 20 && ${Me.AbilityReady[Taunt]}) /doability "Taunt"
				/delay 1
			}
			/if (${Me.PctHPs}>=30) /attack on
		}
		/call AssistTank
		/if (${Me.Feigning}) {
			/stand
			/if (${TargetArray[4]} && (!${Target.ID} || ${Target.ID}!=${TargetArray[4]})) /squelch /target id ${TargetArray[4]}
			/delay 1
			/attack on
			/if (!${HandToHand}) /varset HandToHand TRUE
			/if (${Target.Distance}>12) /squelch /stick 8 moveback
		}
		/if (${Target.Distance}>500) {
			/squelch /target clear
			/varset Engaged FALSE
			/return
		}
		/if (${Target.ID} && ${Target.Type.Equal[NPC]} && ${Target.ID}==${TargetArray[4]}) {
			/if (!${Me.Combat} && ${Target.Distance} < ${Target.MaxRangeTo}) /attack on
			/if (${Target.Distance}>12) /squelch /stick 8 moveback
			/if (${Me.PctHPs}<=9) /call WeaponShield
			/if (${DoDots} && ${Target.PctHPs}<=${DotAt} && ${Target.PctHPs} > ${MinDotAt} && ${DotTimer}==0 && ${Target.LineOfSight}) /call Dot
			/if (${DoHail} && ${Target.PctHPs}<=${HailAt} && ${Target.PctHPs} > ${MinHailAt} && ${HailTimer}==0 && ${Target.LineOfSight}) /call Hail
			/if (!${Snared} && ${SnareMobs} && ${Target.PctHPs}<=${SnareAt} && ${Target.LineOfSight}) /call Snare
			/if (${DoNuke} && ${Target.PctHPs}<=${NukeAt} && ${Me.PctMana} > ${MinManaForNuke} && ${NukeTimer}==0 && ${Target.PctHPs} > ${MinNukeAt} && ${Target.LineOfSight}) /call Nuke
			/if (${Me.TargetOfTarget.Name.Equal[${Me}]} && ${Math.Distance[${HomeY},${HomeX}]}>${PullBackDistance} && ${Target.PctHPs}>40) {
				/if (${Stick.Status.Equal[ON]}) /squelch /stick pause
				/call ReturnHome2
				/face fast nolook
				/delay 2s
				/if (${Stick.Status.Equal[PAUSED]}) /squelch /stick unpause
			}
			/if (${Target.ID}==${NearestSpawn[npc named].ID} && ${Target.PctHPs}>25 && ${Target.PctHPs}<95) {
				/if (${FindItem["Aurora, the Heartwood Blade"].InvSlot} && !${FindItem["Aurora, the Heartwood Blade"].Timer}) {
					/call Cast "Aurora, the Heartwood Blade" item
				} else /if (${FindItem[Heartwood Blade].InvSlot} && !${FindItem[Heartwood Blade].Timer}) {
					/call Cast "Heartwood Blade" item
				}
				/if (${Me.AltAbility[Fundament: Third Spire of the Pathfinders]} && ${Me.AltAbilityReady[Fundament: Third Spire of the Pathfinders]}) /call Cast "Fundament: Third Spire of the Pathfinders" alt
				/if (${Me.AltAbility[Auspice of the Hunter]} && ${Me.AltAbilityReady[Auspice of the Hunter]}) /call Cast "Auspice of the Hunter" alt
				/if (${Me.AltAbility[Group Guardian of the Forest]} && ${Me.AltAbilityReady[Group Guardian of the Forest]}) /call Cast "Group Guardian of the Forest" alt
				/if (${Me.AltAbility[Pack Hunt]} && ${Me.AltAbilityReady[Pack Hunt]}) /call Cast "Pack Hunt" alt
			}
		}
		/if (!${Target.ID} || ${Target.Type.Equal[Corpse]}) {
			/delay 3
			/attack off
			/delay 3
			/if (${Stick.Status.Equal[ON]}) /squelch /stick off
			/varset Snared FALSE
			/varset HandToHand FALSE
			/varset Engaged FALSE
			/varset SelfBuffTimer 0
			/call CheckForAdd
			/if (${Target.ID} && ${Target.Type.Equal[NPC]}) /call KillTarget
			/doevents MobDead
			/return
		}
	/doevents NotStanding
	/goto :Combat
/return

Sub KillTarget2
	/if (!${Target.ID} || ${ExcludeList.Find[${Spawn[${Target.ID}]}].CleanName}) {
		/return
	}
	/declare RangeFire local FALSE
	/declare AssistTimer timer local 0
	/declare counter int local 0
	:WaitForMob2
		/if (${Target.Distance}>75) {
			/delay 5
			/varcalc counter ${counter}+5
			/if (${counter}>100) /goto :Combat2
			/goto :WaitForMob2
		}
	:Combat2
		/call AssistTank
		/if (${Paused} || !${PreEngaged}) /return
		/call Check_grpHPs
		/if (!${AssistTimer}) {
			/if (${Target.ID}!=${TargetArray[4]} && ${Spawn[${TankName}].ID} != ${Spawn[${Me.CleanName}].ID}) /assist ${TankName}
			/if (${Target.ID}==${TargetArray[4]}) {
				/face fast nolook
				/varset AssistTimer 10s
			}
		}
	/call AssistTank
	/if (${Me.Feigning}) {
		/stand
		/if (${TargetArray[4]} && (!${Target.ID} || ${Target.ID}!=${TargetArray[4]})) /squelch /target id ${TargetArray[4]}
		/delay 1
		/attack on
		/if (!${HandToHand}) /varset HandToHand TRUE
		/if (${Target.Distance}>12) /squelch /stick 10 moveback
	}
	/if (${Target.ID}==${TargetArray[4]}) /face fast nolook
	/if (!${AutoArchery} && ${HoldAgro} && ${Target.Distance}<75 && ${Target.Distance}>11) /squelch /stick 10 moveback
	/if (!${AutoArchery} && !${HoldAgro} && ${Target.Distance}<75 && ${Target.Distance}>11) /squelch /stick 10 moveback !front
	/delay 5
	/if (${HoldAgro}) {
		/if (!${Me.TargetOfTarget.Name.Equal[${Me}]} && ${Target.Distance} < 20 && ${Me.AbilityReady[Taunt]}) /doability "Taunt"
		/delay 1
	}
	/if (${Target.ID} && ${Target.Type.Equal[NPC]} && ${Target.ID}==${TargetArray[4]} && ${Target.LineOfSight}) {
		/if (${Target.ID}==${NearestSpawn[npc named].ID} && ${Target.PctHPs}>25 && ${Target.PctHPs}<95) {
				/if (${FindItem["Aurora, the Heartwood Blade"].InvSlot} && !${FindItem["Aurora, the Heartwood Blade"].Timer}) {
					/call Cast "Aurora, the Heartwood Blade" item
				} else /if (${FindItem[Heartwood Blade].InvSlot} && !${FindItem[Heartwood Blade].Timer}) {
					/call Cast "Heartwood Blade" item
				}
				/if (${Me.AltAbility[Fundament: Third Spire of the Pathfinders]} && ${Me.AltAbilityReady[Fundament: Third Spire of the Pathfinders]}) /call Cast "Fundament: Third Spire of the Pathfinders" alt
				/if (${Me.AltAbility[Auspice of the Hunter]} && ${Me.AltAbilityReady[Auspice of the Hunter]}) /call Cast "Auspice of the Hunter" alt
				/if (${Me.AltAbility[Group Guardian of the Forest]} && ${Me.AltAbilityReady[Group Guardian of the Forest]}) /call Cast "Group Guardian of the Forest" alt
				/if (${Me.AltAbility[Pack Hunt]} && ${Me.AltAbilityReady[Pack Hunt]}) /call Cast "Pack Hunt" alt
		}
		/if (${AutoArchery} && !${RangeFire} && !${AutoFireState} && ${Target.Distance}<${AssistDistance} && ${Target.PctHPs}<=${AssistAt} && !${HandToHand}) {
			/if (${Target.ID}!=${TargetArray[4]} && ${Spawn[${TankName}].ID} != ${Spawn[${Me.CleanName}].ID}) /assist ${TankName}
			/if (${Target.ID}==${TargetArray[4]}) {
				/face fast nolook
				/keypress forward
				/keypress back
				/squelch /stick ${ArcheryDistance} moveback
				/delay 3
				/autofire on
				/varset RangeFire TRUE
				/varset HandToHand FALSE
				/varset Engaged TRUE
				/doevents
			}
		}
		/if (${AutoArchery} && ${RangeFire} && ${AutoFireState} && ${Target.Distance}<30 && !${HandToHand} && ${Target.ID}==${TargetArray[4]} && !${Me.Casting.ID}) {
			/autofire off
			/varset RangeFire FALSE
			/if (${Target.ID}!=${TargetArray[4]} && ${Spawn[${TankName}].ID} != ${Spawn[${Me.CleanName}].ID}) /assist ${TankName}
			/if (${Target.ID}==${TargetArray[4]}) {
				/face fast nolook
				/if (${Target.Distance}>15) /squelch /stick 12 moveback !front
				/delay 1s
				/squelch /attack on
				/varset HandToHand TRUE
				/varset Engaged TRUE
				/doevents
			}
		}
		/if (${Me.PctHPs}<=9) /call WeaponShield
		/if (${AutoArchery} && ${Engaged} && ${RangeFire} && ${Target.Distance}>30 && !${HandToHand} && !${AutoFireState} && ${Target.ID}==${Targetarray[4]} && !${Me.Casting.ID}) {
			/face fast nolook
			/squelch /stick ${ArcheryDistance} moveback
			/delay 3
			/autofire on
			/doevents
		}
		/if (!${AutoArchery} && ${Target.Distance}<${AssistDistance} && ${Target.PctHPs}<=${AssistAt} && !${HandToHand} && !${Me.Casting.ID}) {
			/if (${Target.ID}!=${TargetArray[4]} && ${Spawn[${TankName}].ID} != ${Spawn[${Me.CleanName}].ID}) /assist ${TankName}
			/if (${Target.ID}==${TargetArray[4]}) {
				/face fast nolook
				/if (${Target.Distance} > 15) /squelch /stick 12 moveback !front
				/varset HandToHand TRUE
				/squelch /attack on
				/varset Engaged TRUE
			}
			}
		/if (${AutoArchery} && ${Me.Combat} && ${Target.Distance}>30 && !${RangeFire} && ${HandToHand} && !${AutoFireState}) {
			/if (${Target.ID}!=${TargetArray[4]} && ${Spawn[${TankName}].ID} != ${Spawn[${Me.CleanName}].ID}) /assist ${TankName}
			/if (${Target.ID}==${TargetArray[4]}) {
				/face fast nolook
				/if (${Stick.Status.Equal[ON]}) /squelch /stick off
				/squelch /attack off
				/varset HandToHand FALSE
				/squelch /stick ${ArcheryDistance} moveback
				/delay 1s
				/autofire on
				/varset RangeFire TRUE
				/varset Engaged TRUE
				/doevents
			}
		}
		/if (!${AutoArchery} && ${Target.Distance}>15) /squelch /stick 12 moveback !front
		/if (${UseMitigate} && ${Me.TargetOfTarget.Name.Equal[${Me}]} && ${Target.Distance} < ${AssistDistance} && ${Me.CombatAbilityReady[${MitigateDisc}]}) /disc ${MitigateDisc} 
		/if (${DoDots} && ${Target.PctHPs}<=${DotAt} && ${Target.PctHPs} > ${MinDotAt} && ${DotTimer}==0 && ${Target.LineOfSight}) /call Dot
		/if (${DoHail} && ${Target.PctHPs}<=${HailAt} && ${Target.PctHPs} > ${MinHailAt} && ${HailTimer}==0 && ${Target.LineOfSight}) /call Hail
		/if (!${Snared} && ${SnareMobs} && ${Target.PctHPs} <= ${KT2SnareAt} && ${Target.LineOfSight}) /call Snare
		/if (${DoNuke} && ${Target.PctHPs}<=${NukeAt} && ${Me.PctMana} > ${MinManaForNuke} && ${NukeTimer}==0 && ${Target.PctHPs} > ${MinNukeAt} && ${HandToHand}) /call Nuke
	}
	/if (!${Target.ID} || ${Target.Type.Equal[Corpse]}) {
		/varset PreEngaged FALSE
		/varset Engaged FALSE
		/delay 1
		/if (${Stick.Status.Equal[ON]}) /squelch /stick off
		/squelch /attack off
		/varset Snared FALSE
		/varset RangeFire FALSE
		/varset HandToHand FALSE
		/varset SelfBuffTimer 0
		/delay 3
		/doevents MobDead
		/return
	}
	/delay 1
	/doevents
	/goto :Combat2
/return

Sub MedTime
	/if (${Cursor.Name.Equal[Wand of Elemental Transvergance]} || ${Cursor.Name.Equal[Rod of Mystical Transvergance]} || ${Cursor.Name.Equal[Summoned: Modulating Rod]}) /autoinventory
	/if (${Me.PctMana}<=70&&((${FindItem[Wand of Elemental Transvergance].InvSlot}&&!${FindItem[Wand of Elemental Transvergance].TimerReady})||(${FindItem[Rod of Mystical Transvergance].InvSlot}&&!${FindItem[Rod of Mystical Transvergance].TimerReady})||(${FindItem[Summoned: Modulating Rod].InvSlot}&&!${FindItem[Summoned: Modulating Rod].TimerReady}))) {
		/if (${FindItem[Wand of Elemental Transvergance].InvSlot}) {
			/call Cast "Wand of Elemental Transvergance" item
		} else /if (${FindItem[Rod of Mystical Transvergance].InvSlot}) {
			/call Cast "Rod of Mystical Transvergance" item
		} else /if (${FindItem[Summoned: Modulating Rod].InvSlot}) {
			/call Cast "Summoned: Modulating Rod" item
		}
	}
		/call ReturnHome2
		/if (${Me.State.Equal[Stand]} && ${Me.PctMana}<75 && ${Me.CombatState.Equal[ACTIVE]} && !${Me.Moving} && !${Me.Mount.ID} &&  !${NearestSpawn[1, NPC radius 30 zradius 30].ID}) /sit
		/if (${Me.State.Equal[Sit]}) {
			/if (${NearestSpawn[1, NPC radius 29 zradius 29].ID} || ${Me.PctMana}>86 || ${Following}) /stand
		}
/return

Sub WeaponShield
	/if (${Me.AltAbility[Protection of the Spirit Wolf].ID} && ${Me.AltAbilityReady[Protection of the Spirit Wolf]} && !${Me.Pet.ID}) {
		/if (${Verbose}) /bct ${bcChannel} Health too low! Summoning a Spirit Wolf!
		/call Cast "Protection of the Spirit Wolf" alt
		/return
	}
	/if (${Me.CombatAbilityReady[Weapon Shield Discipline]}) {
		/disc Weapon Shield Discipline
		/if (${Verbose}) /bct ${bcChannel} Going into Riposte mode!  Will need healing within 18 seconds!
	}
/return

Sub ReadyForNext
	/call Check_grpHPs
	/if (!${Me.Combat} && !${Me.Invis} && !${Me.Moving} && !${SpawnCount[npc radius 20 zradius 30]} && !${Me.Casting.ID} && !${Following}) {
		/delay 15 !${Me.Moving}
		/if (${SelfBuffs} && !${SelfBuffTimer}) /call MaintainSelfBuffs
		/delay 15 !${Me.Moving}
		/if (${QueueCount} && ${Me.PctMana}>${DoBuffMana} && ${DoBuffs}) /call DoBuffEvents
		/if (${RaidQueueCount} && ${Me.PctMana}>${DoBuffMana} && ${DoRaidBuffs}) /call RaidBuffEvents
		/call MedTime
	}
	/if (${Target.ID} && ${Target.Type.Equal[PC]}) /squelch /target clear
	/varset Closeness ${OriginalClose}
/return

Sub ResetVars
	/if (${Zone.ID}!=${currentZone}) /call Event_Zoned
	/doevents
	/delay 1
	/attack off
	/if (${Target.ID} && ${Target.ID}!=${Me.ID} && (${Spawn[${Target.ID}].Type.NotEqual[NPC]} || ${Spawn[${Target.ID}].Master.Type.NotEqual[NPC]})) /squelch /target clear
	/varset Engaged FALSE
	/varset Snared FALSE
/return

Sub Check_grpHPs
	/declare i int local 1
	/if (!${Me.Gem[${HealSpell}]}) /memspell ${HealSpellGem} ${HealSpell}
	/if (${Me.CurrentMana}<${Spell[${HealSpell}].Mana} || !${Me.SpellReady[${HealSpell}]}) /return
	/if (${Me.PctHPs} < ${MeleeHeals}) {
		/if (${Stick.Status.Equal[ON]}) /squelch /stick pause
		/delay 3 !${Me.Moving}
		/target myself
		/delay 1s ${Target.ID}==${Me.ID}
		/if (${Target.ID}==${Me.ID}) {
			/if (${Verbose}) /bct ${bcChannel} Casting ${HealSpell} on ${Target.CleanName}
			/call Cast "${HealSpell}" ${HealSpellGem} 0 CheckHP
			/if (${Engaged} && ${TargetArray[4]}) {
				/squelch /target id ${TargetArray[4]}
				/delay 1s ${Target.ID}==${TargetArray[4]}
				/if (${Target.ID} && ${Target.Type.Equal[NPC]}) /face fast nolook
			}
		}
	}
	/for i 1 to ${Group.Members}
    /if (${Spawn[pc ${Group.Member[${i}]}].ID} && ${Group.Member[${i}].Type.NotEqual[Corpse]} && ${Group.Member[${i}].Distance}<=${Spell[${HealSpell}].MyRange} && (${Group.Member[${i}].Name.NotEqual[${TankName}]} && ((${Select[${Group.Member[${i}].Class.ShortName},CLR,DRU,SHM,WIZ,MAG,ENC,NEC]} && ${Group.Member[${i}].PctHPs}<=${CasterHeals}) || (${Select[${Group.Member[${i}].Class.ShortName},WAR,MNK,ROG,RNG,BST,SHD,PAL,BER,BRD]} && ${Group.Member[${i}].PctHPs}<=${MeleeHeals}))) || (${Group.Member[${i}].Name.Equal[${TankName}]} && ${Group.Member[${i}].PctHPs}<=${MTHP})) {
		:SpellReadyLoop2
			/if (${Target.ID} && ${Target.Type.Equal[NPC]}) /face fast nolook
			/delay 1
			/if (!${Me.SpellReady[${HealSpell}]}) /goto :SpellReadyLoop2
			/if (${Stick.Status.Equal[ON]}) /squelch /stick pause
			/delay 3 !${Me.Moving}
			/target id ${Group.Member[${i}].ID}
			/delay 1s ${Group.Member[${i}].ID}==${Target.ID}
			/if (!${Target.ID}||${Target.ID}!=${Group.Member[${i}].ID}) /goto :NextGMember
			/if (${Verbose}) /bct ${bcChannel} Casting ${HealSpell} on ${Target.CleanName}
			/call Cast "${HealSpell}" ${HealSpellGem} 0 CheckHP
    }
	:NextGMember
		/next i
		/if (${Target.ID} && ${Target.Type.Equal[NPC]}) /face fast nolook
		/if (${Stick.Status.Equal[PAUSED]}) /squelch /stick unpause
		/if ((${Target.ID} && ${Target.Type.Equal[PC]}) || ${Target.ID}==${Me.ID}) /squelch /target clear
		/if (${Engaged} && ${TargetArray[4]}) {
			/squelch /target id ${TargetArray[4]}
			/delay 1s ${Target.ID}==${TargetArray[4]}
		}
/return

Sub CheckHP
	/if (${Target.PctHPs}>=80) /call Interrupt
/return

Sub Snare
	/if (${Stick.Status.Equal[ON]}) /squelch /stick pause
	/delay 3 !${Me.Moving}
	/if (${Me.SpellReady[${SnareSpell}]} || ${Me.AltAbilityReady[${SnareSpell}]} && !${Me.Moving}) /call cast "${SnareSpell}" ${SnareSpellGem} 3s
	:castloop
		/if (${Target.ID} && ${Target.Type.Equal[NPC]}) /face fast nolook
		/if (${Me.Casting.ID}) {
			/delay 3
			/goto :castloop
		}
		/if (${Stick.Status.Equal[PAUSED]}) /squelch /stick unpause
		/doevents
/return

Sub Dot
	/delay 5
	/if (${Stick.Status.Equal[ON]}) /squelch /stick pause
	/delay 3 !${Me.Moving}
	/if (${Me.SpellReady[${DotSpell}]} && !${Me.Moving}) /call cast "${DotSpell}" ${DotSpellGem} 2s
	:castloop
		/if (${Target.ID} && ${Target.Type.Equal[NPC]}) /face fast nolook
		/if (${Me.Casting.ID}) {
			/delay 3
			/goto :castloop
		}
		/if (${Stick.Status.Equal[PAUSED]}) /squelch /stick unpause
		/varset DotTimer ${DotDelay}
/return

Sub Hail
	/delay 5
	/if (${Stick.Status.Equal[ON]}) /squelch /stick pause
	/delay 3 !${Me.Moving}
	/if (${Target.ID} && ${Target.Type.Equal[NPC]}) /face fast nolook
	/if (${Me.SpellReady[${HailSpell}]} && !${Me.Moving}) /call cast "${HailSpell}" ${HailSpellGem} 2s
	:castloop
		/if (${Target.ID} && ${Target.Type.Equal[NPC]}) /face fast nolook
		/if (${Me.Casting.ID}) {
			/delay 3
			/goto :castloop
		}
		/if (${Stick.Status.Equal[PAUSED]}) /squelch /stick unpause
		/varset HailTimer ${HailDelay}
/return

Sub Nuke
	/if (${Stick.Status.Equal[ON]}) /squelch /stick pause
	/delay 3 !${Me.Moving}
	/if (${Me.SpellReady[${FirstNuke}]} && !${Me.Moving}) /call Cast "${FirstNuke}" ${FirstNukeGem} 2s
	/if (${DoNukeTwo} && ${Me.SpellReady[${SecondNuke}]} && !${Me.Moving}) /call Cast "${SecondNuke}" ${SecondNukeGem} 2s
	:castloop
		/if (${Target.ID} && ${Target.Type.Equal[NPC]}) /face fast nolook
		/if (${Me.Casting.ID}) {
			/delay 3
			/goto :castloop
		}
		/if (${Stick.Status.Equal[PAUSED]}) /squelch /stick unpause
		/varset NukeTimer ${NukeDelay}
/return

Sub AddToQueue(int Buffee,int BuffNumber)
	/declare a int local
	/declare Compare int local
	/if (${QueueCount}<25 && ${Spawn[${Buffee}].Type.NotEqual[Corpse]} && ${Spawn[${Buffee}].ID}) {
			/varset Compare 0
			/for a 1 to 25
			/if ((${Buffee}==${DoBuffQueue[${a},1]} || (${Select[${Spell[${DoBuffID[${DoBuffQueue[${a},2]}]}].TargetType},"Group v2","AE PC v2","Group v1","AE PC v1"]} && ${Group.Member[${Spawn[${Buffee}].CleanName}]} && ${Group.Member[${Spawn[${DoBuffQueue[${a},1]}].CleanName}]})) && ${BuffNumber}==${DoBuffQueue[${a},2]}) /varset Compare 1
			/next a
			/if (!${Compare}) {
				/for a 1 to 25
				/if (!${DoBuffQueue[${a},1]}) {
				/varset DoBuffQueue[${a},1] ${Buffee}
				/varset DoBuffQueue[${a},2] ${BuffNumber}
				/varcalc QueueCount ${QueueCount}+1
			/return
			}
			/next a
			}
	}
	:DoneQueueing
/return

Sub RemoveFromQueue(int Buffee,int BuffNumber)
	/declare a int local
	/for a 1 to 25
	/if (((${Spawn[${DoBuffQueue[${a},1]}].State.Equal["DEAD"]} || !${Spawn[${DoBuffQueue[${a},1]}].ID}) || (${DoBuffQueue[${a},1]}==${Buffee} && ${DoBuffQueue[${a},2]}==${BuffNumber})) && ${DoBuffQueue[${a},1]}) {
		/varset DoBuffQueue[${a},1] 0
		/varset DoBuffQueue[${a},2] 0
		/varcalc QueueCount ${QueueCount}-1
    /return
    }
	/next a
/return

Sub MaintainSelfBuffs(SelfBuffGem)
	/if ((${SelfBuffTimer}>=1)||(${Following})) /return
	/declare i int local
	/declare a int local
	/if (${Target.ID}) /declare OldTarget int local ${Target.ID}
	/for i 1 to ${SelfBuffTotal}
    /if (${Me.State.NotEqual[FEIGN]} && ${Spell[${SelfBuffID[${i}]}].Stacks[35]} && ${Me.CountBuffs}<=${SelfBuffCount${i}} && (!${SitTimer} || ${Me.Gem[${SelfBuff${i}}]} || ${Me.Mount.ID} || ${SelfBuffGem${i}.Equal[item]} || (${SelfBuffGem${i}.Equal[alt]} && ${Me.AltAbilityReady[${SelfBuff${i}}]})) && (${Outdoors} || ${SelfBuffIndoors${i}})) {
		/if (${Me.CurrentMana}<${Spell[${SelfBuff${i}}].Mana} && !${Select[${SelfBuffGem${i}},alt,item]}) /return
		/if (${Select[${Spell[${SelfBuffID[${i}]}].TargetType},pc,Single]}) {
			/squelch /target id ${Me.ID}
			/delay 1s ${Target.ID}==${Me.ID}
		}
		/if (${Stick.Status.Equal[ON]}) /squelch /stick pause 
		/popup Refreshing ${SelfBuff${i}}
		/call Cast "${SelfBuff${i}}" ${SelfBuffGem${i}} 5s
		/delay 2s ${Me.SpellReady[${SelfBuff${i}}]}
		/if (${castReturn.Equal[CAST_SUCCESS]}) {
			/varset SelfBuffTimer ${SelfBuffRecheck}
			/if (${Spawn[${OldTarget}].ID}) {
				/if (${Target.ID}==${Me.ID}) /target id ${OldTarget}
			} else {
				/squelch /target clear
				}
			/if (${Stick.Status.Equal[PAUSED]}) /squelch /stick unpause
			/delay 5
			/return
		}
		/if (${Stick.Status.Equal[PAUSED]}) /squelch /stick unpause
    }
	/next i
	/if (${DoCures} && ${CureTotal} && !${Me.Casting.ID}) /call CureMe
	/if (${UseAura} && ${Me.Aura.ID}==NULL && ${Spell[${AuraBuff}].Stacks[0]}) {
		/if (${Me.CurrentMana}<${Spell[${AuraBuff}].Mana} && !${Select[${AuraBuffGem},alt,comb,item]}) /goto :AuraDone
		/if ((!${SitTimer} || ${Me.Gem[${AuraBuff}]} || ${Me.Mount.ID}) && ${Me.State.NotEqual[FEIGN]}) {
			/squelch /target id ${Me.ID}
			/delay 1s ${Target.ID}==${Me.ID}
			/if (${Stick.Status.Equal[ON]}) /squelch /stick pause
			/if (${AuraBuffGem.Equal[comb]} && ${Me.Endurance}>${AuraEndurance}) {
				/disc ${AuraBuff}
				/delay 5s !${Me.Aura.ID}==NULL
			/goto :AuraDone
			}
			/if (${AuraBuffGem.Equal[item]} && !${FindItem[${AuraBuff}].TimerReady}) {
				/echo Item Aura not supported yet...
				/varset ${UseAura} FALSE
			/goto :AuraDone
			}
			/if (${AuraBuffGem.Equal[alt]} && ${Me.AltAbilityReady[${AuraBuff}]}) {
				/echo There are no known AltAbility Aura yet...
				/varset ${UseAura} FALSE
			/goto :AuraDone
			}
			/if (${Me.CurrentMana}>${Spell[${AuraBuff}].Mana}) {
				/call Cast "${AuraBuff}" ${AuraBuffGem} 10s Check_grpHPs
			/goto :AuraDone
			}
		}
	}
	:AuraDone
		/if (${Spawn[${OldTarget}].ID}) {
			/if (${Target.ID}==${Me.ID}) /target id ${OldTarget}
		} else {
			/squelch /target clear
		}
		/if (${Stick.Status.Equal[PAUSED]}) /squelch /stick unpause
		/delay 1
		/doevents
		/if (${Target.ID} && ${Target.ID}==${TargetArray[4]} && ${Target.Type.Equal[NPC]}) /face fast nolook
/return

Sub CureMe
	/declare i int local
	/if (${Target.ID}) /declare OldTarget int local ${Target.ID}
	/for i 1 to ${CureTotal}
	/if (!${Following} && !${Me.Invis} && ${Debuff} && ((${Debuff.Cursed} && ${Debuff.Cursed}<=${CurseCounters${i}}) || (${Debuff.Diseased} && ${Debuff.Diseased}<=${DiseaseCounters${i}}) || (${Debuff.Poisoned} && ${Debuff.Poisoned}<=${PoisonCounters${i}}) || (${Debuff.Corrupted} && ${Debuff.Corrupted}<=${CorruptCounters${i}}))) {
		/if (((${Me.SpellReady[${CureSpell${i}}]} || (!${Me.Gem[${CureSpell${i}}]} && ${Me.Book[${CureSpell${i}}]})) || ${Me.AltAbilityReady[${CureSpell${i}}]} || ${CureGem${i}.Equal[item]})) {
			/target id ${Me.ID}
		    /delay 1s ${Target.ID}==${Me.ID}
		    /if (${ReportCures} && ${Verbose}) /bct ${bcChannel} Curing myself with ${CureSpell${i}}
		    /call Cast "${CureSpell${i}}" ${CureGem${i}} 2s Check_grpHPs
		    /delay 1
			/if (${Spawn[${OldTarget}].ID}) {
				/if (${Target.ID}!=${Spawn[${OldTarget}].ID}) /target id ${OldTarget}
			} else {
				/squelch /target clear
			}
	    }
    }
	/next i
/return

Sub DoBuffEvents
	/if ((${Following})||(${Engaged})) /return
	/if (${Target.ID}) /declare OldTarget int local ${Target.ID}
	/declare a int local
	/for a 1 to 25
		/if (!${PreviousSpell} || (${PreviousSpell}!=${Spell[${DoBuffID[${DoBuffQueue[${a},2]}]}].ID})) /goto :SetCheck
		/if (${PreviousSpell}==${Spell[${DoBuffID[${DoBuffQueue[${a},2]}]}].ID}) {
			/call RemoveFromQueue ${DoBuffQueue[${a},1]} ${DoBuffQueue[${a},2]}
			/timed 200 /varset PreviousSpell 0
			/goto :NextDoBuff
		}
  	:SetCheck
		/if ((${Spawn[${DoBuffQueue[${a},1]}].Distance}>${Spell[${DoBuffID[${DoBuffQueue[${a},2]}]}].MyRange} && ${Spawn[${DoBuffQueue[${a},1]}].Distance}>${Spell[${DoBuffID[${DoBuffQueue[${a},2]}]}].AERange}) || !${Spawn[${DoBuffQueue[${a},1]}].ID} || ((!${Me.SpellReady[${DoBuff${DoBuffQueue[${a},2]}}]} && ${Me.Gem[${DoBuff${DoBuffQueue[${a},2]}}]}) && ${DoBuffGem${DoBuffQueue[${a},2]}.NotEqual[item]} && ${DoBuffGem${DoBuffQueue[${a},2]}.NotEqual[alt]})) /goto :NextDoBuff
		/squelch /target id ${DoBuffQueue[${a},1]}
		/delay 1s ${Target.ID}==${DoBuffQueue[${a},1]}
		/if (${Target.ID}==${DoBuffQueue[${a},1]} && ${Target.Distance}<=${Spell[${DoBuffID[${DoBuffQueue[${a},2]}]}].MyRange}) {
			/if (${DoBuffTells} && !${SpamTimer}) /tt ${DoBuffIcon${DoBuffQueue[${a},2]}} inc
			/varset SpamTimer 100
			/if (${Stick.Status.Equal[ON]}) /squelch /stick pause
			/if (${Target.ID}==${DoBuffQueue[${a},1]}) /call Cast "${DoBuff${DoBuffQueue[${a},2]}}" ${DoBuffGem${DoBuffQueue[${a},2]}} 5s
			/if (${Select[${Spell[${DoBuffID[${DoBuffQueue[${a},2]}]}].TargetType},"Group v2","AE PC v2","Group v1","AE PC v1"]}) /varset PreviousSpell ${Spell[${DoBuffID[${DoBuffQueue[${a},2]}]}].ID}
			/if (${castReturn.Equal[CAST_SUCCESS]} || ${spellNotHold}) {
				/call RemoveFromQueue ${DoBuffQueue[${a},1]} ${DoBuffQueue[${a},2]}
				/if (${Spawn[${OldTarget}].ID}) {
					/if (${Target.ID}!=${Spawn[${OldTarget}].ID}) /target id ${OldTarget}
				} else {
					/squelch /target clear
				}
			/return
			}
			/if (${Stick.Status.Equal[PAUSED]}) /squelch /stick unpause
		}
    :NextDoBuff
		/next a
		/if (${Spawn[${OldTarget}].ID}) {
			/if (${Target.ID}!=${Spawn[${OldTarget}].ID}) /target id ${OldTarget}
		} else {
			/squelch /target clear
		}
		/if (${Engaged} && ${TargetArray[4]} && ${Target.Type.Equal[NPC]}) {
			/squelch /target id ${TargetArray[4]}
			/delay 1s ${Target.ID} == ${TargetArray[4]}
			/face fast nolook
		}
		/if (${Stick.Status.Equal[PAUSED]}) /squelch /stick unpause
/return

Sub AddToRaidQueue(int Buffee,int BuffNumber)
	/declare a int local
	/declare Compare int local
	/if (${RaidQueueCount}<72&&${Spawn[${Buffee}].Type.NotEqual[Corpse]}&&${Spawn[${Buffee}].ID}) {
		/varset Compare 0
		/for a 1 to 72
		/if ((${Buffee}==${RaidBuffQueue[${a},1]}||(${Select[${Spell[${RaidBuffID[${RaidBuffQueue[${a},2]}]}].TargetType},"Group v2","AE PC v2","Group v1","AE PC v1"]}&&${Group.Member[${Spawn[${Buffee}].CleanName}]}&&${Group.Member[${Spawn[${RaidBuffQueue[${a},1]}].CleanName}]}))&&${BuffNumber}==${RaidBuffQueue[${a},2]}) /varset Compare 1
		/next a
		/if (!${Compare}) {
			/for a 1 to 72
			/if (!${RaidBuffQueue[${a},1]}) {
				/varset RaidBuffQueue[${a},1] ${Buffee}
				/varset RaidBuffQueue[${a},2] ${BuffNumber}
				/varcalc RaidQueueCount ${RaidQueueCount}+1
			/return
			}
		/next a
		}
	}
/return

Sub RemoveFromRaidQueue(int Buffee,int BuffNumber)
  /declare a int local
  /for a 1 to 72
    /if (((${Spawn[${RaidBuffQueue[${a},1]}].State.Equal["DEAD"]}||!${Spawn[${RaidBuffQueue[${a},1]}].ID})||(${RaidBuffQueue[${a},1]}==${Buffee}&&${RaidBuffQueue[${a},2]}==${BuffNumber}))&&${RaidBuffQueue[${a},1]}) {
      /varset RaidBuffQueue[${a},1] 0
      /varset RaidBuffQueue[${a},2] 0
      /varcalc RaidQueueCount ${RaidQueueCount}-1
      /return
    }
  /next a
/return

Sub RaidBuffEvents
	/declare a int local
	/if (${Target.ID}) /declare OldTarget int local ${Target.ID}
	/for a 1 to 72
    /if ((${Spawn[${RaidBuffQueue[${a},1]}].Distance}>${Spell[${RaidBuffID[${RaidBuffQueue[${a},2]}]}].MyRange}&&${Spawn[${RaidBuffQueue[${a},1]}].Distance}>${Spell[${RaidBuffID[${RaidBuffQueue[${a},2]}]}].AERange})||!${Spawn[${RaidBuffQueue[${a},1]}].ID}||((!${Me.SpellReady[${RaidBuff${RaidBuffQueue[${a},2]}}]}&&${Me.Gem[${RaidBuff${RaidBuffQueue[${a},2]}}]})&&${RaidBuffGem${RaidBuffQueue[${a},2]}.NotEqual[item]}&&${RaidBuffGem${RaidBuffQueue[${a},2]}.NotEqual[alt]})) /goto :NextRaidBuff
    /squelch /target id ${RaidBuffQueue[${a},1]}
    /delay 1s ${Target.ID}==${RaidBuffQueue[${a},1]}
    /if (${Target.ID}==${RaidBuffQueue[${a},1]}&&${Target.Distance}<=${Spell[${RaidBuffID[${RaidBuffQueue[${a},2]}]}].MyRange}) {
		/if (${DoBuffTells}&&!${SpamTimer}&&${Target.ID}!=${Me.ID}) /tt ${RaidBuffIcon${RaidBuffQueue[${a},2]}} inc
		/call Cast "${RaidBuff${RaidBuffQueue[${a},2]}}" ${RaidBuffGem${RaidBuffQueue[${a},2]}} 3s Check_grpHPs
		/if (${castReturn.Equal[CAST_SUCCESS]} || ${spellNotHold}) /call RemoveFromRaidQueue ${RaidBuffQueue[${a},1]} ${RaidBuffQueue[${a},2]}
		/if (${Spawn[${OldTarget}].ID}) {
			/if (${Target.ID}!=${Spawn[${OldTarget}].ID}) /target id ${OldTarget}
		} else {
			/squelch /target clear
		}
		/return
    }
	:NextRaidBuff
		/next a
/return

Sub DisplayDPS
	/varcalc fightTotalTime (${MacroQuest.Running}-${fightStartTime})/1000
	/varcalc totalMeleeDmg ${totalMeleeDmg}
	/varcalc totalNonMeleeDmg ${totalNonMeleeDmg}/2
	/echo Fight Duration: ${fightTotalTime} seconds
	/echo Melee Damage: ${totalMeleeDmg}
	/echo NonMelee Damage: ${totalNonMeleeDmg}
	/echo --------------------------------------------
	/echo Total Damage: ${Math.Calc[${totalMeleeDmg}+${totalNonMeleeDmg}]}
	/echo DPS: ${Math.Calc[(${totalMeleeDmg}+${totalNonMeleeDmg})/${fightTotalTime}]}
	/echo --------------------------------------------
	/varset fightStartTime 0
	/varset totalNonMeleeDmg 0
	/varset totalMeleeDmg 0
/return

Sub SetAliases
	/echo Version Mismatch Detected, Loading Aliases
	/ini ${Me.Name}_RangerBot.ini Misc LoadDate ${MacroQuest.BuildDate}
	/ini ${Me.Name}_RangerBot.ini Misc Version ${Version}
	/squelch /alias /anchor          /echo Setting Anchor
	/squelch /alias /autocombat      /echo ToggleVar Setting Auto Combat,AutoCombat,Settings,AutoCombat,
	/squelch /alias /autoloot        /echo ToggleVar Auto Looting,useAutoLoot,Settings,useAutoLoot,
	/squelch /alias /archery         /echo ToggleVar Auto Archery,AutoArchery,Settings,AutoArchery,
	/squelch /alias /archerydistance /echo ToggleString Archery Distance,ArcheryDistance,Settings,ArcheryDistance,
	/squelch /alias /assistat        /echo ToggleString Assist At,AssistAt,Settings,AssistAt,
	/squelch /alias /assistdistance  /echo ToggleString Assist Distance,AssistDistance,Settings,AssistDistance,
	
	/squelch /alias /campradius      /echo ToggleString Camp Radius,CampRadius,Settings,CampRadius,
	/squelch /alias /casterheal      /echo ToggleString Caster Heals,CasterHeals,Settings,CasterHeals,
	/squelch /alias /dobufftells     /echo ToggleVar Do Buff Tells,DoBuffTells,DoBuffStuff,DoBuffTells,
	/squelch /alias /docures         /echo ToggleVar Setting Auto Curing,DoCures,CureStuff,DoCures,
	/squelch /alias /dodots          /echo ToggleVar Using Dots,DoDots,DotStuff,DoDots,
	/squelch /alias /dohail          /echo ToggleVar Using Hail,DoHail,HailStuff,DoHail,
	/squelch /alias /donukes         /echo ToggleVar Using Nukes,DoNuke,NukeStuff,DoNuke,
	/squelch /alias /donuketwo       /echo ToggleVar Using Second Nuke,DoNukeTwo,NukeStuff,DoNukeTwo,
	/squelch /alias /doraidbuffs     /echo ToggleVar Setting Raid Buffing,DoRaidBuffs,RaidBuffs,DoRaidBuffs,
	/squelch /alias /dotat           /echo ToggleString Dot At,DotAt,DotStuff,DotAt,
	/squelch /alias /dotdelay        /echo ToggleString Dot Delay,DotDelay,DotStuff,DotDelay,
	
	/squelch /alias /Hailat           /echo ToggleString Hail At,HailAt,HailStuff,HailAt,
	/squelch /alias /Haildelay        /echo ToggleString Hail Delay,HailDelay,HailStuff,HailDelay,
	
	/squelch /alias /kt2snareat      /echo ToggleString Assist Mode Snare At,KT2SnareAt,SnareStuff,KT2SnareAt,
	/squelch /alias /meleeheal       /echo ToggleString Melee Heals,MeleeHeals,Settings,MeleeHeals,
	/squelch /alias /mitigate        /echo ToggleVar Setting Mitigation,UseMitigate,Settings,UseMitigate,
	/squelch /alias /movehome        /echo ToggleVar Setting Move Home,MoveHome,Settings,MoveHome,
	/squelch /alias /nukeat          /echo ToggleString Nuke At,NukeAt,NukeStuff,NukeAt,
	/squelch /alias /nukedelay       /echo ToggleString Nuke Delay,NukeDelay,NukeStuff,NukeDelay,


	/squelch /alias /useaura         /echo ToggleVar Setting use aura,UseAura,SelfBuffStuff,UseAura,
	/squelch /alias /usedps          /echo ToggleVar Setting use Dps to,useDPS,Settings,useDPS,
	/squelch /alias /usetaunt        /echo ToggleVar Setting Taunt,HoldAgro,Settings,HoldAgro,
	/squelch /alias /pullback        /echo ToggleString Pull back Distance,PullBackDistance,Settings,PullBackDistance,
	/squelch /alias /snare           /echo ToggleVar Using Snare,SnareMobs,SnareStuff,SnareMobs,
	/squelch /alias /snareat         /echo ToggleString Pull Mode Snare At,SnareAt,SnareStuff,SnareAt,
	
	/squelch /alias /tankheal        /echo ToggleString Tank Heal Point,TankHealPoint,Settings,MTHP,
	/squelch /alias /toggleMT        /echo Setting new main tank to: ${TankName}
	/squelch /alias /verbose         /echo ToggleVar Setting Announcements,Verbose,Settings,Verbose,
	/squelch /alias /cleancorpses    /echo Clean Corpses
/return

Sub LoadVar(IniSection,IniVar,IniValue,MacroVar,IniFile,Function,VarType)
	/declare IniString string local
	/if (!${Defined[${MacroVar}]} && ${Defined[VarType]}) /declare ${MacroVar} ${VarType} outer
	/if (${Function.Equal[LOAD]}) {
		/varset IniString ${Ini[${IniFile},${IniSection},${IniVar},NOTFOUND]}
		/varset ${MacroVar} ${IniString}
	}
	/if (${IniString.Equal["NOTFOUND"]} || ${Function.Equal[SAVE]}) {
		/if (${IniString.Equal["NOTFOUND"]} && ${Function.Equal[LOAD]}) /varset ${MacroVar} ${IniValue}
		/ini ${IniFile} ${IniSection} ${IniVar} "${${MacroVar}}"
	}
/return

Sub LoadIni(IniFile,Function)
	/declare i int local
	/if (!${Defined[HomeXLoc]})         /declare HomeXLoc          int outer ${Me.X}
	/if (!${Defined[HomeYLoc]})         /declare HomeYLoc          int outer ${Me.Y}
	/if (!${Defined[TRadius]})          /declare TRadius           int outer 0
	/if (!${Defined[HomeY]})            /declare HomeY             int outer 0
	/if (!${Defined[HomeX]})            /declare HomeX             int outer 0
	/if (!${Defined[MyHeading]})        /declare MyHeading         int outer ${Me.Heading.DegreesCCW}
	/if (!${Defined[StuckXLoc]})        /declare StuckXLoc       float outer 0.0
	/if (!${Defined[StuckYLoc]})        /declare StuckYLoc       float outer 0.0
	/if (!${Defined[totalMeleeDmg]})    /declare totalMeleeDmg     int outer
	/if (!${Defined[totalNonMeleeDmg]}) /declare totalNonMeleeDmg  int outer
	/if (!${Defined[fightStartTime]})   /declare fightStartTime  float outer
	/if (!${Defined[fightTotalTime]})   /declare fightTotalTime  float outer
	/if (!${Defined[Anchor]})           /declare Anchor           bool outer
	/if (!${Defined[AutoFireState]})    /declare AutoFireState    bool outer FALSE
	/if (!${Defined[PreEngaged]})       /declare PreEngaged       bool outer FALSE
	/if (!${Defined[Engaged]})          /declare Engaged          bool outer FALSE
	/if (!${Defined[HandToHand]})       /declare HandToHand       bool outer FALSE
	/if (!${Defined[RunHome]})          /declare RunHome          bool outer FALSE
	/if (!${Defined[Snared]})           /declare Snared           bool outer FALSE
	/if (!${Defined[Tagged]})           /declare Tagged           bool outer FALSE
	/if (!${Defined[TargetArray]})      /declare TargetArray[4] string outer
	/if (!${Defined[PathFile]})         /declare PathFile       string outer

	/if (!${Defined[Following]})        /declare Following        bool outer FALSE
	/if (!${Defined[FollowGuy]})        /declare FollowGuy      string outer NULL
	/if (!${Defined[Outside]})          /declare Outside          bool outer TRUE
	/if (!${Defined[Paused]})           /declare Paused           bool outer FALSE
	/if (!${Defined[JustZoned]})        /declare JustZoned        bool outer FALSE
	/if (!${Defined[InitVars]})         /declare InitVars         bool outer FALSE

	/if (!${Defined[NukeTimer]})        /declare NukeTimer       timer outer 0
	/if (!${Defined[DotTimer]})         /declare DotTimer        timer outer 0
	/if (!${Defined[HailTimer]})         /declare HailTimer        timer outer 0
	/if (!${Defined[SitTimer]})         /declare SitTimer        timer outer 0
	/if (!${Defined[SpamTimer]})        /declare SpamTimer       timer outer 0
	/if (!${Defined[noInvis]})          /declare noInvis           int outer 1
	/if (!${Defined[PreviousSpell]})    /declare PreviousSpell     int outer 0
	/if (!${Defined[ExcludeList]})      /declare ExcludeList    string outer
	/if (!${Defined[TankName]})         /declare TankName       string outer ${Target}
	/if (!${Defined[TankID]})           /declare TankID            int outer
	/if (!${Defined[OriginalClose]})    /declare OriginalClose     int outer ${Closeness}
	/if (!${Defined[Closeness]})        /declare Closeness         int outer 20
	/if (!${Defined[currentZone]})      /declare currentZone       int outer
	/if (!${Defined[SnareCounter]})     /declare SnareCounter      int outer
	/if (!${Defined[DeathFlag]})        /declare DeathFlag        bool outer ${Math.Calc[!(${InvSlot[chest].Item.ID}>0)]}
	
	/call LoadVar Settings bcChannel "Put your bc chat channel here" bcChannel "${IniFile}" ${Function} string
	/call LoadVar Settings MySpellSet "Put your spell set here" MySpellSet "${IniFile}" ${Function} string
	/call LoadVar Settings MyBandolier "Put your Bandolier set here" MyBandolier "${IniFile}" ${Function} string
	/call LoadVar Settings DefaultMT "Put your default MT here" DefaultMT "${IniFile}" ${Function} string
	/call LoadVar Settings Verbose TRUE Verbose "${IniFile}" ${Function} bool
	
	/call LoadVar Settings CampRadius 220 CampRadius "${IniFile}" ${Function} int
	/call LoadVar Settings MoveHome TRUE MoveHome "${IniFile}" ${Function} bool



	/call LoadVar Settings HoldAgro TRUE HoldAgro "${IniFile}" ${Function} bool
	/call LoadVar Settings AutoCombat FALSE AutoCombat "${IniFile}" ${Function} bool
	/call LoadVar Settings UseMitigate FALSE UseMitigate "${IniFile}" ${Function} bool
	/call LoadVar Settings MitigateDisc "Jolting Frontkicks Rk. III" MitigateDisc "${IniFile}" ${Function} string
	/call LoadVar Settings MaxZ 100 MaxZ "${IniFile}" ${Function} int
	/call LoadVar Settings MinZ -100 MinZ "${IniFile}" ${Function} int

	/call LoadVar Settings AssistDistance 200 AssistDistance "${IniFile}" ${Function} int
	/call LoadVar Settings AssistAt 99 AssistAt "${IniFile}" ${Function} int
	/call LoadVar Settings AutoArchery TRUE AutoArchery "${IniFile}" ${Function} bool
	/call LoadVar Settings ArcheryDistance 80 ArcheryDistance "${IniFile}" ${Function} int
	/call LoadVar Settings CasterHeals 60 CasterHeals "${IniFile}" ${Function} int
	/call LoadVar Settings MeleeHeals 40 MeleeHeals "${IniFile}" ${Function} int
	/call LoadVar Settings TankHealPoint 35 MTHP "${IniFile}" ${Function} int
	/call LoadVar Settings HealSpell "Oceangreen Aquifer Rk. II" HealSpell "${IniFile}" ${Function} string
	/call LoadVar Settings HealSpellGem "Gem2" HealSpellGem "${IniFile}" ${Function} string
	/call LoadVar Settings useAutoLoot TRUE useAutoLoot "${IniFile}" ${Function} bool
	/call LoadVar Settings useDPS FALSE useDPS "${IniFile}" ${Function} bool
	/call LoadVar Settings PullBackDistance 60 PullBackDistance "${IniFile}" ${Function} int
	/call LoadVar Settings ZoneDelay 10 ZoneDelay "${IniFile}" ${Function} int
	/call LoadVar SelfBuffStuff SelfBuffTotal 1 SelfBuffTotal "${IniFile}" ${Function} int
	/if (${SelfBuffTotal}) {
		/if (!${Defined[SelfBuffID]}) /declare SelfBuffID[${SelfBuffTotal}] int outer
		/if (!${Defined[SelfBuffTimer]}) /declare SelfBuffTimer timer outer 0
		/call LoadVar SelfBuffStuff SelfBuffs 0 SelfBuffs "${IniFile}" ${Function} int
		/call LoadVar SelfBuffStuff SelfBuffRecheck 10s SelfBuffRecheck "${IniFile}" ${Function} string
		/call LoadVar SelfBuffStuff UseAura FALSE UseAura "${IniFile}" ${Function} bool
		/call LoadVar SelfBuffStuff AuraBuff "Self Aura Spell or Combat Ability full name" AuraBuff "${IniFile}" ${Function} string
		/call LoadVar SelfBuffStuff AuraBuffGem "gem# for spell, comb for combat ability" AuraBuffGem "${IniFile}" ${Function} string
		/call LoadVar SelfBuffStuff AuraEndurance 200 AuraEndurance "${IniFile}" ${Function} int
		/for i 1 to ${SelfBuffTotal}
		/call LoadVar SelfBuffStuff SelfBuff${i} "Self Buff item/Spell #${i}" SelfBuff${i} "${IniFile}" ${Function} string
		/call LoadVar SelfBuffStuff SelfBuffIcon${i} "Self Buff #${i} Buff Icon" SelfBuffIcon${i} "${IniFile}" ${Function} string
		/call LoadVar SelfBuffStuff SelfBuffGem${i} "Self Buff #${i} Gem or put item if an item" SelfBuffGem${i} "${IniFile}" ${Function} string
		/call LoadVar SelfBuffStuff SelfBuffCount${i} 15 SelfBuffCount${i} "${IniFile}" ${Function} int
		/call LoadVar SelfBuffStuff SelfBuffIndoors${i} 0 SelfBuffIndoors${i} "${IniFile}" ${Function} int
		/if (${Select[${SelfBuffGem${i}},item,alt]}) {
			/varset SelfBuffID[${i}] ${Spell[${SelfBuffIcon${i}}].ID}
		} else {
			/varset SelfBuffID[${i}] ${Me.Book[${Me.Book[${SelfBuffIcon${i}}]}].ID}
		}
		/next i
	}
	/call LoadVar CureStuff CureTotal 1 CureTotal "${IniFile}" ${Function} int
	/if (${CureTotal}) {
		/call LoadVar CureStuff DoCures FALSE DoCures "${IniFile}" ${Function} bool
		/call LoadVar CureStuff ReportCures FALSE ReportCures "${IniFile}" ${Function} bool
		/for i 1 to ${CureTotal}
		/call LoadVar CureStuff CureSpell${i} "Cure item/Spell #${i}" CureSpell${i} "${IniFile}" ${Function} string
		/call LoadVar CureStuff CureGem${i} "Cure #${i} Gem or put item if an item" CureGem${i} "${IniFile}" ${Function} string
		/call LoadVar CureStuff CurseCounters${i} "Set this to the # of debuf counters you want this to react to (For example if the spell cures 25 counters and you want it to only cure if it can do it in 2 casts or less, set it to 50)" CurseCounters${i} "${IniFile}" ${Function} int
		/call LoadVar CureStuff DiseaseCounters${i} "Set this to the # of debuf counters you want this to react to (For example if the spell cures 25 counters and you want it to only cure if it can do it in 2 casts or less, set it to 50)" DiseaseCounters${i} "${IniFile}" ${Function} int
		/call LoadVar CureStuff PoisonCounters${i} "Set this to the # of debuf counters you want this to react to (For example if the spell cures 25 counters and you want it to only cure if it can do it in 2 casts or less, set it to 50)" PoisonCounters${i} "${IniFile}" ${Function} int
		/call LoadVar CureStuff CorruptCounters${i} "Set this to the # of debuf counters you want this to react to (For example if the spell cures 25 counters and you want it to only cure if it can do it in 2 casts or less, set it to 50)" CorruptCounters${i} "${IniFile}" ${Function} int
		/next i
	}
	/call LoadVar DoBuffStuff DoBuffTotal 1 DoBuffTotal "${IniFile}" ${Function} int
	/if (${DoBuffTotal}) {
		/if (!${Defined[DoBuffID]}) /declare DoBuffID[${DoBuffTotal}] int outer
		/if (!${Defined[DoBuffQueue]}) /declare DoBuffQueue[25,2] int outer
		/if (!${Defined[QueueCount]}) /declare QueueCount int outer
		/call LoadVar DoBuffStuff DoBuffs 0 DoBuffs "${IniFile}" ${Function} int
		/call LoadVar DoBuffStuff DoBuffTells 0 DoBuffTells "${IniFile}" ${Function} int
		/call LoadVar DoBuffStuff RefreshBuffs 0 RefreshBuffs "${IniFile}" ${Function} int
		/call LoadVar DoBuffStuff DoBuffMana 0 DoBuffMana "${IniFile}" ${Function} int
		/for i 1 to ${DoBuffTotal}
		/call LoadVar DoBuffStuff DoBuff${i} "Do Buff item/Spell #${i}" DoBuff${i} "${IniFile}" ${Function} string
		/call LoadVar DoBuffStuff DoBuffIcon${i} "Do Buff #${i} Buff Icon" DoBuffIcon${i} "${IniFile}" ${Function} string
		/call LoadVar DoBuffStuff DoBuffGem${i} "Do Buff #${i} Gem or put item if an item" DoBuffGem${i} "${IniFile}" ${Function} string
		/call LoadVar DoBuffStuff DoBuffAliases${i} "Put the keywords you want to respond to for this buff" DoBuffAliases${i} "${IniFile}" ${Function} string
		/call LoadVar DoBuffStuff DoBuffIndoors${i} 0 DoBuffIndoors${i} "${IniFile}" ${Function} int
		/call LoadVar DoBuffStuff DoBuffRefresh${i} 0 DoBuffRefresh${i} "${IniFile}" ${Function} int
		/if (${Select[${DoBuffGem${i}},item,alt]}) {
			/varset DoBuffID[${i}] ${Spell[${DoBuffIcon${i}}].ID}
		} else {
			/varset DoBuffID[${i}] ${Me.Book[${Me.Book[${DoBuffIcon${i}}]}].ID}
		}
		/next i
	}
	/call LoadVar RaidBuffs RaidBuffTotal 1 RaidBuffTotal "${IniFile}" ${Function} int
	/if (${RaidBuffTotal}) {
		/if (!${Defined[RaidBuffQueue]}) /declare RaidBuffQueue[72,2] int outer
		/if (!${Defined[RaidQueueCount]}) /declare RaidQueueCount int outer
		/if (!${Defined[RaidBuffID]}) /declare RaidBuffID[${RaidBuffTotal}] int outer
		/call LoadVar RaidBuffs DoRaidBuffs TRUE DoRaidBuffs "${IniFile}" ${Function} bool
		/for i 1 to ${RaidBuffTotal}
		/call LoadVar RaidBuffs RaidBuff${i} "Raid Buff item/Spell #${i}" RaidBuff${i} ${IniFile} ${Function} string
		/call LoadVar RaidBuffs RaidBuffIcon${i} "Raid Buff #${i} Buff Icon" RaidBuffIcon${i} ${IniFile} ${Function} string
		/call LoadVar RaidBuffs RaidBuffGem${i} "Raid Buff #${i} Gem or put item if an item" RaidBuffGem${i} ${IniFile} ${Function} string
		/call LoadVar RaidBuffs RaidBuffIndoors${i} 0 RaidBuffIndoors${i} ${IniFile} ${Function} int
		/if (${Select[${RaidBuffGem${i}},item,alt]}) {
			/varset RaidBuffID[${i}] ${Spell[${RaidBuffIcon${i}}].ID}
		} else {
			/varset RaidBuffID[${i}] ${Me.Book[${Me.Book[${RaidBuffIcon${i}}]}].ID}
		}
		/next i
	}
	/call LoadVar NukeStuff DoNuke TRUE DoNuke "${IniFile}" ${Function} bool
	/call LoadVar NukeStuff FirstNuke "Windwhip Bite Rk. II" FirstNuke "${IniFile}" ${Function} string
	/call LoadVar NukeStuff FirstNukeGem "Gem3" FirstNukeGem "${IniFile}" ${Function} string
	/call LoadVar NukeStuff DoNukeTwo TRUE DoNukeTwo "${IniFile}" ${Function} bool
	/call LoadVar NukeStuff SecondNuke "Cataclysm Ash Rk. II" SecondNuke "${IniFile}" ${Function} string
	/call LoadVar NukeStuff SecondNukeGem "Gem6" SecondNukeGem "${IniFile}" ${Function} string
	/call LoadVar NukeStuff NukeAt 95 NukeAt "${IniFile}" ${Function} int
	/call LoadVar NukeStuff NukeDelay 140 NukeDelay "${IniFile}" ${Function} int
	/call LoadVar NukeStuff MinNukeAt 10 MinNukeAt "${IniFile}" ${Function} int
	/call LoadVar NukeStuff MinManaForNuke 60 MinManaForNuke "${IniFile}" ${Function} int
	/call LoadVar DotStuff DoDots TRUE DoDots "${IniFile}" ${Function} bool
	/call LoadVar DotStuff DotSpell "Bettle Swarm Rk. II" DotSpell "${IniFile}" ${Function} string
	/call LoadVar DotStuff DotSpellGem "Gem1" DotSpellGem "${IniFile}" ${Function} string
	/call LoadVar DotStuff DotAt 95 DotAt "${IniFile}" ${Function} int
	/call LoadVar DotStuff MinDotAt 65 MinDotAt "${IniFile}" ${Function} int
	/call LoadVar DotStuff DotDelay 320 DotDelay "${IniFile}" ${Function} int
	
	/call LoadVar HailStuff DoHail TRUE DoHail "${IniFile}" ${Function} bool
	/call LoadVar HailStuff HailSpell "Barrage of Arrows Rk. II" HailSpell "${IniFile}" ${Function} string
	/call LoadVar HailStuff HailSpellGem "Gem4" HailSpellGem "${IniFile}" ${Function} string
	/call LoadVar HailStuff HailAt 95 HailAt "${IniFile}" ${Function} int
	/call LoadVar HailStuff MinHailAt 10 MinHailAt "${IniFile}" ${Function} int
	/call LoadVar HailStuff HailDelay 320 HailDelay "${IniFile}" ${Function} int
	
	/call LoadVar SnareStuff SnareMobs TRUE SnareMobs "${IniFile}" ${Function} bool
	/call LoadVar SnareStuff SnareSpell "Entrap" SnareSpell "${IniFile}" ${Function} string
	/call LoadVar SnareStuff SnareSpellGem "alt" SnareSpellGem "${IniFile}" ${Function} string
	/call LoadVar SnareStuff SnareAt 97 SnareAt "${IniFile}" ${Function} int
	/call LoadVar SnareStuff KT2SnareAt 75 KT2SnareAt "${IniFile}" ${Function} int
/return

Sub Event_Invite
	/delay 5
	/if (!${Me.Grouped}) /keypress invite_follow
/return



Sub Event_MobDead
	/varset NukeTimer 0
	/varset DotTimer 0
	/varset HailTimer 0
	/if (${Stick.Status.Equal[ON]}) /squelch /stick off
	/squelch /attack off
	/if (${HandToHand}) /varset HandToHand FALSE
	/if (${Engaged}) /varset Engaged FALSE
	/doevents
	/if (${useDPS}) /call DisplayDPS
	/delay 3
	/if (${useAutoLoot} && ${LootMobs} && !${Me.Moving} && ${ACState}<1 ) /call LootMobs
	/doevents
	
		/if (${PreEngaged}) /varset PreEngaged FALSE
		/if (${AutoFireState}) /varset AutoFireState FALSE
		/delay 1
		/keypress forward
		/keypress back
		/if (${Math.Distance[${HomeY},${HomeX}]}>20) /call ReturnHome2
	
	/if (${Stick.Status.Equal[ON]}) /squelch /stick off
	/if (${Target.ID}) /squelch /target clear
/return

Sub Event_TooFarAway
	/if (${Target.Distance} > 50) /return
	/varset Closeness ${Math.Calc[${Closeness}*0.8].Int}
	/if (${Closeness}<20) /varset Closeness 20
	/if (${Target.ID} && ${Target.Type.Equal[NPC]} && ${Math.Distance[${HomeY},${HomeX}]}<20) /squelch /stick 10 moveback
	/delay 1s
/return

Sub Event_Outdoors
	/varset Outside FALSE
/return

Sub Event_Zoned
	/varset Anchor TRUE
	/varset HomeX ${Me.X}
	/varset HomeY ${Me.Y}
	/varset HomeXLoc ${Me.X}
	/varset HomeYLoc ${Me.Y}
	/nomodkey /keypress home
	/echo New Anchor Location: ${HomeX}, ${HomeY}
	/varset currentZone ${Zone.ID}
	/varset Outside TRUE
	/varset ExcludeList ${Ini[${IniFile},"Excludes.${Zone.ShortName}","Exclude"]}
	/if (${ExcludeList.Equal[NULL]}) {
		/ini "${IniFile}" "Excludes.${Zone.ShortName}" "Exclude" "|"
		/varset ExcludeList ${Ini[${IniFile},"Excludes.${Zone.ShortName}","Exclude"]}
		/echo ExcludeList: ${ExcludeList}
	} else {
		/varset ExcludeList ${Ini[${IniFile},"Excludes.${Zone.ShortName}","Exclude"]}
		/echo ExcludeList: ${ExcludeList}
	}
	/if (!${noInvis}) /varset noInvis 1
	/if (!${JustZoned}) /varset JustZoned TRUE

	/varset DeathFlag ${Math.Calc[!(${InvSlot[chest].Item.ID}>0)]}
	/if (${DeathFlag} || ${Me.State.Equal[Hover]} || ${Me.State.Equal[Dead]} || ${Window[RespawnWnd].Open}) /call Event_ImDead
	/target ${TankName}
	/varset TankID ${Target.ID}
	/if (${Following}) {
		:WaitForFollowGuy
		/delay 10
		/doevents
		/squelch /target pc ${FollowGuy}
		/if (!${Target.ID} || ${Target.ID}!=${Spawn[pc ${FollowGuy}].ID}) /goto :WaitForFollowGuy
		/if (${Me.Underwater} || ${Me.Levitating}) {
			/squelch /stick hold 10 uw
		} else {
			/squelch /stick hold 10
		}
		/if (${Verbose}) /${MyChannel} Following ${FollowGuy} GTG!
	}
	/doevents
/return

Sub Event_ImDead
	/doevents
	/if (${Stick.Status.Equal[ON]}) /squelch /stick off
	/keypress forward
	/keypress back
	/keypress Left
	/keypress Right
	/delay 2s
	/varset Closeness ${OriginalClose}
	/varset Following FALSE
	/varset Outside   TRUE
	/varset Engaged   FALSE
	/delay 10s
	/bct ${bcChannel} Ranger Down! Going into Sleep Mode...
	/beep
	    :DeathSleep
			/doevents
			/delay 5s
			/if (${Me.State.Equal[HOVER]} || ${Zone.ID} != ${Camp_Zone}) /goto :DeathSleep
/return




Sub Event_ToggleString(Stuff,TempMessage,TempVar,IniSection,IniEntry,Line)
	/if (${Defined[${TempVar}]}) {
		/if (${Line.Length}) {
			/varset ${TempVar} ${Line}
			/ini "${Me.Name}_RangerBot.ini" ${IniSection} ${IniEntry} "${${TempVar}}"
		}
		/echo ${TempMessage} to: ${${TempVar}}
		/varset ${IniEntry} ${${TempVar}}
	}
/return

Sub Event_ToggleVar(Stuff,TempMessage,TempVar,IniSection,IniEntry,Line)
	/if (${Defined[${TempVar}]}) {
		/if (!${Line.Length}) {
			/if (${${TempVar}}) {
				/varset ${TempVar} FALSE
			} else {
				/varset ${TempVar} TRUE
			}
		}
		/if (${Line.Arg[1].Equal[ON]} || ${Line.Arg[1].Equal[TRUE]} || ${Line.Arg[1].Equal[1]}) /varset ${TempVar} TRUE
		/if (${Line.Arg[1].Equal[OFF]} || ${Line.Arg[1].Equal[FALSE]} || ${Line.Arg[1].Equal[0]}) /varset ${TempVar} FALSE
		/if (${${TempVar}}) /echo ${TempMessage} is now ON
		/if (!${${TempVar}}) /echo ${TempMessage} is now OFF
		/if (${${TempVar}}) /bct ${bcChannel} ${TempMessage} is now ON
		/if (!${${TempVar}}) /bct ${bcChannel} ${TempMessage} is now OFF
		/if (${IniSection.NotEqual[NULL]} && ${IniEntry.NotEqual[NULL]}) /ini "${Me.Name}_RangerBot.ini" ${IniSection} ${IniEntry} ${${TempVar}}
	}
/return





Sub Event_ToggleMT(string Line)
	/if (${Line.Arg[3].Length}) {
		/varset TankName ${Line.Arg[3]}
		/squelch /target ${TankName}
		/varset TankID ${Target.ID}
		/echo New Tank: ${TankName} ID#${TankID}
	}
/return

Sub Event_SetAnchor
	/if (${Following}) {
		/echo Turning off following to set anchor.
		/squelch /stick off
		/varset FollowGuy NULL
		/varset Following FALSE
	}
	/varset Anchor TRUE
	/varset HomeX ${Me.X}
	/varset HomeY ${Me.Y}
	/varset MyHeading ${Me.Heading.DegreesCCW}
	/varset HomeXLoc ${Me.X}
	/varset HomeYLoc ${Me.Y}
	/echo New Anchor Location: ${HomeX}, ${HomeY}
/return

Sub Event_Snareon
	/varset Snared TRUE
	/if (${SnareMobs}) /bct ${bcChannel} ${Target.CleanName} has been snared!
/return

Sub Event_Snareoff
	/varset Snared FALSE
/return

Sub Event_NoSnare
	/varset Snared TRUE
	/if (${SnareMobs}) /bct ${bcChannel} I can't snare this mob!  It may run!!
/return


Sub Event_NoSnareHold
	/varset Snared TRUE
/return

Sub Event_SnareResist
	/if (${SnareCounter}>1) {
		/varset Snared TRUE
		/if (${SnareMobs}) /bct ${bcChannel} Snare resisted 3 times, giving up!
		/varset SnareCounter 0
		/return
	}
	/if (${SnareCounter}<2) {
		/varset Snared FALSE
		/varcalc SnareCounter ${SnareCounter}+1
		/if (${SnareMobs}) /bct ${bcChannel} Snare resisted, trying again!
	}
/return

Sub Event_Enrageon
	/if (${HandToHand} && ${Target.PctHPs}<11 && ${Target.ID}==${TargetArray[4]}) /attack off
/return

Sub Event_Enrageoff
	/if (${Engaged} && ${TargetArray[4]} && ${Target.Type.Equal[NPC]}) {
		/squelch /target id ${TargetArray[4]}
		/delay 1s ${Target.ID}==${TargetArray[4]}
		/face fast nolook
	}
	/if (${HandToHand} && ${Target.ID}==${TargetArray[4]}) /attack on
/return

Sub Event_AutoFireOn
	/varset AutoFireState TRUE
/return

Sub Event_AutoFireOff
	/varset AutoFireState FALSE
/return

Sub Event_WornOff(Line,SpellName,ToonName)
	/declare i int local
	/if (${DoBuffTotal} && ${RefreshBuffs}) {
		/for i 1 to ${DoBuffTotal}
		/if (${SpellName.Equal[${DoBuffIcon${i}}]} && ${DoBuffRefresh${i}}) {
			/call AddToQueue ${Spawn[pc ${ToonName}].ID} ${i}
		}
		/next i
	}
/return

Sub Event_DeTarget
	/if (${Target.ID}==${Me.ID}) /squelch /target clear
	/if (${Engaged} && ${TargetArray[4]} && ${Target.Type.Equal[NPC]}) {
		/squelch /target id ${TargetArray[4]}
		/delay 1s ${Target.ID}==${TargetArray[4]}
		/face fast nolook
	}
/return

Sub Event_EQBC(EQBCSay,EQBCSender,EQBCCommand)
	/if (${EQBCCommand.Left[1].Equal[/]}) {
		/docommand ${EQBCCommand}
	} else {
		/call Event_Chat "EQBC" "${EQBCSender}" "${EQBCCommand}"
	}
/return

Sub Event_Gate(string line,string mobName)
	/if (${Target.ID} && ${Target.ID}==${TargetArray[4]} && ${Target.Distance}<25 && ${Me.CombatAbilityReady[${MitigateDisc}]}) /disc ${MitigateDisc}
/return

Sub Event_Chat(string ChatType,string Sender,string ChatText)
	/if (${ChatText.Equal[invisoff]}) {
		/if (${Me.Buff[Camouflage].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Camouflage].ID}-1].Int} leftmouseup
		/if (${Me.Buff[Shared Camouflage].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Shared Camouflage].ID}-1].Int} leftmouseup
		/if (${Me.Buff[Sun Cloak].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Sun Cloak].ID}-1].Int} leftmouseup
		/if (${Me.Buff[Sunskin].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Sunskin].ID}-1].Int} leftmouseup
		/if (${Me.Buff[Fool the Fallen].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Fool the Fallen].ID}-1].Int} leftmouseup
	}
	/if (${ChatText.Equal[ginvis]} && ${Me.AltAbility[Shared Camouflage].ID} && ${Me.AltAbilityReady[Shared Camouflage]}) /call Cast "Shared Camouflage" alt
	/if (${ChatText.Equal[pop infusion]} && ${Me.AltAbility[Infusion of the Faithful].ID} && ${Me.AltAbilityReady[Infusion of the Faithful]}) /call Cast "Infusion of the Faithful" alt
	/if (${ChatText.Equal[levoff]}) {
		/if (${Me.Buff[Flight of Eagles].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Flight of Eagles].ID}-1].Int} leftmouseup
		/if (${Me.Buff[Spirit of Eagle].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Spirit of Eagle].ID}-1].Int} leftmouseup
		/if (${Me.Buff[Levitation].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Levitation].ID}-1].Int} leftmouseup
		/if (${Me.Buff[Dead Man Floating].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Dead Man Floating].ID}-1].Int} leftmouseup
	}
	/if ((!${ChatType.Equal[EQBC]})&&(!${ChatType.Equal[${MyChannel}]})&&(!${ChatType.Equal[TELL]})) /return
	/if (!${Spawn[${Sender}].ID}) /return
	/declare a int local
	/declare i int local
	/if (${DoBuffTotal} && ${DoBuffs} && ${Sender.NotEqual[${Me.CleanName}]} && ${Spawn[pc ${Sender}].ID}) {
		/for i 1 to ${DoBuffTotal}
		/if ((!${Outside} && !${DoBuffIndoors${i}})) /goto :SkipBuff
		/for a 1 to ${DoBuffAliases${i}.Count[|]}
        /if (${ChatText.Find["${DoBuffAliases${i}.Arg[${a},|]}"]}) {
			/if (${ChatText.Find[" pet "]} || ${ChatText.Find[${Spawn[pc ${Sender}].Pet.CleanName}]}) {
				/call AddToQueue ${Spawn[pc ${Sender}].Pet.ID} ${i}
			} else {
				/call AddToQueue ${Spawn[pc ${Sender}].ID} ${i}
			}
		}
		/next a
    :SkipBuff
		/next i
	}
	/if (${ChatText.Equal[follow]} && ${Sender.NotEqual[${Me.CleanName}]}) {
		/delay 5
		/if (!${Spawn[${Sender}].ID}) {
			/echo ${Sender} is not in zone for me to follow!
			/return
		}
		/varset FollowGuy ${Sender}
		/if (${Verbose}) /${MyChannel} I am Following ${Sender}!!!
		/if (${Me.Mount.ID}) /dismount
		/target pc ${FollowGuy}
		/delay 1s ${Target.Name.Equal[${FollowGuy}]}
		/if ((!${Following}) && (${Target.Name.Equal[${FollowGuy}]})) {
			/stand
			/face fast nolook
			/if (${Me.Underwater} || ${Me.Levitating}) {
				/squelch /stick hold 10 uw
			} else {
				/squelch /stick hold 10
			}
		/varset Following TRUE
		/if (!${Target.ID}) /varset Following FALSE
		/delay 1
		/doevents
		/return
		}
	}
	/if (${ChatText.Equal[follow stop]} && ${Sender.NotEqual[${Me.CleanName}]}) {
		/if (!${Spawn[${Sender}].ID}) {
			/return
		}
		/varset Following FALSE
		/varset Anchor TRUE
		/varset HomeX ${Me.X}
		/varset HomeY ${Me.Y}
		/varset HomeXLoc ${Me.X}
		/varset HomeYLoc ${Me.Y}
		/echo New Anchor Location: ${HomeX}, ${HomeY}
		/if (${Stick.Status.Equal[ON]}) /squelch /stick off
		/keypress forward
		/keypress back
		/keypress home
		/if (${Verbose}) /bct ${bcChannel} I Stopped Following ${Sender}!!!
		/return
	}
	/if (${ChatText.Equal[clickzone]}) {
		/declare OldZoneID int local ${Zone.ID}
		/if (${Stick.Status.Equal[ON]}) /squelch /stick off
		:MoveToDoor
		/if (${OldZoneID}!=${Zone.ID}) /return
		/if (${Target.ID}) /squelch /target clear
		/squelch /doortarget
		/squelch /face fast door
		/if (${DoorTarget.Distance}>12) {
			/nomodkey /keypress forward hold
			/delay 3
			/nomodkey /keypress forward
			/goto :MoveToDoor
		} else /if (${DoorTarget.Distance}<7) {
			/nomodkey /keypress back hold
			/delay 1
			/nomodkey /keypress back
		}
		/delay 2
		/nomodkey /keypress u hold
		/delay 2
		/nomodkey /keypress u
		/delay 2
		/nomodkey /keypress home
		/delay 2
		/nomodkey /keypress u hold
		/delay 2
		/nomodkey /keypress u
		/delay 1s
		/if (${OldZoneID}==${Zone.ID}) /goto :MoveToDoor
	}
	/if (${ChatText.Equal[clickdoor]}) {
		/if (${Stick.Status.Equal[ON]}) /squelch /stick off
		:MoveToClick
		/if (${Target.ID}) /squelch /target clear
		/squelch /doortarget
		/squelch /face fast door
		/if (${DoorTarget.Distance}>12) {
			/nomodkey /keypress forward hold
			/delay 3
			/nomodkey /keypress forward
			/goto :MoveToClick
		} else /if (${DoorTarget.Distance}<7) {
			/nomodkey /keypress back hold
			/delay 1
			/nomodkey /keypress back
		}
		/delay ${ZoneDelay}
		/nomodkey /keypress u hold
		/delay 2
		/nomodkey /keypress u
		/delay 2
		/nomodkey /keypress home
		/delay 2s
		/doevents Zoned
	}
	/if (${ChatText.Equal[mana check]}) /${MyChannel} Ranger Mana ${Me.PctMana}%
	/if (${ChatText.Equal[leaveraid]} && ${Raid.Member[${Me.CleanName}].ID}) /raiddisband
	/if (${ChatText.Equal[slowcamp]}) {
		/if (${Me.Standing}) /sit
		/delay 5m ${Me.PctMana}>=98
		/camp desktop
		/end
	}
/return

Sub Event_SayZone(string Sender,string ZoneText)
	/if (${Stick.Status.Equal[ON]}) /squelch /stick off
	/squelch /assist ${Sender}
	/squelch /face fast nolook
	/if (${Target.ID}) /squelch /stick 10
	/delay ${ZoneDelay}
	/if (${ZoneText.Equal[hail]}) {
		/h
	} else {
		/say ${ZoneText}
	}
/return

Sub Event_CastSpell(string Sender,string SpellName,string SpellTarget)
	/if (${Me.Book[${SpellName}]}) {
		/target id ${Spawn[${SpellTarget}].ID}
		/delay 5s ${Target.Name.Equal[${SpellTarget}]}
		/if (${DoBuffTells}&&!${SpamTimer}) /tt ${SpellName} inc
		/call Cast "${SpellName}" gem3
	}
/return

Sub Event_RaidBuff(string line,string BuffCommand)
	/declare j int local
	/if (${BuffCommand.NotEqual[all]} && ${Spawn[pc ${BuffCommand}].ID}) {
		/for j 1 to ${RaidBuffTotal}
  		/if (${RaidBuffTotal}) {
			/call AddToQueue ${Spawn[pc ${BuffCommand}].ID} ${j}
  		}
    /next j
    /return
	}
	/declare a int local
	/declare i int local
	/if (${RaidBuffTotal}&&${DoRaidBuffs}&&${BuffCommand.Equal[all]}) {
		/for i 1 to ${RaidBuffTotal}
		/if (!${Outdoors}&&!${RaidBuffIndoors${i}}) /goto :SkipRaidBuff
		/for a 1 to ${Raid.Members}
      	/if (${Select[${Spell[${RaidBuffID[${i}]}].TargetType},"Group v2","AE PC v2","Group v1","AE PC v1"]}&&${Raid.Member[${a}].GroupLeader}) {
			/call AddToRaidQueue ${Spawn[pc ${Raid.Member[${a}]}].ID} ${i}
      	} else /if (${Select[${Spell[${RaidBuffID[${i}]}].TargetType},pc,Single]}) {
			/call AddToRaidQueue ${Spawn[pc ${Raid.Member[${a}]}].ID} ${i}
        }
		/next a
		:SkipRaidBuff
		/next i
	}
/return

Sub Event_SwitchTarget(string Sender,string NewTarget)
	/if (${Verbose}) /${MyChannel} Switching targets to ${NewTarget}
	/if (${Spawn[${NewTarget}].ID}) /squelch /target ${NewTarget}
	/if (${Target.ID} && ${Target.Type.Equal[NPC]}) {
		/face fast nolook
		/varset TargetArray[1] ${Target.CleanName}
		/varset TargetArray[2] ${Target.Level}
		/varset TargetArray[3] ${Target.Name}
		/varset TargetArray[4] ${Target.ID}
	}
/return

Sub Event_DamageMelee(string line,int damage)
	/if (${useDPS}) {
		/varcalc totalMeleeDmg ${totalMeleeDmg}+${damage}
		/if (!${fightStartTime}) /varset fightStartTime ${MacroQuest.Running}
	}
/return

Sub Event_DamageNonMelee(string line,int damage)
	/if (${useDPS}) {
		/varcalc totalNonMeleeDmg ${totalNonMeleeDmg}+${damage}
		/if (!${fightStartTime}) /varset fightStartTime ${MacroQuest.Running}
	}
/return

Sub Event_ExcludeMob(string line,string MobName)
	/if (!${ExcludeList.Find[${MobName}]}) {
		/ini "${IniFile}" "Excludes.${Zone.ShortName}" "Exclude" "${MobName}|"
	} else }
		/ini "${IniFile}" "Excludes.${Zone.ShortName}" "Exclude" "${ExcludeList}${MobName}|"
	}
	/varset ExcludeList ${Ini[${IniFile},"Excludes.${Zone.ShortName}","Exclude"]}
	/echo ExcludeList: ${ExcludeList}
/return

Sub Event_CleanCorpses
	/call LootMobs
/return

CharName_RangerBot.ini
Code:
[Misc]
LoadDate=
Version=

[Settings]
MySpellSet=group
MyBandolier=Normal
bcChannel=Put your bc channel here (without /bct)
Verbose=TRUE
CampRadius=1
MoveHome=TRUE
MinZ=-100
MaxZ=100
HoldAgro=FALSE
AutoCombat=TRUE
UseMitigate=TRUE
MitigateDisc=Jolting Frontkicks Rk. III
DefaultMT=Put your Default MT here
AssistDistance=200
AssistAt=90
AutoArchery=FALSE
ArcheryDistance=90
CasterHeals=75
MeleeHeals=50
TankHealPoint=35
HealSpell=Oceangreen Aquifer Rk. II
HealSpellGem=Gem2
useAutoLoot=TRUE
useDPS=TRUE
PullBackDistance=100
ZoneDelay=50
DoNuke=TRUE
DoHail=False

[SelfBuffStuff]
SelfBuffTotal=14
SelfBuffs=1
ReportSelfBuffs=1
SelfBuffRecheck=5s

UseAura=FALSE
AuraBuff=Self Aura Spell or Combat Ability full name
AuraBuffGem=Gem10
AuraEndurance=200

SelfBuff1=Spinecoat Rk. II
SelfBuffIcon1=Spinecoat Rk. II
SelfBuffGem1=Gem8
SelfBuffCount1=24
SelfBuffIndoors1=1
SelfBuffCount1=1

SelfBuff2=Devastating Blades Rk. II
SelfBuffIcon2=Devastating Blades Rk. II
SelfBuffGem2=gem8
SelfBuffCount2=24
SelfBuffIndoors2=1

SelfBuff3=Eyes of the Nocturnal Rk. II
SelfBuffIcon3=Eyes of the Nocturnal Rk. II
SelfBuffGem3=Gem8
SelfBuffCount3=24
SelfBuffIndoors3=1

SelfBuff4=Consumed by the Hunt Rk. II
SelfBuffIcon4=Consumed by the Hunt Rk. II
SelfBuffGem4=gem8
SelfBuffCount4=24
SelfBuffIndoors4=1

SelfBuff5=Protection of the Paw Rk. II
SelfBuffIcon5=Protection of the Paw Rk. II
SelfBuffGem5=Gem8
SelfBuffCount5=24
SelfBuffIndoors5=1

SelfBuff6=Mottlescale Rk. II
SelfBuffIcon6=Mottlescale Rk. II
SelfBuffGem6=gem8
SelfBuffCount6=24
SelfBuffIndoors6=1

SelfBuff7=Nature Veil
SelfBuffIcon7=Nature Veil
SelfBuffGem7=gem8
SelfBuffCount7=24
SelfBuffIndoors7=1

[CureStuff]
CureTotal=1
DoCures=TRUE
ReportCures=TRUE

CureSpell1=Burynai Balm Rk. II
CureGem1=Gem7
CurseCounters1=9
DiseaseCounters1=9
PoisonCounters1=9
CorruptCounters1=0

[DoBuffStuff]
DoBuffTotal=8
DoBuffs=1
DoBuffTells=1
RefreshBuffs=1
DoBuffMana=10

DoBuff1=Yowl of the Predator Rk. II
DoBuffIcon1=Yowl of the Predator Rk. II
DoBuffGem1=Gem8
DoBuffAliases1=predator|pred|yotp|yop|atk buff|
DoBuffIndoors1=1
DoBuffRefresh1=1

DoBuff2=Cloak of Feathers Rk. II
DoBuffIcon2=Cloak of Feathers Rk. II
DoBuffGem2=Gem8
DoBuffAliases2=ac buff|cof|feathers|
DoBuffIndoors2=1
DoBuffRefresh2=1

DoBuff3=Strength of the Tracker Rk. II
DoBuffIcon3=Strength of the Tracker Rk. II
DoBuffGem3=Gem8
DoBuffAliases3=Tracker pls|sot|sott|
DoBuffIndoors3=1
DoBuffRefresh3=1

DoBuff4=Nature Veil
DoBuffIcon4=Nature Veil
DoBuffGem4=Gem8
DoBuffAliases4=veil|
DoBuffIndoors4=1
DoBuffRefresh4=1

DoBuff5=Spirit of Eagle
DoBuffIcon5=Spirit of Eagle
DoBuffGem5=Gem8
DoBuffAliases5=soe|
DoBuffIndoors5=0
DoBuffRefresh5=0

DoBuff6=Burynai Balm Rk. II
DoBuffIcon6=Burynai Balm Rk. II
DoBuffGem6=Gem7
DoBuffAliases6=cureme|
DoBuffIndoors6=1
DoBuffRefresh6=0

DoBuff7=Shield of Dryspines Rk. II
DoBuffIcon7=Shield of Dryspines Rk. II
DoBuffGem7=Gem7
DoBuffAliases7=DS pls|
DoBuffIndoors7=1
DoBuffRefresh7=1

DoBuff8=Mottlescale Rk. II
DoBuffIcon8=Mottlescale Rk. II
DoBuffGem8=Gem8
DoBuffAliases8=hp buff|
DoBuffIndoors8=1
DoBuffRefresh8=0

[RaidBuffs]
RaidBuffTotal=3
DoRaidBuffs=TRUE

RaidBuff1=Yowl of the Predator Rk. II
RaidBuffIcon1=Yowl of the Predator Rk. II
RaidBuffGem1=Gem1
RaidBuffIndoors1=1

RaidBuff2=Cloak of Feathers
RaidBuffIcon2=Cloak of Feathers
RaidBuffGem2=Gem3
RaidBuffIndoors2=1

RaidBuff3=Strength of the Tracker Rk. II
RaidBuffIcon3=Strength of the Tracker Rk. II
RaidBuffGem3=Gem2
RaidBuffIndoors3=1

[NukeStuff]
DoNuke=TRUE
FirstNuke=Windwhip Bite Rk. II
FirstNukeGem=Gem3
DoNukeTwo=TRUE
SecondNuke=Cataclysm Ash Rk. II
SecondNukeGem=Gem6
NukeAt=90
NukeDelay=40
MinNukeAt=10
MinManaForNuke=60

[DotStuff]
DoDots=FALSE
DotSpell=Beetle Swarm Rk. II
DotSpellGem=Gem1
DotAt=96
MinDotAt=65
DotDelay=100

[HailStuff]
DoHail=FALSE
HailSpell=Barrage of Arrows Rk. II
HailSpellGem=Gem4
HailAt=96
MinHailAt=10
HailDelay=100

[SnareStuff]
SnareMobs=TRUE
SnareSpell=Entrap
SnareSpellGem=alt
SnareAt=97
KT2SnareAt=75

[ExcludeList]
[Excludes.illsalinc_70H]
Exclude=|a sporali free spore|Emperor Draygun|
[Excludes.Dranik]
Exclude=|Uisima Lord of the Depths|Grand Historian Rygua|Natvil|
[Excludes.Steppes]
Exclude=|_03|_05|_06|
[Excludes.Ponightmare]
Exclude=|Thelin Poxbourne|
[Excludes.drachnidhiveb_70h]
Exclude=|Cicero Quikwire|
[Excludes.PoKnowledge]
Exclude=|
[Excludes.Lavastorm]
Exclude=|Gordish Frozenheart|
[Excludes.Broodlands]
Exclude=|
[Excludes.thenest_70]
Exclude=|
[Excludes.Wallofslaughter]
Exclude=|
[Excludes.Provinggrounds]
Exclude=|
[Excludes.chamberse_11]
Exclude=|
[Excludes.Arcstone]
Exclude=|
[Excludes.skylance_raid]
Exclude=|Head Librarian Magus|Student Joban|
[Excludes.stillmoona_event3]
Exclude=|
[Excludes.Icefall]
Exclude=|
[Excludes.Valdeholm]
Exclude=|
[Excludes.Frostcrypt]
Exclude=|
[Excludes.GuildLobby]
Exclude=|
[Excludes.GuildHall]
Exclude=|
[Excludes.Commonlands]
Exclude=|
[Excludes.NorthRo]
Exclude=|
[Excludes.Takishruins]
Exclude=|
[Excludes.takishruinsa_70]
Exclude=|
[Excludes.SouthRo]
Exclude=|
[Excludes.FreeportWest]
Exclude=|
[Excludes.FreeportEast]
Exclude=|
[Excludes.Devastation]
Exclude=|
[Excludes.takishruins_70]
Exclude=|
[Excludes.Elddar]
Exclude=|
[Excludes.Causeway]
Exclude=|Siflu|
[Excludes.Draniksscar]
Exclude=|Elder Priest of Discord|Priest of Discord|
[Excludes.Bloodfields]
Exclude=|
[Excludes.thundercrest_70]
Exclude=|
[Excludes.EastKorlach]
Exclude=|
[Excludes.WestKorlach]
Exclude=|
[Excludes.westkorlachc_70]
Exclude=|a young witheran|
[Excludes.eastkorlach_70]
Exclude=|
[Excludes.eastkorlacha_70]
Exclude=|
[Excludes.Dawnshroud]
Exclude=|
[Excludes.Maiden]
Exclude=|
[Excludes.Umbral]
Exclude=|
[Excludes.Corathus]
Exclude=|Belfast|Treddlehoop|
[Excludes.corathusb_fb70]
Exclude=|
[Excludes.westkorlachb_fb70]
Exclude=|
[Excludes.DrachnidHive]
Exclude=|
[Excludes.drachnidhivea_fb70]
Exclude=|
[Excludes.Illsalin]
Exclude=|Neran Sporestomp|
[Excludes.illsalinb_fb70]
Exclude=|
[Excludes.corathusb_70]
Exclude=|
[Excludes.Moors]
Exclude=|
[Excludes.Crescent]
Exclude=|
[Excludes.Mesa]
Exclude=|
[Excludes.Stonehive]
Exclude=|
[Excludes.Roost]
Exclude=|
[Excludes.Direwind]
Exclude=|
[Excludes.Sunderock]
Exclude=|
[Excludes.Vergalid]
Exclude=|
[Excludes.PoTranquility]
Exclude=|
[Excludes.Poinnovation]
Exclude=|
[Excludes.Greatdivide]
Exclude=|
[Excludes.mischiefplane]
Exclude=|
[Excludes.Codecay]
Exclude=|
[Excludes.Bothunder]
Exclude=|
[Excludes.Solrotower]
Exclude=|
[Excludes.delvea_70]
Exclude=|
[Excludes.StillmoonA]
Exclude=|
[Excludes.DelveA]
Exclude=|
[Excludes.DelveB]
Exclude=|
[Excludes.delveb_70]
Exclude=|
[Excludes.Ashengate]
Exclude=|
[Excludes.Thundercrest]
Exclude=|
[Excludes.StillmoonB]
Exclude=|an agitated skeleton|
[Excludes.Twilight]
Exclude=|
[Excludes.Scarlet]
Exclude=|
[Excludes.Barindu]
Exclude=|
[Excludes.Natimbi]
Exclude=|
[Excludes.Qinimi]
Exclude=|
[Excludes.dranikhollowsa_70]
Exclude=|
[Excludes.Ferubi]
Exclude=|
[Excludes.dranikcatacombsc_70]
Exclude=|
[Excludes.dranikcatacombsb_70]
Exclude=|
[Excludes.firiona]
Exclude=|
[Excludes.LakeofIllOmen]
Exclude=|
[Excludes.Veksar]
Exclude=|
[Excludes.TheNest]
Exclude=|
[Excludes.hateplaneb]
Exclude=|
[Excludes.draniksewersc_70]
Exclude=|
[Excludes.Riftseekers]
Exclude=|Taromani|
[Excludes.stillmoonb_raid1]
Exclude=|
[Excludes.stillmoonb_raid2]
Exclude=|
[Excludes.westkorlacha_event]
Exclude=|
[Excludes.BuriedSea]
Exclude=|
[Excludes.Steamfontmts]
Exclude=|
[Excludes.Lfaydark]
Exclude=|
[Excludes.Dragonscale]
Exclude=|
[Excludes.Lopingplains]
Exclude=|Kedem Teague|
[Excludes.Wakening]
Exclude=|
[Excludes.Iceclad]
Exclude=|
[Excludes.EastWastes]
Exclude=|
[Excludes.Kael]
Exclude=|
[Excludes.Nedaria]
Exclude=|
[Excludes.Stonebrunt]
Exclude=|
[Excludes.Gunthak]
Exclude=|
[Excludes.Dulak]
Exclude=|
[Excludes.Torgiran]
Exclude=|
[Excludes.Poair]
Exclude=|
[Excludes.Powater]
Exclude=|
[Excludes.Anguish]
Exclude=|
[Excludes.Pofire]
Exclude=|
[Excludes.Mechanotus]
Exclude=|
[Excludes.stillmoona_le]
Exclude=|
[Excludes.drachnidhivec_raid]
Exclude=|
[Excludes.drachnidhive_70H]
Exclude=|
[Excludes.drachnidhivea_70H]
Exclude=|
[Excludes.Dreadspire]
Exclude=|Katina Duncan|Elizabeth Duncun|an aid to the Seneschal|
[Excludes.rujd_651]
Exclude=|
[Excludes.eastkorlacha_event]
Exclude=|
[Excludes.illsalinb_event]
Exclude=|
[Excludes.illsalinc_raid]
Exclude=|
[Excludes.Butcher]
Exclude=|
[Excludes.OceanOfTears]
Exclude=|
[Excludes.Timorous]
Exclude=|
[Excludes.Nektulos]
Exclude=|
[Excludes.Oldcommons]
Exclude=|
[Excludes.Oldkurn]
Exclude=|
[Excludes.Oldfieldofbone]
Exclude=|
[Excludes.Oldbloodfield]
Exclude=|a dragorn courier|
[Excludes.Oldkithicor]
Exclude=|
[Excludes.Oceangreenhills]
Exclude=|
[Excludes.Oceangreenvillage]
Exclude=|
[Excludes.oldblackburrow_80]
Exclude=|
[Excludes.oldcommons_mission]
Exclude=|
[Excludes.Oldkaesoraa]
Exclude=|
[Excludes.Oldkaesorab]
Exclude=|
[Excludes.Toskirakk]
Exclude=|
[Excludes.Korascian]
Exclude=|
[Excludes.Rathechamber]
Exclude=|
[Excludes.korascian_mission]
Exclude=|
[Excludes.Steamfactory]
Exclude=|
[Excludes.guardian_80]
Exclude=|
[Excludes.Crystallos]
Exclude=|
[Excludes.Gyrospireb]
Exclude=|
[Excludes.Discord]
Exclude=|
[Excludes.Bertoxtemple]
Exclude=|
[Excludes.precipiceofwar_mission]
Exclude=|
[Excludes.Zhisza]
Exclude=|
[Excludes.zhisza_b]
Exclude=|
[Excludes.KattaCastrum]
Exclude=|
[Excludes.thalassius_b]
Exclude=|
[Excludes.atiiki_b]
Exclude=|
[Excludes.silyssar_b]
Exclude=|
[Excludes.steamfactory_raid]
Exclude=|
[Excludes.Potimea]
Exclude=|
[Excludes.Yxtta]
Exclude=|
[Excludes.DragonscaleB]
Exclude=|
[Excludes.Shipworkshop]
Exclude=|
[Excludes.Hillsofshade]
Exclude=|
[Excludes.Everfrost]
Exclude=|
 
Reserved for command list when I get more time to create one...
 
As of 8/14/2009 /tells for buffs are not working, I think it has something to do with the way #chat handles things now, hopefully we all dont have to edit our macro's to work right.
 
Great macro i dled and have been playing. with it buff work fine for me but they work as a bc setting only. I
 
Last edited:
Any idea how to edit the macro so that when the ranger is looting a stacked item he will loot it automatically. Currently he is unable to loot stacked items without manually hitting the enter key.

thanks again,
 
Find the line where it's looting and use a /nomodkey shift leftmouseup or some shit like that.
 
I looked around on this and I don't see a definitive line that looks like it's the loot section.

I am very new at the coding part so if someone could verify which line it is I would appreciate it.

Is it this line?
Code:
/if (${useAutoLoot} && ${LootMobs} && !${Me.Moving} && ${ACState}<1 ) /call LootMobs

or

do I need to edit the Ninjadvloot.inc file?
 
Here's the information on the Ninjadvloot.inc:

Code:
Sub LootCorpse
/declare i          int    local
/declare LootList   string local
/call CheckCursor
/loot
/delay 3s ${Corpse.Open}
/doevents CantLoot
/if (${Target.ID}==${ALDontLoot} && ${Spawn[${ALDontLoot}].ID}) /squelch /alert add 25 id ${ALDontLoot}
/delay 3s ${Corpse.Items} || ${Target.ID}==${ALDontLoot}
/if (${Corpse.Open} && ${Corpse.Items}) {
 /declare loottotal  int    local
  :ALlootlag
  /varset loottotal ${Corpse.Items}
  /delay 1s ${loottotal}!=${Corpse.Items}
  /if (${loottotal}!=${Corpse.Items}) /goto :ALlootlag
  /for i 1 to ${loottotal}
  /if (${Corpse.Item[${i}].ID} && !${Select[${Ini[Loot.ini,"${Corpse.Item[${i}].Name.Left[1]}","${Corpse.Item[${i}]}"]},Ignore,Keep,Destroy]}) {
    /if (${Corpse.Item[${i}].NoDrop}) /ini "loot.ini" "${Corpse.Item[${i}].Name.Left[1]}" "${Corpse.Item[${i}]}" Ignore
    /if (!${Corpse.Item[${i}].NoDrop}) /ini "loot.ini" "${Corpse.Item[${i}].Name.Left[1]}" "${Corpse.Item[${i}]}" Keep

Where should I place - /nomodkey shift leftmouseup
 
This setup to allow for assisting mercs? I've been using it with a lot of success when assisting real players, but the problem I'm running into is if I have my puller set as the assist and he runs off and changes targets it causes ranger to target the new mob (long before it's in camp) and shut off attack. If I then toggle back to the original mob (that IS in camp) with my puller to force the ranger to re-assist the proper mob he never turns attack back on.

It might be a conflict between this macro and mq2melee as I'm using both to automate the toon. Any ideas would be good though.
 
This setup to allow for assisting mercs? I've been using it with a lot of success when assisting real players, but the problem I'm running into is if I have my puller set as the assist and he runs off and changes targets it causes ranger to target the new mob (long before it's in camp) and shut off attack. If I then toggle back to the original mob (that IS in camp) with my puller to force the ranger to re-assist the proper mob he never turns attack back on.

It might be a conflict between this macro and mq2melee as I'm using both to automate the toon. Any ideas would be good though.

ID say thats down to the mac not looking to re-assist at any point to check it still has the same target as the main assist
 
This setup to allow for assisting mercs? I've been using it with a lot of success when assisting real players, but the problem I'm running into is if I have my puller set as the assist and he runs off and changes targets it causes ranger to target the new mob (long before it's in camp) and shut off attack. If I then toggle back to the original mob (that IS in camp) with my puller to force the ranger to re-assist the proper mob he never turns attack back on.

It might be a conflict between this macro and mq2melee as I'm using both to automate the toon. Any ideas would be good though.

I look at this for about 5 seconds but try this

Change line 98 as follow in yellow and see if you can select Merc as main assist

From:

/if (!${Target.ID} || ${Target.Type.NotEqual[PC]} || ${Target.Type.Equal[Corpse]} || ${Target.Type.Equal[PET]} || ${Target.ID} == ${Me.ID}) {

To

/if (!${Target.ID} || ${Target.Type.NotEqual[PC]} || ${Target.Type.NotEqual[Mercenary]} || ${Target.Type.Equal[Corpse]} || ${Target.Type.Equal[PET]} || ${Target.ID} == ${Me.ID}) {
 
Modifying "verbose=" to FALSE seems to not stop tells to people as the bot is rebuffing. Other than going and commenting out all the commands in the macro is there another way to keep him from sending tells?
 
Spells

Hey,
The ranger macro does not seem to mem the spells itself. Am i supose to have the spells loaded already? or have the spell set named something in particular? please help, still trying to find a ranger macro that casts correctly.

Lorewolf :)
 
Hey,
The ranger macro does not seem to mem the spells itself. Am i supose to have the spells loaded already? or have the spell set named something in particular? please help, still trying to find a ranger macro that casts correctly.

Lorewolf :)

Create your spell set and save it as something, then edit the ini to have the correct spell set name.
 
Modifying "verbose=" to FALSE seems to not stop tells to people as the bot is rebuffing. Other than going and commenting out all the commands in the macro is there another way to keep him from sending tells?

under dobuffs in the ini change dobuff tells to 0
 
Edited: Figured it out. Added a corpse check in the tagtarget sub that solves this.


Having a problem with the macro trying to attack the mob that just got killed.
It only happens when the death message comes in and immediately after the last mobs swing is logged on my toon (usually seen to have been riposted).

Anyway to fix this?
Possibly add a check: if current target (has corpse in the name) clear target


Thanks
 
Last edited: