• You've discovered RedGuides 📕 an EverQuest multi-boxing community 🛡️🧙🗡️. We want you to play several EQ characters at once, come join us and say hello! 👋
  • IS THIS SITE UGLY? Change the look. To dismiss this notice, click the X --->

help macro not doing item click buffs now??? (1 Viewer)

chance98

New member
Joined
Dec 29, 2007
RedCents
71¢
please help i love this macro but lost and had to redownload it... now its not doing click item buffs anymore... can anyone see a reason why??

HTML:
|Pallytank.mac Authors and thx to: Tone, SS44, Siddin
|[04-28-06] 	modiefied by Crystane: Healerprotection, Memspellsection and some codemodifications added.
|[07-01-06] 	Crystane: Complete new Anchorsub and logic. Features obstacle avoidance or to follow a Grpmember to camp. 
|		Also added checks to use Undead Nukes if fighting Undead Mobs.
|		And last but not least, added a Buffkeepup Feature for Grp and Selfbuffs.
|		Added Selfprotection with disk Guard of Righteousness and fast heals.
|
|		New Anchorsub features Moveing to Anchor or if far out to follow a Grpmember to camp (if enabled)
|		Look for variables Anchor and GrpMbrAnchor
|[07-05-06]     Wont buff anymore when a mob is incomming or close in camp. Also will use stunpush to move the mobs to the Anchor when they get out of a certain range or up a wall.
|[11-02-06]	New Spells implemented, Improved Aggromanagment (Taunts only if not on top of aggro list), improved self last stand protection (disks and fast heals).
|[11-08-06]	Fixes in the feature to fight near the Anchor and second NEW feature to walk backwards to anchor in fight to position mob.
|[11-10-06]	Cleanup thru the whole macro-code, improved movement in fight. Added ...
#turbo
#Event EXP                      "You gain experience#*#"
#Event EXP                      "You gain party experience#*#"
#Event Returntoanchor           "<#*#> Returntoanchor"
#Event Tag                      "#1# tells you#*#Tag#*#"
#Event HotonInc			"#1# tells you#*#Incomeing pull.#*#"
#Event WornOff			"Your #1# spell has worn off of a#*#"
#Event WornOff			"#1# fades."
#Event Toofaraway		"Your target is too far away, get closer!"
#Event CantSeeTarget		"You cannot see your target."
#Event Canthit			"You can't hit them from here."
#Event AttackingSelf		"Try attacking someone other than yourself#*#"
#Event Zoning 			"You have entered#*#" 
#Event ImDead 			"You have been slain by#*#"
#Event Enrageon 		"#*#become ENRAGED#*#" 
#Event Enrageoff 		"#*#no longer enraged#*#"
#Event Anchorchg 		"[MQ2] Anchor"
#Event AmSummoned		"You have been summoned!"
#Event OutDoor			"#*#outdoors#*#"
#Event OutDoor			"You can not summon a mount here."
#Event TauntFail		"You have failed to taunt your target."

#Include Spell_Routines.inc
#Include Itemcast.inc
#Include GetRez.inc

#Chat tell
#Chat group
#Chat channel
#Chat guild
  
Sub Main
/if (!${Target.Type.Equal[PC]}) {
	/echo No one targeted to assist, ending.
	/end
}
/if (${Target.Name.Equal[${Me.Name}]}) {
	/echo Cant assist yourself, ending.
	/end
}
/echo Tanking, whatever ${Target.CleanName} pulls.

/declare Puller			string outer	${Target}
/declare PullerID		int outer	${Target.ID}
/declare DistancetoAssist	int outer
/declare TankRadOutdoors	int outer	180
/declare TankRadIndoors		int outer	90

|=====================================================================
|Communication and medding.
|=====================================================================
| Variables "Tells" and "Spam" -----> Settings: 1 announces tells to channel; 0 for no announces

	/declare Tells			int outer	1
	/declare Spam			int outer	0

| Variable "autosit" -----> Settings: 1 to make your toon sit and med when no MOB within "distancetosit"; 0 for never sit

	/declare autosit		int outer	1
	/declare distancetosit		int outer	100

|=====================================================================
|Healmanagment and recastdelays.
|=====================================================================
  
	/declare Diskbelowhealth	int outer	32
	/declare SelfHealbelow		int outer	67
	/declare HealClrBelow		int outer	70
	/declare HealShmBelow		int outer	45
	/declare Joltrecastdelay	int outer 	360
	/declare PositioningDelay	int outer	125
	/declare Leashdistance		int outer	28

	/declare Raidmode		outer		FALSE

|If Raidmode is set True, your toon will keep up "Ward of Tunare" at all times if avail.

|"Joltrecastdelay" defines the delay how often Aggrospells (e.g. Challange for Honor) will be cast.
|"PositioningDelay" defines the delay how often your toon will try to position the fight closer to the Anchor.
|"Leashdistance" defines the distance used to calculate in the Anchor-feature to follow a Groupmember or not. (I suggest to leave it 28 tho /hint)

	/declare Anchor			outer		TRUE
	/declare GrpMbrAnchor		outer		FALSE
	/declare AnchorStunFree		outer		TRUE
	/declare HoldonInvis		outer		FALSE

| Anchor		defines if your toon tries to move back to an Anchor. (options FALSE/TRUE)
|
| GrpMbrAnchor 	defines if your toon is allowed to follow a Grpmember to camp while trying to move to anchor. 
|			(options FALSE/TRUE)
|
| AnchorStunFree	defines if your toon tries to move the mob back near anchor useing stuns (set to FALSE)
|		 	or via walking backwards to Anchor (set TRUE)


|===================================================================
|Spelleditsection  EDIT YOUR SPELLS HERE !!!!!!!!!!!!!!!!!!!!!!!!!
|===================================================================

	/declare	AggroStun	string outer 	Sacred Force Rk. II
	/declare	JoltSpell	string outer	Challenge for Honor Rk. II
	/declare	PushStun	string outer	Lesson of Penitence Rk. II
	/declare	GrpHeal		string outer	Wave of Forgiveness Rk. II
	/declare	QuickHeal	string outer	Burst of Sunlight Rk. II
	/declare	HotHeal		string outer	Sacred Cleansing Rk. II
	/declare	UndeadNuke	string outer	Spurn Undead
	/declare	StunAA		string outer	Divine Stune
	/declare	StunAA2		string outer	Celestial Disruption
	/declare	GrpHealAA	string outer	Hand of Tranquility
	/declare	DiscAA		string outer	Guard of Humilty
	/declare	CombatAbltyDisk	string outer	Guard of Righteousness
	/declare	YaulpWard	string outer	Ward of Tunare
	/declare	RootSpell	string outer	Shackles of Tunare

|===================================================================
| Buffs to keep up! EDIT YOUR SPELLS HERE !!!!!!!!!!!!!!!!!!!!!!!!
|===================================================================

	/declare	GrpHPBuff	string outer	Brell's Stony Guard Rk. II
	/declare Rebuffstate outer TRUE
	/declare SpellBufftodo[9] string outer 
	/varset SpellBufftodo[1] Brell's Stony Guard Rk. II 
	/varset SpellBufftodo[2] Armor of Unrelenting Faith Rk. II
	/varset SpellBufftodo[3] Blessed Aura
	/varset SpellBufftodo[4] NULL
	/varset SpellBufftodo[5] NULL
	/varset SpellBufftodo[6] NULL
	/varset SpellBufftodo[7] NULL
	/varset SpellBufftodo[8] NULL
	/varset SpellBufftodo[9] NULL

|===================================================================
| Item-Buffs to keep up! EDIT YOUR ITEMS HERE !!!!!!!!!!!!!!!!!!!!!!!!
|===================================================================

	/declare InstantHealpot	string outer Distillate of Divine Healing XII

	/declare ItemBufftodo[9] string outer 
	/varset ItemBufftodo[1] Stonewall Pauldrons
	/varset ItemBufftodo[2] Frozen Crystal Shard
	/varset ItemBufftodo[3] Visage of the Ice Golem
	/varset ItemBufftodo[4] Familiar of Hulcror
	/varset ItemBufftodo[5] NULL
	/varset ItemBufftodo[6] NULL
	/varset ItemBufftodo[7] NULL
	/varset ItemBufftodo[8] NULL
	/varset ItemBufftodo[9] NULL
|===================================================================
| Bandolier!!! EDIT YOUR ITEMS HERE !!!!!!!!!!!!!!!!!!!!!!!!
|===================================================================

	/declare BandoNorm	string outer "1HSh"
	/declare BandoThrow	string outer "bash"

|=====================================================================
| END OF EDITING!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
| END OF EDITING!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
| END OF EDITING... unless you are rewriteing parts or the macro.
|=====================================================================

	/declare RV_MyXLOC		int outer	0
	/declare RV_MyYLOC		int outer	0
	/declare RV_Range		int outer	10
	/declare RV_RangeMax		int outer
	/declare RV_RangeMin		int outer
	/declare DistanceToUseStick	int outer	
	/varcalc DistanceToUseStick ${RV_Range}*3
	/varcalc RV_RangeMax ${RV_Range}+1
	/varcalc RV_RangeMin ${RV_Range}-2
	/declare TempAnchor		outer		FALSE
	/declare AnchorX		int outer	${Me.X.Int}
	/declare AnchorY		int outer	${Me.Y.Int}
	/declare AnchorZ		int outer	${Me.Z.Int}
	/varcalc AnchorZ		${AnchorZ}+10
	/declare Exper			float outer
	/declare AAExp			float outer
	/declare Mobs_Killed		int outer	0
	/declare AlertListVoid		int outer	35 
	/declare AlertListDestruct	int outer	30
	/declare AlertListNormal	int outer	25
	/declare AlertListUndead	int outer	20
	/declare AlertListNamed		int outer	15
	/declare TargetLocY		int outer
	/declare TargetLocX		int outer
	/varset  Exper			${Me.PctExp}
	/varset  AAExp			${Me.PctAAExp}
	/declare ValidCombatTarget	outer		FALSE
	/declare VCTid			int outer	NULL
	/declare CTtempID		int outer	NULL
	/declare stickmode		outer		FALSE
	/declare amlostmode		outer		FALSE
	/declare GrpLosState		outer		FALSE
	/declare gmember		int outer    
	/declare LosGrpMbr		int outer
	/declare CombatStickMode	outer		FALSE
	/declare ToofarawayCount	int outer	0
	/declare CantSeeTargetCount	int outer	0
	/declare AttackingSelfCount	int outer	0
	/declare CanthitCount		int outer	0
	/declare MobSummons		outer		FALSE
	/declare PossibleIncom		outer		FALSE
	/declare Crittermode		bool outer	FALSE
	/declare MobisEnraged		bool outer		FALSE
	/declare Enrageresettime	timer outer
	/declare TurnMobTimer		timer outer
	/declare rodwait		timer outer
	/declare HotTimer		timer outer
	/declare WardTimer		timer outer
	/declare Jolttimer		timer outer	${Joltrecastdelay}
	/declare Maxwaitfortarget	timer outer	
	/declare Discdelay		timer outer
	/declare proxitimer 		timer outer
	/declare healwait		timer outer
	/declare OldDiskbelowhealth 	int outer	${Diskbelowhealth}
	/declare OldSelfHealbelow 	int outer	${SelfHealbelow}
	/declare UseMount		bool outer	TRUE
	/declare Mount			string outer
	/declare OutDoors		bool outer
	/declare HoTTavail		bool outer
|===============================================================
  
/assist off
/call SetMount
/call CheckOutDoors
/delay 5
/if (${Me.Mount.ID}) {
	/varset OutDoors TRUE
	/dismount
}
/doevents OutDoor
/call SetAssistradius
/squelch /target myself
/delay 10 ${Target.Name.Equal[${Me}]}
/delay 10 ${Me.TargetOfTarget.ID}
/call HoTTcheck
:Start

/if (${Me.Type.Equal[Corpse]}) {
	/echo I am a corpse, I must have died.
	/delay 10s
	/doevents ImDead
	/goto :Start
}
/if (${GameState.Equal[CHARSELECT]}) /endmacro
/if ( !${Me.Casting.ID} ) /call MemSpells
/call ProtectHealer
/call Stbevents
/doevents HotonInc
/if (${PossibleIncom} || ${Raidmode}) /call WardAndYaulp
/call GetTarget
/call Stbevents
/call Incomming
/call CheckBuffs
/call CheckItemBuffs
/doevents Tag
/doevents
/if (!${Target.ID} && (${SpawnCount[NPC radius 40 zradius 12]}-${SpawnCount[PET radius 40 zradius 12]})<1) {
	/call CheckAnchor
}
/if (${GameState.Equal[CHARSELECT]}) /end

/if ((${autosit}==1)&&(${Bool[${Me.Sitting}]}||${Bool[${Me.Mount.ID}]})&&(!${Window[SpellBookWnd].Open})) {
	/if (${Me.PctMana}>98) {
		/if (${Bool[${Me.Mount.ID}]}) {
			/dismount
		} else /stand
	}
}
/if (((${NearestSpawn[NPC zradius 15].Distance}<=${distancetosit} && ${NearestSpawn[NPC zradius 15].ID}) || ${PossibleIncom}) && (${Bool[${Me.Sitting}]}||${Bool[${Me.Mount.ID}]})) {
	/if (${Bool[${Me.Mount.ID}]}) {
		/dismount
	} else /stand
}
/call MedTime
/goto :Start   
/return

Sub SetAssistradius
/if (${OutDoors}) {
	/varset DistancetoAssist ${TankRadOutdoors}
} else {
	/varset DistancetoAssist ${TankRadIndoors}
	/if ((${SpawnCount[NPC radius 250 zradius 50]}-${SpawnCount[PET radius 100 zradius 12]})<2) /varset DistancetoAssist ${TankRadOutdoors}
}
/return
  
Sub MedTime
/if ((${FindItem["Rod of Mystical Transvergance"].InvSlot})&&(${Me.PctMana}<=70)&&(${Me.PctHPs}>=90)&&(${rodwait}<1)) {
	/call Cast "Rod of Mystical Transvergance" item
	/varset rodwait 3000
}
/if ((${autosit}==1)&&(${Me.PctMana}<=97)&&(!${Me.Casting.ID})&&!${PossibleIncom}) {
	/if ((${Bool[${Me.Standing}]})&&(${SpawnCount[NPC radius ${distancetosit} zradius 15]}<1)&&(${Me.Speed}<1)&&(!${Bool[${Me.Mount.ID}]})) {
		/if (!${Bool[${Me.Mount.ID}]} && ${OutDoors} && ${UseMount}) {
			/call Cast "${Mount}" alt
		} else /sit
	}
}
/return

Sub CheckOutDoors
/call cast "${Mount}" alt 1s
/return

Sub MemSpells
  /if (${PossibleIncom}) /return
  /if (${Me.Gem[${PushStun}]}!=1) {
|	/if (${Bool[${Me.Standing}]}) /sit
	/memspell 1 "${PushStun}"
  	/delay 6s ${Me.Gem[${PushStun}]}==1
  }
  /if (${Me.Gem[${GrpHeal}]}!=2) {
|	/if (${Bool[${Me.Standing}]}) /sit
	/memspell 2 "${GrpHeal}"
  	/delay 6s ${Me.Gem[${GrpHeal}]}==2
  }
  /if (${Me.Gem[${RootSpell}]}!=3) {
|	/if (${Bool[${Me.Standing}]}) /sit
	/memspell 3 "${RootSpell}"
  	/delay 4s
  }
  /if (${Me.Gem[${HotHeal}]}!=4) {
|	/if (${Bool[${Me.Standing}]}) /sit
	/memspell 4 "${HotHeal}"
  	/delay 4s
  }
  /if (${Me.Gem[${QuickHeal}]}!=5) {
|	/if (${Bool[${Me.Standing}]}) /sit
	/memspell 5 "${QuickHeal}"
  	/delay 4s
  }
  /if (${Me.Gem[${AggroStun}]}!=6) {
|	/if (${Bool[${Me.Standing}]}) /sit
	/memspell 6 "${AggroStun}"
  	/delay 4s
  }
  /if (${Me.Gem[${UndeadNuke}]}!=7) {
|	/if (${Bool[${Me.Standing}]}) /sit
	/memspell 7 "${UndeadNuke}"
  	/delay 4s
  }
  /if (${Me.Gem[${YaulpWard}]}!=8) {
|	/if (${Bool[${Me.Standing}]}) /sit
	/memspell 8 "${YaulpWard}"
  	/delay 4s
  }
  /if (${Me.Gem[${JoltSpell}]}!=9) {
|	/if (${Bool[${Me.Standing}]}) /sit
	/memspell 9 "${JoltSpell}"
  	/delay 4s
  }
/if (${Window[SpellBookWnd].Open}) /cleanup
/return  

Sub Stbevents
:Hold_Inv
/if (${Me.Invis} && ${HoldonInvis}) {
	/delay 3
	/goto :Hold_Inv
}
:HoldForManCast
/if (${Me.Casting.ID}) {
	/delay 3
	/goto :HoldForManCast
}
/return

Sub GetTarget
/call RefreshAlerts
/if (${Target.ID} && !${ValidCombatTarget}) {
	/squelch /target clear
	/delay 8 !${Target.ID}
	/delay 8 !${Me.TargetOfTarget.ID}
}
/delay 1
|/if (!${Target.ID}) /echo ${SpawnCount[npc radius ${TankRadOutdoors} zradius 20 alert ${AlertListNormal} noalert ${AlertListVoid}]}>0
/if (${SpawnCount[npc radius ${TankRadOutdoors} zradius 20]}>0) {
	/if (${SpawnCount[npc radius ${TankRadOutdoors} zradius 20]}>1) {
		/varset Maxwaitfortarget 30
		:delayloop
		/if (${NearestSpawn[NPC].Speed}>150 || ${NearestSpawn[NPC zradius 30].Distance}<80) {
			/if (${NearestSpawn[NPC].Speed}>150) {
|				/echo Targeting loop 1
				/target ${NearestSpawn[NPC zradius 30]}
			}
			/if (${NearestSpawn[NPC zradius 30].Distance}<80) {
|				/echo LineOfSight? ${LineOfSight[${Target.Y},${Target.X},${Target.Z}:${Me.Y},${Me.X},${Me.Z}]}
				/if (${LineOfSight[${NearestSpawn[NPC zradius 30].Y},${NearestSpawn[NPC zradius 30].X},${NearestSpawn[NPC zradius 30].Z}:${Me.Y},${Me.X},${Me.Z}]}) {
|					/echo Targeting loop 2
					/target ${NearestSpawn[NPC zradius 30]}
				} else {
|					/echo Targeting loop 3
					/target ${NearestSpawn[NPC zradius 30]}
				}
			}
		}
		/if (${Target.ID}) {
			/delay 10 ${Target.Type.Equal[NPC]}
		} else {
			/delay 10 ${Target.ID}
		}
		/if (!${Target.ID} && ${Maxwaitfortarget}>0) /goto :delayloop
	} else {
		/assist ${Puller}
|		/echo Targeting loop 4
		/if (${Target.ID}) {
			/delay 10 ${Target.Type.Equal[NPC]}
		} else {
			/delay 10 ${Target.ID}
		}
	}
	/delay 3
}
|/if (${Target.ID}) /echo Going to check ${Target.CleanName} for validity.
/if (${Target.ID}>0&&${HoTTavail}) /delay 10 ${Me.TargetOfTarget.ID}
/call ValidCombatTargetCheck
/if (!${ValidCombatTarget}) /return
/if (${Target.Named} && ${Target.Level}>=75) {
	/varset Diskbelowhealth 35
	/varset SelfHealbelow 30
	/varset Crittermode TRUE
}
/call Combat
/return

Sub RefreshAlerts
/squelch /alert clear ${AlertListVoid}
/squelch /alert clear ${AlertListDestruct}
/squelch /alert clear ${AlertListNormal}
/squelch /alert clear ${AlertListUndead}
/squelch /alert clear ${AlertListNamed}
/declare sc1 int local
/for sc1 1 to 15
|/echo ${NearestSpawn[${sc1},NPC radius 450 zradius 50].Type.Equal[Pet]} && ${Spawn[PC ${Spawn[ID ${NearestSpawn[${sc1},NPC radius 450 zradius 50].ID}].Master}].ID}
/if (${NearestSpawn[${sc1},NPC radius 450 zradius 50].Type.Equal[Pet]} && ${Spawn[PC ${Spawn[ID ${NearestSpawn[${sc1},NPC radius 450 zradius 50].ID}].Master}].ID}) /squelch /alert add ${AlertListVoid} ${NearestSpawn[${sc1},NPC radius 450 zradius 50].Name}
|/echo ${NearestSpawn[${sc1},NPC radius 450 zradius 50].Class.Name.Equal[Destructible Object]}
/if (${NearestSpawn[${sc1},NPC radius 450 zradius 50].Class.Name.Equal[Destructible Object]}) /squelch /alert add ${AlertListDestruct} ${NearestSpawn[${sc1},NPC radius 450 zradius 50].Name}
|/echo ${NearestSpawn[${sc1},NPC radius 450 zradius 50].Type.NotEqual[Corpse]} && ${NearestSpawn[${sc1},NPC radius 450 zradius 50].Class.Name.NotEqual[Destructible Object]}
/if (${NearestSpawn[${sc1},NPC radius 450 zradius 50].Type.NotEqual[Corpse]} && ${NearestSpawn[${sc1},NPC radius 450 zradius 50].Class.Name.NotEqual[Destructible Object]}) /squelch /alert add ${AlertListNormal} ${NearestSpawn[${sc1},NPC radius 450 zradius 50].Name}
|/echo ${Select[${NearestSpawn[${sc1},NPC radius 450 zradius 50].Body},Undead]}==1
/if (${Select[${NearestSpawn[${sc1},NPC radius 450 zradius 50].Body},Undead]}==1) /squelch /alert add ${AlertListUndead} ${NearestSpawn[${sc1},NPC radius 450 zradius 50].Name}
|/echo ${NearestSpawn[${sc1},NPC radius 450 zradius 50].Named}
/if (${NearestSpawn[${sc1},NPC radius 450 zradius 50].Named}) /squelch /alert add ${AlertListNamed} ${NearestSpawn[${sc1},NPC radius 450 zradius 50].Name}
/next sc1
|/alert list ${AlertListVoid}
|/alert list ${AlertListDestruct}
|/alert list ${AlertListNormal}
|/alert list ${AlertListUndead}
|/alert list ${AlertListNamed}
/return

Sub Combat
/declare nc int local
|/echo Attacking ${Target.CleanName}
/gsay Attacking >>> [+p+]${Target.CleanName}[+x+] <<<
/if (${Crittermode}) /varset healwait 150
/varset TargetLocY ${Target.Y}
/varset TargetLocX ${Target.X}
/varset TurnMobTimer ${PositioningDelay}
/varset VCTid ${Target.ID}
/if (${Target.Distance}>25) {
	/bandolier activate ${BandoThrow}
	/delay 1
	/autofire on
	/delay 1	
	/autofire off
	/bandolier activate ${BandoNorm}
}
/if (!${Me.Combat}) {
	/keypress Ctrl+c
	/notify ActionsWindow ACP_MeleeAttackButton Leftmouseup
	/if (${Bool[${Me.Mount.ID}]}) /dismount
	/if (${Target.ID} && ${Target.Distance}<${Math.Calc[${Target.MaxRangeTo}*0.9]}) {
		/face
		/delay 1s ${Target.Distance}>${Target.MaxRangeTo}
	}
}
|/if (${NearestSpawn[NPC].Speed}>250) /goto :fastincom
/if (${Me.AltAbility[${StunAA}]} && ${Me.AltAbilityReady[${StunAA}]} && ${ValidCombatTarget}) {
	/call cast "${StunAA}" Alt 2s SelfProtection
	/if (${Target.ID}) /face fast nolook
	/delay 5
	/delay 3s !${Me.Casting.ID}
} else /if (${Me.AltAbility[${StunAA2}]} && ${Me.AltAbilityReady[${StunAA2}]} && ${ValidCombatTarget}) {
	/call cast "${StunAA2}" Alt 2s SelfProtection
	/if (${Target.ID}) /face fast nolook
	/delay 5
	/delay 3s !${Me.Casting.ID}
} else {
	/call cast "${AggroStun}" gem6 1s SelfProtection
	/delay 3s !${Me.Casting.ID}
}

/if (${Group.Member[${NearestSpawn[PC Cleric].Name}]}<1 && ${Me.PctHPs}<85) {
	/call Selfhot
} else {
	/if (!${Crittermode}) /call WardAndYaulp
}
:fastincom
/if (${Target.ID}) /face fast nolook
/for nc 1 to 3
/if (${Math.Distance[${Target.Y},${Target.X},${Target.Z}:${AnchorY},${AnchorX},${AnchorZ}]}>${Math.Distance[${AnchorY},${AnchorX},${AnchorZ}]} && ${Target.Distance}>35) /delay 1s ${Target.Distance}<25
/next nc
/if (${Me.TargetOfTarget.ID} && !${Raidmode}) {
	/delay 1s ${Me.TargetOfTarget.Name.NotEqual[${Me.Name}]}
	/delay 1s ${Me.TargetOfTarget.Name.NotEqual[${Me.Name}]}
	/delay 1s ${Me.TargetOfTarget.Name.NotEqual[${Me.Name}]}
}
:CombatLoop
/if (${Window[RespawnWnd].Open} || ${SpawnCount[PC ${Me.Name}]}<1) {
	/doevents ImDead
	/return
}
/if (${Crittermode} && ${Me.PctHPs}>85) /varset healwait 150
/call ValidCombatTargetCheck
/if (!${ValidCombatTarget} && ${Spawn[ID ${VCTid}].Type.NotEqual[Corpse]} && ${Spawn[ID ${VCTid}].Distance}<140) {
	/target id ${VCTid}
	/delay 5 ${Target.ID}==${VCTid}
	/call ValidCombatTargetCheck
}
/if (!${ValidCombatTarget}) {
	/keypress forward
	/keypress back
	/call ResetSub
	/return
}
/doevents
/call FaceNdistance
/if (${ValidCombatTarget} && !${Me.Combat} && ${Enrageresettime}<1) {
	/keypress Ctrl+c
	/notify ActionsWindow ACP_MeleeAttackButton Leftmouseup
}
/call SelfProtection
/if (!${Crittermode}) /call WardAndYaulp
/call FaceNdistance
/call ProtectHealer
/call FaceNdistance
/if (${ValidCombatTarget}) /call SpecialIT
/call FaceNdistance
/if (${CombatStickMode} && ${Target.Distance}<=${Target.MaxRangeTo} && ${Target.PctHPs}>20) {
	/squelch /stick off
	/varset CombatStickMode FALSE
}
/if (${Anchor} && !${AnchorStunFree} && ${ValidCombatTarget} && ${Target.Level}<79 && !${MobSummons} && !${Target.Named}) /call Fightincamp
/if (${Anchor} && ${AnchorStunFree} && ${ValidCombatTarget} && ${Target.Level}<79 && !${Target.Named}) /call Fightincamp2
/goto :CombatLoop
/return

Sub SetMount
/if (${Me.AltAbility[Valiant Steed]}) {
	/varset Mount "Valiant Steed"
	/varset UseMount TRUE
} else {
	/if (${Me.AltAbility[Holy Steed]}) {
		/varset Mount "Holy Steed"
		/varset UseMount TRUE
	} else {
		/varset UseMount FALSE
	}
}
|/echo Mount Set to ${Mount}
/return

Sub FaceNdistance
/if (!${Anchor} && !${TempAnchor}) {
|	/echo Setting TempAnchor to X: ${Me.X.Int} Y: ${Me.Y.Int}
	/varset AnchorY ${Me.Y.Int}
	/varset AnchorX ${Me.X.Int}
	/varset AnchorZ ${Me.Z.Int}
	/varcalc AnchorZ ${AnchorZ}+10
	/varset TempAnchor TRUE
}
/declare nj int local
/if ((${Me.TargetOfTarget.Name.NotEqual[${Me.Name}]} && ${Me.TargetOfTarget.Type.Equal[PC]} && ${Target.Type.Equal[NPC]}) && ${Me.AbilityReady[Taunt]} && ${Target.Distance}<${Target.MaxRangeTo}*0.8) {
	/face fast
	/doability "Taunt"
	/delay 5
	/doevents TauntFail
}
/if (${Crittermode} && ${Me.PctHPs}>85) /varset healwait 150
/if (${ValidCombatTarget} && (${Target.Distance}>${Target.MaxRangeTo} || ${Target.Speed}>0) && !${CombatStickMode} && ${Target.Distance}<140) {
	/squelch /stick 5
	/varset CombatStickMode TRUE
}
/if (${Me.TargetOfTarget.Name.NotEqual[${Me.Name}]} && (${Target.Type.Equal[NPC]} && ${Me.TargetOfTarget.Type.Equal[PC]}) && ${ValidCombatTarget} && ${Target.PctHPs}<=97 && ${Math.Distance[${AnchorY},${AnchorX},${AnchorZ}]}<140) {
	/if (${Target.Distance}>${Math.Distance[${Target.Y},${Target.X},${Target.Z}:${Spawn[ID ${Me.TargetOfTarget.ID}].Y},${Spawn[ID ${Me.TargetOfTarget.ID}].X},${Spawn[ID ${Me.TargetOfTarget.ID}].Z}]} && ${Target.Speed}<1) {
		/squelch /stick ${Math.Calc[${Math.Distance[${Target.Y},${Target.X},${Target.Z}:${Spawn[ID ${Me.TargetOfTarget.ID}].Y},${Spawn[ID ${Me.TargetOfTarget.ID}].X},${Spawn[ID ${Me.TargetOfTarget.ID}].Z}]}/2]}
		/varset CombatStickMode TRUE
	}
}
/if (${ValidCombatTarget} && ${Target.ID} && ${Target.Distance}<=${Target.MaxRangeTo}*0.9) /varset proxitimer 50
/if (${proxitimer}<1) {
	/squelch /stick off
	/keypress back
	/varset CombatStickMode FALSE
	/varset proxitimer 50
}
/doevents
/if (${ValidCombatTarget} && ${Target.ID} && !${CombatStickMode}) { 
	/face fast
}
/if (${Target.Distance}>${Target.MaxRangeTo} && !${Me.Casting.ID} && ${Me.Speed}<1 && ${CombatStickMode}) /varset CombatStickMode FALSE
/if (${ValidCombatTarget} && !${Me.Casting.ID}) {
	/if ((${Target.Distance}>${Target.MaxRangeTo} || (${Target.PctHPs}<20 && ${Target.Speed}>10)) && ${Math.Distance[${AnchorY},${AnchorX},${AnchorZ}]}<140) {
		/if (${Target.ID} && !${CombatStickMode}) {
			/face fast nolook
			/if (${Target.PctHPs}<20 && ${Target.Speed}>10) /call cast "${RootSpell}" 1sec
			/delay 3
		}
		/squelch /stick ${Math.Calc[${Target.MaxRangeTo}*0.2]}
		/varset CombatStickMode TRUE
		/return
	}
	/if (!${CombatStickMode}) {
		/if (${Target.Distance}>${Target.MaxRangeTo}*0.8 || ${Target.Distance}>28) {
			/if (${Me.Running} && ${Me.Buff[Selo's Accelerating Chorus].ID}>0) {
				/keypress Ctrl+m
				/notify ActionsWindow AMP_WalkButton Leftmouseup
			}
			/for nj 1 to 15
				/keypress forward hold
				/delay 0.2
				/keypress forward
				/if (${Target.Distance}<${Target.MaxRangeTo}*0.5 || (${Target.PctHPs}<20 && ${Target.Speed}>10)) /goto :closeenough
			/next nj
			:closeenough
			/if (!${Me.Running}) {
				/keypress Ctrl+m
				/notify ActionsWindow AMP_RunButton Leftmouseup
			}
			/return
		}
		/if (${Math.Distance[${AnchorY},${AnchorX},${AnchorZ}]}>30 && ${MobSummons} && ${Target.Level}<79 && !${Target.Named}) {
			/face away fast loc ${AnchorY},${AnchorX} nolook
			/if (${Me.Running} && ${Me.Buff[Selo's Accelerating Chorus].ID}>0) {
				/keypress Ctrl+m
				/notify ActionsWindow AMP_WalkButton Leftmouseup
			}
			/for nj 1 to 15
				/keypress back hold
				/delay 0.1
				/keypress back
			/if (${Target.Distance}>${Target.MaxRangeTo}*0.7 || ${Target.Distance}>27 || ${Math.Distance[${AnchorY},${AnchorX},${AnchorZ}]}<15 || (${Target.PctHPs}<20 && ${Target.Speed}>10)) /goto :farenough
			/next nj
			:farenough
			/if (!${Me.Running}) {
				/keypress Ctrl+m
				/notify ActionsWindow AMP_RunButton Leftmouseup
			}
		}
	}
}
/return

Sub ValidCombatTargetCheck
/varset ValidCombatTarget FALSE
|/if (${Target.ID}>0 && ${Target.PctHPs}>98) /echo VCTif1 (${Target.ID}>0 && ${Target.Type.NotEqual[Corpse]} && !${Bool[${Spawn[ID ${Target.ID}].Master.Type.Equal[PC]}]} && ${Target.Type.NotEqual[PC]} && (${Target.Distance}<${DistancetoAssist}||(${Target.Named}&&${Target.Distance}<${TankRadOutdoors})) && (${Target.Class.Name.NotEqual[Destructible Object]} || (${Target.Class.Name.Equal[Destructible Object]} && ${Target.PctHPs}<100))
/if (${Target.ID}>0 && ${Target.Type.NotEqual[Corpse]} && !${Bool[${Spawn[ID ${Target.ID}].Master.Type.Equal[PC]}]} && ${Target.Type.NotEqual[PC]} && (${Target.Distance}<${DistancetoAssist}||(${Target.Named}&&${Target.Distance}<${TankRadOutdoors})) && (${Target.Class.Name.NotEqual[Destructible Object]} || (${Target.Class.Name.Equal[Destructible Object]} && ${Target.PctHPs}<100)) ) {
|	/if (${Target.ID}>0 && ${Target.PctHPs}>98) /echo VCT Loop1 TRUE
	/varset ValidCombatTarget TRUE
|	/echo (${Me.TargetOfTarget.ID}>0 && (${Me.TargetOfTarget.Name.NotEqual[${Group.Member[${Group.Member[${Me.TargetOfTarget.Name}]}]}]}||${Me.TargetOfTarget.Name.NotEqual[${Raid.Member[${Me.TargetOfTarget.Name}]}]}) && ${Me.TargetOfTarget.Name.NotEqual[${Puller}]})
	/if (${Me.TargetOfTarget.ID}>0) /if (${Group.Member[${Me.TargetOfTarget.Name}]}<1) /if (${Me.TargetOfTarget.Name.NotEqual[${Me}]}) /if (!${Bool[${Raid.Member[${Me.TargetOfTarget.Name}]}]}) /if (${Me.TargetOfTarget.Name.NotEqual[${Puller}]}) {
		/echo Target of Target is not a Raid/Groupmember and also not the assigned MA, ignoring this Target.
		/varset ValidCombatTarget FALSE
		/goto :ContVCTcheck
	}
} else {
	:ContVCTcheck
	/call CheckGrpOnAggro
|	/if (${Target.ID}>0 && ${Target.PctHPs}>98) /echo VCTif2 (${Target.ID}>0 && ${Target.Type.NotEqual[Corpse]} && !${Bool[${Spawn[ID ${Target.ID}].Master.Type.Equal[PC]}]} && ${Target.Distance}<${DistancetoAssist} && (${Target.Class.Name.NotEqual[Destructible Object]} || (${Target.Class.Name.Equal[Destructible Object]} && ${Target.PctHPs}<100))
	/if (${Target.ID}>0 && ${Target.Type.NotEqual[PC]} && ${Target.Type.NotEqual[Corpse]} && !${Bool[${Spawn[ID ${Target.ID}].Master.Type.Equal[PC]}]} && ${Target.Distance}<${DistancetoAssist} && (${Target.Class.Name.NotEqual[Destructible Object]} || (${Target.Class.Name.Equal[Destructible Object]} && ${Target.PctHPs}<100)) ) {
|		/if (${Target.ID}>0 && ${Target.PctHPs}>98) /echo VCT Loop2 TRUE
		/varset ValidCombatTarget TRUE
		/if (${Target.ID}>0&&${HoTTavail}) /delay 10 ${Me.TargetOfTarget.ID}
|		/echo (${Me.TargetOfTarget.ID}>0) (${Group.Member[${Me.TargetOfTarget.Name}]}<1) (${Me.TargetOfTarget.Name.NotEqual[${Me}]}) (!${Bool[${Raid.Member[${Me.TargetOfTarget.Name}]}]}) (${Me.TargetOfTarget.Name.NotEqual[${Puller}]})
		/if (${Me.TargetOfTarget.ID}>0) /if (${Group.Member[${Me.TargetOfTarget.Name}]}<1) /if (${Me.TargetOfTarget.Name.NotEqual[${Me}]}) /if (!${Bool[${Raid.Member[${Me.TargetOfTarget.Name}]}]}) /if (${Me.TargetOfTarget.Name.NotEqual[${Puller}]}) {
|			/echo Target of Target is not a Raid/Groupmember and also not the assigned MA, ignoring this Target.
			/varset ValidCombatTarget FALSE
			/goto :EndVCTcheck
		}
		/if (${Me.TargetOfTarget.ID}<1 && ${Target.PctHPs}>99) {
			/delay 5
|			/echo No ToT and targets health is above 99, clearing Target.
			/squelch /target clear
			/delay 8 !${Target.ID}
			/delay 8 !${Me.TargetOfTarget.ID}
			/varset ValidCombatTarget FALSE
			/goto :EndVCTcheck
		}
	} else {
		/varset ValidCombatTarget FALSE
		/if (${Target.Type.Equal[Corpse]} || ${Target.Type.Equal[PC]} || ${Spawn[ID ${Target.ID}].Master.Type.Equal[PC].Bool} || (${Target.Class.Name.Equal[Destructible Object]} && ${Target.PctHPs}>99)) {
			/echo Clearing Targetwindow.
			/delay 5
			/squelch /target clear
			/delay 8 !${Target.ID}
			/delay 8 !${Me.TargetOfTarget.ID}
		}
	}
}
:EndVCTcheck
/return

Sub SelfProtection
/if (${Target.ID}>0 && ${Target.Type.Equal[NPC]}) /face nolook
/if ((${Me.TargetOfTarget.Name.NotEqual[${Me.Name}]} && ${Me.TargetOfTarget.Type.Equal[PC]} && ${Target.Type.Equal[NPC]}) && ${Me.AbilityReady[Taunt]} && ${Target.Distance}<${Target.MaxRangeTo}*0.8) {
	/face fast
	/doability "Taunt"
	/delay 5
	/doevents TauntFail
}
/if (${Crittermode} && ${Me.PctHPs}>85) /varset healwait 150
/if (${Me.PctHPs}<${Diskbelowhealth}+5) {
	/if (${Me.Casting.ID}>0 && (${Me.PctHPs}<${Diskbelowhealth}+5 || ${Me.PctHPs}<${SelfHealbelow}+5)) /call Interrupt
	/if (${Me.CombatAbility[${CombatAbltyDisk}]}>0 && ${Me.CombatAbilityReady[${CombatAbltyDisk}]} && ${Me.PctHPs}<${Diskbelowhealth}  && !${Me.AltAbilityReady[${DiscAA}]}) {
		/doability ${CombatAbltyDisk}
	}
	/if (${Me.AltAbility[${DiscAA}]}>0 && ${Me.AltAbilityReady[${DiscAA}]} && ${Me.PctHPs}<${Diskbelowhealth}) {
		/call cast "${DiscAA}" alt 1s
	}
	/if (${Me.PctHPs}<${SelfHealbelow}) {
		/varset CTtempID NULL
		/if (${Target.Type.Equal[NPC]}) /varset CTtempID ${Target.ID}
		/echo My health is ${Me.PctHPs} and Healwaittimer is down to ${healwait}
		/if (${Me.PctHPs}<=${SelfHealbelow} && ${FindItem[${InstantHealpot}].InvSlot}>0 && ${FindItem[${InstantHealpot}].Timer}<1) {
			/potionbelt activate 1
			/goto :retarget
		}
		/if (${Me.AltAbility[${GrpHealAA}]}>0 && ${Me.AltAbilityReady[${GrpHealAA}]} && ${Me.PctHPs}<=${SelfHealbelow}-5 && (${healwait}<110 || ${healwait}>130) ) {
			/call cast "${GrpHealAA}" alt 1s
		}
		/if ((${Me.PctHPs}<${SelfHealbelow}-10 || ${Me.PctHPs}<10) && ${Me.AbilityReady["Lay Hands"]}) {
			/target myself
			/delay 8 ${Target.ID}==${Me.ID}
			/if (${Me.PctHPs}<${SelfHealbelow}) {
				/doability "Lay Hands"
				/goto :retarget
			}
		}
		/if (${Me.SpellReady[${QuickHeal}]} && ${Me.CurrentMana}>${Math.Calc[${Spell[${QuickHeal}].Mana}+100]} && ${Me.PctHPs}<=${SelfHealbelow} && (${healwait}<110 || ${healwait}>130) ) {
			/target myself
			/delay 8 ${Target.ID}==${Me.ID}
			/if (${Me.PctHPs}<${SelfHealbelow}) /call cast "${QuickHeal}" gem5 2s
			/delay 2s !${Me.Casting.ID}
		}
		:retarget
		/if (${Crittermode} && ${Me.PctHPs}>85) /varset healwait 150
		/echo My health is now ${Me.PctHPs} and Healwaittimer is down to ${healwait}
		/if (${Spawn[ID ${CTtempID} NPC].Type.NotEqual[Corpse]}) {
			/target id ${CTtempID}
			/delay 1s ${Target.Type.Equal[NPC]}
		}
		/call ValidCombatTargetCheck
	}
}
/return

Sub Incomming
/varset PossibleIncom FALSE
/declare Spawncounter int local
/for Spawncounter 1 to ${SpawnCount[NPC radius 450]}
/if (${Spawn[${NearestSpawn[${Spawncounter}, NPC]}].Speed}>150) {
	/varset PossibleIncom TRUE
	/goto :IncommCont
}
/next Spawncounter
/if (!${PossibleIncom}) /return
:IncommCont
/if (!${Bool[${Me.Standing}]}) {
	/stand
}
/face nolook loc ${Spawn[${NearestSpawn[${Spawncounter}, NPC]}].Y},${Spawn[${NearestSpawn[${Spawncounter}, NPC]}].X}
/if (!${Window[CastingWindow].Open}) /return
/if (${Spawn[${NearestSpawn[${Spawncounter}, NPC]}].Distance}<200) /call Interrupt
/return

Sub Selfhot
/if (${Group.Member[${NearestSpawn[PC Cleric].Name}]}>1) {
	/echo returning from Selfhot cause retard kicked in.
	/return
}
/echo Sub Selfhot
/if (${Me.PctMana}>30 && ${Spell[${HotHeal}].Stacks} && ${HotTimer}<1) {
	/if (${Me.Combat}) {
		/keypress Ctrl+c
		/notify ActionsWindow ACP_MeleeAttackButton Leftmouseup
	}
	/varset CTtempID NULL
	/if (${Target.Type.Equal[NPC]}) /varset CTtempID ${Target.ID}
	/target ${Me.CleanName}
	/delay 8 ${Target.Type.Equal[PC]}
	/delay 2
	/if (${Spell[${HotHeal}].Stacks}) /call cast "${HotHeal}" gem4 2s Faceit
	/if (${Macro.Return.Equal[CAST_SUCCESS]}) /varset HotTimer ${Spell[${HotHeal}].Duration.TotalSeconds}s
	/delay 2s !${Me.Casting.ID}
	/target id ${CTtempID}
	/delay 1s ${Target.Type.Equal[NPC]}
	/call ValidCombatTargetCheck
	/if (!${Me.Combat} && ${ValidCombatTarget}) {
		/keypress Ctrl+c
		/notify ActionsWindow ACP_MeleeAttackButton Leftmouseup
	}
} else {
	/call Faceit
}
/return

Sub WardAndYaulp
/if (${Me.Buff[${YaulpWard}].ID} && ${WardTimer}>5) /return
/if (${Me.PctMana}>30 && ${Spell[${YaulpWard}].Stacks} && (${WardTimer}<6 || !${Me.Buff[${YaulpWard}].ID}) && ${Me.SpellReady[${YaulpWard}]}) {
	/call cast "${YaulpWard}" gem8 1s
	/delay 5s !${Me.Casting.ID}
	/if (${Macro.Return.Equal[CAST_SUCCESS]}) {
		/varset WardTimer ${Me.Buff[${YaulpWard}].Duration.TotalSeconds}s
	}
}
/return

Sub Selfhot2
/echo Sub Slefhot2
/if (${Me.PctMana}>30  && ${Spell[${HotHeal}].Stacks} && ${HotTimer}<1) {
	/target myself
	/delay 8 ${Target.Type.Equal[PC]}
	/delay 2
	/if (${Spell[${HotHeal}].Stacks}) /call cast "${HotHeal}" gem4 2s
	/if (${Macro.Return.Equal[CAST_SUCCESS]}) /varset HotTimer ${Spell[${HotHeal}].Duration.TotalSeconds}s
	/delay 2s !${Me.Casting.ID}
}
/return

Sub Faceit
/face loc ${TargetLocY},${TargetLocX} nolook
/return

Sub SpecialIT
/doevents
/if ((${Me.TargetOfTarget.Name.NotEqual[${Me.Name}]} && ${Me.TargetOfTarget.Type.Equal[PC]} && ${Target.Type.Equal[NPC]}) && ${Me.AbilityReady[Taunt]} && ${Target.Distance}<${Target.MaxRangeTo}*0.8) {
	/face fast
	/doability "Taunt"
	/delay 5
	/doevents TauntFail
}
/if (!${Me.TargetOfTarget.Name.Equal[${Me}]} && ${Target.Type.Equal[NPC]} && ${Target.PctHPs}>20) { 
	/call Agroing
}
/if (${Me.PctMana}>30) {
	/if (${Me.SpellReady[${JoltSpell}]} && ${Jolttimer}<1 && !${Target.Named}) {
		/call cast "${JoltSpell}" gem9 1s SelfProtection
		/varset Jolttimer ${Joltrecastdelay}
	}
	/delay 3s !${Me.Casting.ID}
	/if ((${Me.TargetOfTarget.Name.NotEqual[${Me.Name}]} && ${Me.TargetOfTarget.Type.Equal[PC]} && ${Target.Type.Equal[NPC]}) && ${Me.AbilityReady[Taunt]} && ${Target.Distance}<${Target.MaxRangeTo}*0.8) {
		/face fast
		/doability "Taunt"
		/delay 5
		/doevents TauntFail
	}
	/delay 3
	/if ( ${Me.SpellReady[${UndeadNuke}]} && ${Select[${Target.Body},Undead]}==1 && ${Me.PctMana}>40 ) {
		/call cast "${UndeadNuke}" gem7 2s SelfProtection
	}
}
/if (${Me.AbilityReady[Bash]} && ${Target.Type.Equal[NPC]}) /doability "Bash"
/if (${Me.AbilityReady[Taunt]} && ${Me.TargetOfTarget.Name.NotEqual[${Me}]} && ${Target.Type.Equal[NPC]} && ${Target.Distance}<${Target.MaxRangeTo}*0.8) {
	/face fast
	/doability "Taunt"
	/delay 5
	/doevents TauntFail
}
/return
  
  
Sub ResetSub
/if (${Me.Combat}) {
	/keypress Ctrl+c
	/notify ActionsWindow ACP_MeleeAttackButton Leftmouseup
}
/look 0
/varcalc Mobs_Killed (${Mobs_Killed}+1) 
/varset ValidCombatTarget	FALSE
/varset MobSummons		FALSE
/varset TempAnchor		FALSE
/varset Crittermode		FALSE
/varset VCTid			NULL
/varset CTtempID		NULL
/varset Diskbelowhealth		${OldDiskbelowhealth}
/varset SelfHealbelow		${OldSelfHealbelow}
/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
/echo Total Mobs killed so far:  ${Mobs_Killed}
/varset Exper ${Me.PctExp}
/varset AAExp ${Me.PctAAExp}
/squelch /stick off
/doevents
/return
  
  
Sub Event_EXP
/call CheckAnchor
/return
  

Sub CheckGrpOnAggro
/declare temptarghold bool local FALSE
/for gmember 0 to ${Group}
/if (${Spawn[${Group.Member[${gmember}]}].NearestSpawn[npc radius 40 zradius 20].ID} && ${Target.ID}!=${Spawn[${Group.Member[${gmember}]}].NearestSpawn[npc radius 40 zradius 20].ID} && ${Spawn[${Group.Member[${gmember}]}].Distance}<130 && ${Spawn[${Group.Member[${gmember}]}].Name.NotEqual[${Puller}]} && ${Spawn[${Group.Member[${gmember}]}].NearestSpawn[npc radius 40 zradius 20].Class.Name.NotEqual[Destructible Object]}) {
	/if (${Target.ID} && ${Target.Type.Equal[NPC]}) {
		/varset temptarghold TRUE
		/keypress TAB
		/delay 10 ${Target.Name.Equal[${Me}]}
	}
	/target ID ${Spawn[${Group.Member[${gmember}]}].NearestSpawn[npc radius 40 zradius 20].ID}
	/delay 8 ${Target.ID}==${Spawn[${Group.Member[${gmember}]}].NearestSpawn[npc radius 40 zradius 20].ID}
	/if (${Target.ID}&&${HoTTavail}) /delay 10 ${Me.TargetOfTarget.ID}
|	/if (${Target.ID}) /echo Grpaggrocheck (${Target.ID} && ${Target.Type.Equal[NPC]} && ${Me.TargetOfTarget.ID} && (${Me.TargetOfTarget.Name.Equal[${Group.Member[${Group.Member[${Me.TargetOfTarget.Name}]}]}]}||${Me.TargetOfTarget.Name.Equal[${Raid.Member[${Me.TargetOfTarget.Name}]}]}))
	/if (${Target.ID} && ${Target.Type.Equal[NPC]} && ${Me.TargetOfTarget.ID} && (${Me.TargetOfTarget.Name.Equal[${Group.Member[${Group.Member[${Me.TargetOfTarget.Name}]}]}]}||${Me.TargetOfTarget.Name.Equal[${Raid.Member[${Me.TargetOfTarget.Name}]}]})) {
		/return
	} else {
		/if (${Target.ID} && ${Target.Type.Equal[NPC]} && ${Me.TargetOfTarget.ID}) {
			/if (${temptarghold}) {
				/keypress TAB
				/delay 8
			} else {
				/squelch /target clear
				/delay 8 !${Target.ID}
			}
		}
	}
}
/next gmember
/return

Sub ProtectHealer
/if ((${Me.TargetOfTarget.Name.NotEqual[${Me.Name}]} && ${Me.TargetOfTarget.Type.Equal[PC]} && ${Target.Type.Equal[NPC]}) && ${Me.AbilityReady[Taunt]} && ${Target.Distance}<13) {
	/face fast
	/doability "Taunt"
	/delay 5
	/doevents TauntFail
}
/for gmember 0 to ${Group}
	/if ( (${Group.Member[${gmember}].Class.Name.Equal[Cleric]} && ${Group.Member[${gmember}].PctHPs}<${HealClrBelow}) || (${Group.Member[${gmember}].Class.Name.Equal[Shaman]} && ${Group.Member[${gmember}].PctHPs}<${HealShmBelow}) ) {
		/if (${Me.AltAbilityReady[${GrpHealAA}]} && ${Group.Member[${gmember}].Distance}<100) {
			/call cast "${GrpHealAA}" alt 1s
		} else {
			/if (${Me.PctMana}>30 && ${Group.Member[${gmember}].Distance}<${Spell[${QuickHeal}].Range}) {
				/if (${Me.SpellReady[${QuickHeal}]}) {
					/target ${Group.Member[${gmember}]}
					/delay 8 ${Target.CleanName.Equal[${Group.Member[${gmember}].Name}]}
					/call cast "${QuickHeal}" gem5 2s
				} else {
					/echo ${QuickHeal} not ready.
					/if (${Me.SpellReady[${HotHeal}]}) {
						/target ${Group.Member[${gmember}]}
						/delay 8 ${Target.CleanName.Equal[${Group.Member[${gmember}].Name}]}
						/call cast "${HotHeal}" gem5 2s
					} else {
						/echo ${HotHeal} also not ready.
					}
				}
				/delay 2s !${Me.Casting.ID}
			} else { 
				/call Agroing
			}
		}
	}
/next gmember
/return

Sub CheckGrpLoSight
/for gmember 1 to ${Group}
/if (${LineOfSight[${Group.Member[${gmember}].Y},${Group.Member[${gmember}].X}:${Me.Y},${Me.X}]} && !${GrpLosState}) {
	/varset GrpLosState TRUE
	/varset LosGrpMbr ${Group.Member[${gmember}].ID}
}
/next gmember
/return


sub HitObstacle 
     /keypress forward 
     /keypress back hold 
     /delay 5 
     /keypress back 
     /if (${Math.Rand[2]}) { 
        /keypress strafe_right hold 
        /delay 3 
        /keypress strafe_right 
     } else { 
        /keypress strafe_left hold 
        /delay 3 
        /keypress strafe_left 
     } 
     /keypress forward hold 
/return

Sub Fightincamp
/if (${Me.TargetOfTarget.Name.NotEqual[${Me.Name}]} && ${Me.TargetOfTarget.Type.Equal[PC]} && ${Target.Type.Equal[NPC]} && ${Me.TargetOfTarget.ID}) /return
/if ((${Math.Distance[${AnchorY},${AnchorX}]}>25 || ${Target.DistanceZ}>15) && !${TurnMobTimer} && (${Target.PctHPs}>15 || (${Target.PctHPs}<15 && ${Target.Speed}<1))) {
	/if (${Target.Z}>${Math.Calc[${Me.Z}+15]}) {
		/if (${Target.ID} && ${Target.Type.Equal[NPC]}) /squelch /face away nolook
		/delay 5
		/face fast away loc ${Target.Y},${Target.X} nolook
	} else {
		/face loc ${AnchorY},${AnchorX} nolook
		/delay 5
		/face fast loc ${AnchorY},${AnchorX} nolook
		/keypress forward hold
		/delay 7 ${Math.Distance[${AnchorY},${AnchorX}]}<10
		/keypress back
		/varset CombatStickMode FALSE
	}
	/if (${Me.AltAbility[${StunAA}]} && ${Me.AltAbilityReady[${StunAA}]}) {
		/call cast "${StunAA}" Alt 2s SelfProtection
	} else /if (${Me.AltAbility[${StunAA2}]} && ${Me.AltAbilityReady[${StunAA2}]}) {
		/call cast "${StunAA2}" Alt 2s SelfProtection
	} else {
		/call cast "${PushStun}" gem1 1s SelfProtection
	}
	/face loc ${AnchorY},${AnchorX} nolook
	/delay 4
	/face fast loc ${AnchorY},${AnchorX} nolook
	/if (${Me.SpellReady[${PushStun}]}) /call cast "${PushStun}" gem1 1s SelfProtection
	/varset TurnMobTimer ${PositioningDelay}
	/varset CombatStickMode FALSE
	/delay 1s ${Me.TargetOfTarget.ID} && ${Me.TargetOfTarget.Name.NotEqual[${Me.Name}]}
	/delay 3s !${Me.Casting.ID}
	/if (${Target.ID} && ${Target.Type.Equal[NPC]}) /face nolook
	/delay 3
	/if (${Target.ID} && ${Target.Type.Equal[NPC]}) /face fast nolook
	/delay 3
}
/return

Sub Fightincamp2
/if (${TurnMobTimer}>0 || ${Target.PctHPs}<15 || ${Target.Speed}>5) /return
/if (${Me.TargetOfTarget.Name.NotEqual[${Me}]} && ${Target.Type.Equal[NPC]} && ${Me.TargetOfTarget.ID}) {
	/varset TurnMobTimer ${PositioningDelay}
	/return
}
/declare fc1 int local
/declare fctimer1 timer local
/if (${Math.Distance[${AnchorY},${AnchorX}]}>45 || ${Target.DistanceZ}>15) {
	/squelch /stick off
	/varset CombatStickMode FALSE
	:summonedandretry
	/face away loc ${AnchorY},${AnchorX} nolook
	/delay 5
	/face away loc ${AnchorY},${AnchorX} fast nolook
	/keypress back hold
	:gottomovesomemore
	/for fc1 1 to 5
	/delay 3 ${Math.Distance[${AnchorY},${AnchorX}]}<15
	/if (${Math.Distance[${AnchorY},${AnchorX}]}<15) /goto :movedenough
	/next fc1
	:movedenough
	/keypress forward
	/if (${MobSummons} && ${Me.Type.NotEqual[Corpse]} && (${Math.Distance[${AnchorY},${AnchorX}]}>45 || ${Target.DistanceZ}>15)) /goto :summonedandretry
	/if (${Target.Distance}>${Target.MaxRange} || ${Target.DistanceZ}>15) {
		/if (${Target.ID} && ${Target.Type.Equal[NPC]}) {
			/squelch /face away nolook
			/delay 5
			/face fast away loc ${Target.Y},${Target.X} nolook
			/if (${Me.AltAbility[${StunAA}]} && ${Me.AltAbilityReady[${StunAA}]}) {
				/call cast "${StunAA}" Alt 2s SelfProtection
			} else {
				/call cast "${PushStun}" gem1 1s SelfProtection
			}
			/varset fctimer1 30
			:waitformob
			/if (${Me.TargetOfTarget.ID} && ${Me.TargetOfTarget.Name.NotEqual[${Me.Name}]} && !${Me.Casting.ID}) /goto :cantwaitlonger
			/if (${fctimer1}>0) /goto :waitformob
			:cantwaitlonger
		}
	}
	/varset TurnMobTimer ${PositioningDelay}
	/delay 2
	/delay 30 !${Me.Casting.ID}
}
/return

Sub Event_Canthit
/varcalc CanthitCount ${CanthitCount}+1
/if (${CanthitCount}>4) {
	/varset CanthitCount 0
	/face loc ${AnchorY},${AnchorX} nolook
	/delay 5
	/if (${Me.AltAbility[${StunAA}]} && ${Me.AltAbilityReady[${StunAA}]}) {
		/call cast "${StunAA}" Alt 2s SelfProtection
	} else /if (${Me.AltAbility[${StunAA2}]} && ${Me.AltAbilityReady[${StunAA2}]}) {
		/call cast "${StunAA2}" Alt 2s SelfProtection
	} else {
		/call cast "${PushStun}" gem1 1s SelfProtection
	}
	/face loc ${AnchorY},${AnchorX} nolook
	/if (${Me.SpellReady[${PushStun}]}) /call cast "${PushStun}" gem1 1s SelfProtection
	/if (${Target.ID}) {
		/if (${Target.Distance}>${Target.MaxRangeTo}) {
			/squelch /stick ${Math.Calc[${Target.MaxRangeTo}*0.5]}
			/varset CombatStickMode TRUE
		} else {
			/squelch /stick back 13
			/varset CombatStickMode TRUE
		}
		/delay 8
		/squelch /stick off
		/varset CombatStickMode FALSE
		/delay 5
		/if (${Target.ID}) /face nolook
	}
	/varset TurnMobTimer ${PositioningDelay}
}
/return

Sub Event_Returntoanchor
/if (!${Bool[${Me.Standing}]}) {
	/stand
}
/call CheckAnchor
/return
  
Sub Event_Tag(line, SenderName)
/if (${SenderName.Arg[1].Equal[${Puller}]}) {

/if (${Target.ID} && ${Target.Type.Equal[NPC]}) /varset CTtempID ${Target.ID}
/assist ${Puller}
/delay 8 ${Target.ID}
/if (${Target.ID} && ${Target.Type.Equal[NPC]}) {
	/face nolook
	/delay 5
} else {
	/target id ${CTtempID}
	/delay 8 ${Target.ID}
	/if (${Target.Type.Equal[PC]}) /squelch /target clear
	/return
}
/if (!${Me.Combat}) {
	/keypress Ctrl+c
	/notify ActionsWindow ACP_MeleeAttackButton Leftmouseup
}
/gsay Tagging >>> ${Target.CleanName} <<<
/if (${Me.SpellReady[${AggroStun}]}) {
	/call cast "${AggroStun}" gem6 1s
	/delay 2s !${Me.Casting.ID}
	/delay 4
}
/if (${Me.AltAbility[${StunAA}]} && ${Me.AltAbilityReady[${StunAA}]}) {
	/call cast "${StunAA}" Alt 2s
	/delay 2s !${Me.Casting.ID}
}
/if (${Me.AltAbility[${StunAA2}]} && ${Me.AltAbilityReady[${StunAA2}]}) {
	/call cast "${StunAA2}" Alt 2s
	/delay 2s !${Me.Casting.ID}
}
/if (${Me.SpellReady[${JoltSpell}]}) {
	/call cast "${JoltSpell}" gem9 1s
	/delay 2s !${Me.Casting.ID}
}
/squelch /stick ${Math.Calc[${Target.MaxRangeTo}*0.5]}
/varset CombatStickMode TRUE
/delay 3s ${Target.Distance}<${Target.MaxRangeTo}*0.7 || ${Target.Distance}>50

}
/return

Sub Event_HotonInc(line, SenderName)
/if (${SenderName.Arg[1].Equal[${Puller}]}) {
	/call Selfhot2
}
/return

  
  
Sub CheckBuffs
/if (${Rebuffstate} && !${NearestSpawn[NPC radius 60 zradius 15].ID} && ${Me.PctMana}>20) {
/Echo Checking Buffs real quick.
/declare i int local 1 
/for i 1 to ${SpellBufftodo.Size} 
	/doevents 
	/call Incomming
	/if (${PossibleIncom}) /goto :skipbuff
	/if (${Spell[${SpellBufftodo[${i}]}].Mana}>${Me.CurrentMana}) /goto :skipbuff
	/if (${Me.Book[${SpellBufftodo[${i}]}]}==0) /goto :skipbuff
	/if (!${Me.Buff[${SpellBufftodo[${i}]}].ID} && !${Me.Song[${SpellBufftodo[${i}]} Effect].ID} && ${Spell[${SpellBufftodo[${i}]}].Stacks}) { 
		/keypress TAB
		/delay 3 
		/target myself
		/echo *** Hang on ! Rebuffing ${SpellBufftodo[${i}]} 
		/call cast "${SpellBufftodo[${i}]}" gem8 8s Incomming
		/if (${Macro.Return.Equal[CAST_SUCCESS]}) /varset Rebuffstate FALSE
		/call HoTTcheck
		/keypress TAB
		/delay 3s ${Target.Type.Equal[NPC]}
		/delay 3
		/if (${Target.Type.Equal[PC]}) {
			/squelch /target clear
		}
	} else /varset Rebuffstate FALSE
:skipbuff
/if (${Window[SpellBookWnd].Open}) /cleanup
/next i 
/doevents flush
}  
/return

Sub HoTTcheck
/if (${Group}>1&&${Me.TargetOfTarget.ID}) {
	/if (!${HoTTavail}) /echo Hott is now available, going to use it.
	/varset HoTTavail TRUE
} else {
	/if (${HoTTavail}) /echo Hott is no longer available.
	/varset HoTTavail FALSE
}
/return

Sub CheckItemBuffs
/if (!${NearestSpawn[NPC radius 60 zradius 15].ID}) {
/declare i int local 1 
/for i 1 to ${ItemBufftodo.Size} 
	/if (${ItemBufftodo[${i}].NotEqual[NULL]}) /if (!${Me.Buff[${FindItem[${ItemBufftodo[${i}]}].Spell}].ID}) {
		/call ItemCaster "${ItemBufftodo[${i}]}"
		/delay 2
	}
/next i 
}  
/return
  
Sub Event_AmSummoned
/varset MobSummons TRUE
/return

Sub Event_WornOff(line, TempSpellname)
/declare i int local 1 
/for i 1 to ${SpellBufftodo.Size} 
/if (!${Me.Buff[${SpellBufftodo[${i}]}].ID} && ${Spell[${SpellBufftodo[${i}]}].Stacks}) /varset Rebuffstate TRUE
/next i 
|/if (${TempSpellname.Equal[${SpellDoT}]}) /varset MobDoTed FALSE
/return

Sub Event_Toofaraway
/varcalc ToofarawayCount ${ToofarawayCount}+1
/if ((${ToofarawayCount}>3 || ${Target.PctHPs}<20) && ${Target.ID} && ${Target.Type.Equal[NPC]}) {
	/if (${Target.ID} && ${Target.Type.Equal[NPC]}) /face fast nolook
	/delay 8
	/varset ToofarawayCount 0
	/if (${Target.ID} && ${Target.Type.Equal[NPC]}) {
		/squelch /stick ${Math.Calc[${Target.MaxRangeTo}*0.3]}
		/varset CombatStickMode TRUE
	}
}
/return

Sub Event_CantSeeTarget
/varcalc CantSeeTargetCount ${CantSeeTargetCount}+1
/if (${CantSeeTargetCount}>2) {
	/varset CantSeeTargetCount 0
	/if (${Target.ID} && ${Target.Type.Equal[NPC]}) /face fast nolook
	/delay 8
}
/return

Sub Event_AttackingSelf
/varcalc AttackingSelfCount ${AttackingSelfCount}+1
/if (${AttackingSelfCount}>4) {
	/varset AttackingSelfCount 0
	/if (${Me.Combat}) {
		/echo Stopping to Attack self, recheck.
		/keypress Ctrl+c
		/notify ActionsWindow ACP_MeleeAttackButton Leftmouseup
	}
}
/return

Sub Event_TauntFail
/doevents flush TauntFail
/if (!${HoTTavail}||${Me.PctMana}<30) /return
/declare tidtmp int local NULL
/declare totidtemp int local NULL
/if (${Target.ID} && ${Target.Type.Equal[NPC]}) /varset tidtmp ${Target.ID}
/if (${Me.TargetOfTarget.ID} && ${Spawn[ID ${Me.TargetOfTarget.ID}].Type.Equal[PC]}) /varset totidtemp ${Me.TargetOfTarget.ID}
/if (${totidtemp}>0) {
	/keypress TAB
	/target id ${totidtemp}
	/delay 20 ${Target.ID}==${totidtemp}
	/delay 5
	/echo Trying to heal ${Target.CleanName}.
	/if (${Me.SpellReady[${QuickHeal}]} && ${Target.PctHPs}<80) /call cast "${QuickHeal}" gem5 2s
	/delay 15 !${Me.Casting.ID}
	/if (${tidtmp}>0) /keypress TAB
}
/return

Sub Agroing
/if (${Me.AbilityReady[Taunt]} && ${Target.Type.Equal[NPC]} && ${Target.Distance}<${Target.MaxRangeTo}*0.8) {
	/face fast
	/doability "Taunt"
	/delay 5
	/doevents TauntFail
}
/if (${Me.TargetOfTarget.Type.Equal[PC]} && ${Target.Type.Equal[NPC]} && ${Me.TargetOfTarget.Class.Name.Equal[Cleric]} && ${Me.TargetOfTarget.PctHPs}<85) /if (${Me.AltAbilityReady[${GrpHealAA}]}) /call cast "${GrpHealAA}" alt 1s
/if (${Me.SpellReady[${AggroStun}]} && ${Target.Type.Equal[NPC]} && ${Target.Distance}<${Spell[${AggroStun}].Range} && ${Target.Speed}>1) {
	/call cast "${AggroStun}" gem6 1s
	/delay 2s !${Me.Casting.ID}
}
/if (${Target.Speed}<150 && ${Target.Distance}>${Target.MaxRangeTo}*0.9) {
	/squelch /stick ${Math.Calc[${Target.MaxRangeTo}*0.5]}
	/varset CombatStickMode TRUE
	/delay 3s ${Target.Distance}<${Target.MaxRangeTo}*0.6
}
/if (${Me.AbilityReady[Taunt]} && ${Target.Type.Equal[NPC]} && ${Target.Distance}<${Target.MaxRangeTo}*0.8) {
	/face fast
	/doability "Taunt"
	/delay 5
	/doevents TauntFail
}
/if (${Me.AbilityReady[Bash]} && ${Target.Type.Equal[NPC]} && ${Target.Distance}<${Target.MaxRangeTo}*0.8) /doability "Bash"
/if (${Target.Distance}<${Target.MaxRangeTo}*0.6) {
	/squelch /stick off
	/varset CombatStickMode FALSE
}
/if (${Target.Speed}>150) {
	/if (${Me.AltAbilityReady[${StunAA}]}) {
		/stick off
		/keypress back
		/varset CombatStickMode FALSE
		/delay 7
		/call cast "${StunAA}" alt 1s SelfProtection
		/delay 2s !${Me.Casting.ID}
	}
	/if (${Me.AltAbilityReady[${StunAA2}]}) {
		/stick off
		/keypress back
		/varset CombatStickMode FALSE
		/delay 7
		/call cast "${StunAA2}" alt 1s SelfProtection
		/delay 2s !${Me.Casting.ID}
	} else /if (${Me.SpellReady[${PushStun}]}) {
		/stick off
		/keypress back
		/varset CombatStickMode FALSE
		/delay 7
		/call cast "${PushStun}" gem1 1s SelfProtection
		/delay 2s !${Me.Casting.ID}
	}
}
/if (${Bool[${Target.Distance}>${Target.MaxRangeTo}*0.9]} && !${CombatStickMode}) {
	/squelch /stick ${Math.Calc[${Target.MaxRangeTo}*0.5]}
	/varset CombatStickMode TRUE
}
/return

Sub Event_Zoning 
/echo Zoned.
/call ResetSub
/echo Zoned, switching Anchorfeature OFF!!!
/varset Anchor FALSE
/return 

Sub Event_ImDead 
/echo Bummer ! 
/call ResetSub
/varset Rebuffstate TRUE
:Zone_Loop 
/if (${Window[RespawnWnd].Open} && ${Window[ConfirmationDialogBox].Open}) {
	:tryrez
	/if (${Window[ConfirmationDialogBox].Open}) {
		/delay 6
		/notify ConfirmationDialogBox Yes_Button  leftmouseup 
		/delay 6
	}
	/if (!${Window[ConfirmationDialogBox].Open} && ${Window[RespawnWnd].Open}) {
		/notify RespawnWnd RW_OptionsList listselect 2
		/delay 8
		/notify RespawnWnd RW_SelectButton leftmouseup
		/delay 1s !${Window[RespawnWnd].Open}
	}
	/if (${Window[RespawnWnd].Open} && ${Window[ConfirmationDialogBox].Open}) /goto :Zone_Loop
	/if (${Window[ConfirmationDialogBox].Open}) /goto :tryrez
}
/if ( ${Me.Type.Equal[DEAD]} || ${SpawnCount[PC ${Me.Name}]}<1) { 
	/delay 5s 
	/goto :Zone_Loop
}
/delay 1s 
/consent group 
/delay 5 
/call Wait4Rez 
/delay 20 
/if (${Me.State.Equal[Stand]}) {
	/sit 
}
| We do some short meditate before we start again. 
/doevents flush
/echo Setting new Anchor after Rez.
/varset Anchor FALSE
/call Event_Anchorchg
/squelch /target clear
/delay 8 !${Target.ID}
/call ResetSub
/return 

Sub Event_Enrageon 
/echo Mob is ENRAG....
/if (${Me.Combat}) {
	/echo Enrag... combat off.
	/keypress Ctrl+c
	/notify ActionsWindow ACP_MeleeAttackButton Leftmouseup
	/varset MobisEnraged TRUE
	/varset Enrageresettime 15s
}
/return 

Sub Event_Enrageoff 
/if (${Target.ID} && ${Target.Type.Equal[NPC]} && ${Target.PctHPs}<20 && !${Me.Combat}) { 
	/echo Whew no more enrag... back to hit that mob.
	/keypress Ctrl+c
	/notify ActionsWindow ACP_MeleeAttackButton Leftmouseup
	/varset MobisEnraged FALSE
	/varset Enrageresettime 0
} 
/return 

Sub Event_Anchorchg
	/if (${Anchor}) {
		/varset Anchor FALSE
		/echo No longer moveing to Anchor!
	} else {
		/varset Anchor TRUE
		/varset AnchorX	${Me.X.Int}
		/varset AnchorY	${Me.Y.Int}
		/varset AnchorZ ${Me.Z.Int}
		/varcalc AnchorZ ${AnchorZ}+10
		/echo Moveing to Anchor when suitable! New Anchor set to X: ${AnchorX} Y: ${AnchorY}
	}
/return

Sub Event_OutDoor
/varset OutDoors FALSE
/varset UseMount FALSE
/return

Sub CheckAnchor   
/if (${Math.Distance[${AnchorY},${AnchorX}]}>30 && ${Anchor}) /call MoveToAnchor   
/if (${Math.Distance[${AnchorY},${AnchorX}]}>8 && ${Math.Distance[${AnchorY},${AnchorX}]}<35 && ${Anchor}) {
	/squelch /stick off
	/varset CombatStickMode FALSE
	/call SharpToAnchor   
}
/return

Sub SharpToAnchor
/if (!${Anchor}) /return
/squelch /target clear
/squelch /stick off
/varset CombatStickMode FALSE
/if (${SpawnCount[npc radius 40 zradius 15]}>0) {
	/echo Skipping SharptoAnchor and engageing next mob
	/assist ${M_Assist}
	/return
}
/face nolook loc ${AnchorY},${AnchorX}
/delay 1s
/face fast nolook loc ${AnchorY},${AnchorX}
/delay 5
/if (${Me.Running}) {
	/keypress Ctrl+m
	/notify ActionsWindow AMP_WalkButton Leftmouseup
}
/declare SharpTimer timer local
/varset SharpTimer 3s
:Sharploop
/if (${SharpTimer}) {
	/face fast nolook loc ${AnchorY},${AnchorX}
	/delay 2
	/if (${Math.Distance[${AnchorY},${AnchorX}]}>8) {
		/keypress forward hold
		/delay 0.5
		/keypress forward
	}
	/goto :Sharploop
}
/if (!${Me.Running}) {
	/keypress Ctrl+m
	/notify ActionsWindow AMP_RunButton Leftmouseup
}
/return

Sub MoveToAnchor
	/if (${SpawnCount[npc radius 40 zradius 15]}>0) {
		/echo Skipping movetoAnchor and engageing next mob
		/return
	}
	/declare iCount int local
	/varset iCount 0
	/varset stickmode FALSE
	/varset GrpLosState FALSE	
	/echo Moving to Anchor at Loc: ${AnchorY}, ${AnchorX}.
	/varset RV_MyXLOC ${Int[${Me.X}]}
	/varset RV_MyYLOC ${Int[${Me.Y}]}
	/declare RV_DistanceTimer timer 25
  :AnchorMoveLoop
      /if (${iCount}>2) {
          /face loc ${AnchorY},${AnchorX} nolook
          /delay 1s 
	  /face fast nolook loc ${AnchorY},${AnchorX}
      	  /keypress back
	/return
	}

      /doevents
      /face nolook loc ${AnchorY},${AnchorX}
      /delay 1s
      /face fast nolook loc ${AnchorY},${AnchorX}
        /if (${Me.Running}) {
		/keypress Ctrl+m
		/notify ActionsWindow AMP_WalkButton Leftmouseup
	}
	/if (${Math.Distance[${AnchorY},${AnchorX}]}>${Leashdistance} && ${LineOfSight[${AnchorY},${AnchorX},${AnchorZ}:${Me.Y.Int},${Me.X.Int},${Math.Calc[${Me.Z.Int}+10]}]}) {
	/if (!${Me.Moving}) /keypress forward hold
	/face fast nolook loc ${AnchorY},${AnchorX}
	/echo Dist > ${Leashdistance} and LoS to Anchor.
	/goto :AnchorMoveCont
	}
	/if (${GrpMbrAnchor} && ${Math.Distance[${AnchorY},${AnchorX}]}>75 && !${LineOfSight[${AnchorY},${AnchorX},${AnchorZ}:${Me.Y.Int},${Me.X.Int},${Math.Calc[${Me.Z.Int}+10]}]}) {
		/call CheckGrpLoSight
		/if (${GrpLosState}) {
			/echo Dist(${Math.Distance[${AnchorY},${AnchorX}]}) > 75 and only LoS to a Grpmember.
			/target ID ${LosGrpMbr}
			/delay 3
			/target ID ${LosGrpMbr}
			/delay 3
			/delay 3s ${Target.ID}==${LosGrpMbr}
			/if (${PullerID}==${Target.ID}) /tell ${Puller} I am lost, I will follow you to camp.
			/if (${Target.ID}) /face nolook
			/delay 1s
			/if (!${stickmode}) {
				/stick
				/varset stickmode TRUE
			}
			:ContFollow
			/if (${Math.Distance[${AnchorY},${AnchorX}]}<=50 || !${Target.ID} || ${SpawnCount[npc radius 60 zradius 20]}>0) {
				/if (${PullerID}==${Target.ID}) /tell ${Puller} Stopping to chase ya, thx.
				/squelch /target clear
				/keypress back
				/face nolook loc ${AnchorY},${AnchorX}
				/varset GrpLosState FALSE
				/if (${Math.Distance[${AnchorY},${AnchorX}]}>${Leashdistance} && ${Math.Distance[${AnchorY},${AnchorX}]}<60 && ${SpawnCount[npc radius 60 zradius 20]}<1) {
					/face fast nolook loc ${AnchorY},${AnchorX}
					/keypress forward hold
					/delay 2s (${Math.Distance[${AnchorY},${AnchorX}]}<${Leashdistance} || ${Math.Distance[${AnchorY},${AnchorX}]}>50)
					/keypress forward
					/keypress back
				}
				/goto :AnchorMoveCont
			}
			/goto :ContFollow
		} else {
			/if (${SpawnCount[npc radius 60 zradius 20]}>0) /goto :AnchorMoveCont
			/echo Dist > ${Leashdistance} and Nothing in Sight, trying to run and avoid obstacles.
			/face fast nolook loc ${AnchorY},${AnchorX}
			/if (!${Me.Moving}) /keypress forward hold
			/goto :AnchorMoveCont
		}
	}
	/if (${Math.Distance[${AnchorY},${AnchorX}]}<=${Leashdistance}) {
		/call AnchorVarReset
		/keypress back
		/return
	}
     :AnchorMoveCont
	/delay 2s ${Math.Distance[${AnchorY},${AnchorX}]}<${Leashdistance}
	/if (${Me.Moving}) /keypress back
      /if (!${RV_DistanceTimer} && !${stickmode} && ${Math.Distance[${AnchorY},${AnchorX}]}>${Leashdistance}) {
        /if ((${RV_MyXLOC}==${Int[${Me.X}]})&&(${RV_MyYLOC}==${Int[${Me.Y}]})) {
		/call HitObstacle
        	/varset RV_MyXLOC ${Int[${Me.X}]}
        	/varset RV_MyYLOC ${Int[${Me.Y}]}
        	/varset RV_DistanceTimer 15
        } 
       }   
	/call AnchorVarReset
      /varcalc iCount ${iCount}+1
      /goto :AnchorMoveLoop
  /return

Sub AnchorVarReset
	/if (!${Me.Running}) {
		/keypress Ctrl+m
		/notify ActionsWindow AMP_RunButton Leftmouseup
	}
	/if (${stickmode}) {
		/varset stickmode FALSE
		/stick off
	}
	/if (${GrpLosState}) {
		/varset GrpLosState FALSE
	}
/return
 
We would have to see the code inside Itemcast.inc, I do believe. One change that was made was the 'item' was changed to 'Item' now (with a capital I), so look to see if that fixes it in the include, otherwise we would need to look it all over before being able to fix it.
 
here you go this is out of itemcast

Rich (BB code):
|----Created by Crystane out of numerous snippets from other authors, thx to them.
|----For www.redguides.com
|----I know there are plugins out for it, but plugins break with numerous patches where a macro continues. + I can fix macros, not plugins.
|----[05-07-07]
|----Itemcast.inc

Sub ItemCaster(ItemToCast)
/if (!${Defined[ICcastReturn]}) /declare ICcastReturn string outer X
/varset ICcastReturn X
|/echo Looking to find ${ItemToCast}
/call ItemFinder "${ItemToCast}"
|/echo Found the Item ${Macro.Return}
/if (${Macro.Return.Equal["INVENTORY"]}) {
	/if (${FindItem[${ItemToCast}].EffectType.Equal[Click Inventory]}) /call CastInInv "${ItemToCast}"
	/if (${FindItem[${ItemToCast}].EffectType.Equal[Click Worn]}) /call CastWornfromInv "${ItemToCast}"
}
/if (${Macro.Return.Equal["BAGGED"]}) {
	/if (${FindItem[${ItemToCast}].EffectType.Find[Click]}) /call CastWornfromInv "${ItemToCast}"
}
/if (${Macro.Return.Equal["EQUIPPED"]}) {
	/call cast "${ItemToCast}" item
	/varset ICcastReturn ${Macro.Return}
}
/if (${ICcastReturn.Equal[X]} && ${Spell[${item}].CastTime}<0.01) /varset ICcastReturn CAST_SUCCESS
/if (${ICcastReturn.Equal["NOTFOUND"]}) /echo You seam to not posses that item.
/return ${ICcastReturn}

sub ItemFinder(item) 
/declare bag int local ${FindItem[${item}].InvSlot.Pack} 
/declare slot int local ${FindItem[${item}].InvSlot} 
/declare equipslot string local ${FindItem[${item}].WornSlot[1].Name} 
/declare equipslot2 string local ${FindItem[${item}].WornSlot[2].Name} 
/declare equipslot3 string local ${FindItem[${item}].WornSlot[3].Name} 
/if ((${bag}==0)&&(${slot}==0)) /return NOTFOUND 
/if (${Me.Inventory[${equipslot}].Name.Equal[${item}]}) /return EQUIPPED 
/if (${Me.Inventory[${equipslot2}].Name.Equal[${item}]}) /return EQUIPPED 
/if (${Me.Inventory[${equipslot3}].Name.Equal[${item}]}) /return EQUIPPED 
/if (${bag}==0 && ${slot}>0) /return INVENTORY 
/if (${bag}>0 && ${slot}>0) /return BAGGED 
/return

Sub CastWornfromInv(item)
/declare oldItemName string local ${InvSlot[${FindItem[${item}].WornSlot[1]}].Item.Name}
/declare slotName string local ${FindItem[${item}].WornSlot[1]}
:cast_item
/exchange "${item}" ${slotName}
/call cast "${item}" item
/varset ICcastReturn ${Macro.Return}
/delay 5
:wait1 
/if (${Me.Casting.ID} || ${Me.Moving}) /goto :wait1 
/delay 5
/exchange "${oldItemName}" ${slotName}
/return

Sub CastInInv(item) 
/call cast "${item}" item
/varset ICcastReturn ${Macro.Return}
/return
 
Any error messages pop up in your MQ2 window? That would be the biggest help in helping you diagnose the problem.

"No subroutine "cast" " error message would mean you are missing spell_routines.inc

If it's tossing up item errors it's what Nightmare was talking about, but I don't see any problems with the itemcast include.

As far as I can see during a cursory glance the macro is good.
 
nope there is no error messege going in the mq2 window... its just not clicking the items.. when it goes to check the buffs its just skipping right over them for some reason
 
Change this in the main macro (The addition is in red)

INI:
Sub CheckItemBuffs
[COLOR="Red"]/echo "${NearestSpawn[NPC radius 60 zradius 15].CleanName} SHOULD BE NULL (If number tell Ccomp)"[/COLOR]
/if (!${NearestSpawn[NPC radius 60 zradius 15].ID}) {
/declare i int local 1 
/for i 1 to ${ItemBufftodo.Size} 
	/if (${ItemBufftodo[${i}].NotEqual[NULL]}) /if (!${Me.Buff[${FindItem[${ItemBufftodo[${i}]}].Spell}].ID}) {
		/call ItemCaster "${ItemBufftodo[${i}]}"
		/delay 2
	}
/next i 
}  
/return
 
what does it say?

Hint: If you are getting error messages they are used primarily for diagnosing the problem, it is always helpful to give the error message to the people that can do the diagnosing if you know it.
 
help macro not doing item click buffs now???

Users who are viewing this thread

Back
Top