Here's the updated macro with new slow code to get all mobs in range and some other fixes to keep the macro working a bit better. There's still an odd pause before combat at times, just haven't looked into it.
Code: Select all
#chat group
#chat tell
#Event ToggleVariable "[MQ2] Toggle #1#"
#Event ToggleVariable "[MQ2] Toggle #1# #2#"
#Event Zoned "LOADING, PLEASE WAIT..."
#Event OutDoor "#*#outdoors#*#"
#Event NoMount "You can not summon a mount here."
#Event ImDead "You have been slain by#*#"
#Event Invited "#*#To join the group, click on the 'FOLLOW' option, or 'DISBAND' to cancel#*#"
#Event UnderAttack "#*#YOU for#*#points of damage."
#Event UnderAttack "#*#YOU, but YOU#*#!"
#Event UnderAttack "#*#YOU, but misses!"
| GM's and Guides ALWAYS open conversation saying who they are
#event GMInZone "#*#tells you,#*# GM #*#"
#event GMInZone "#*#tells you,#*# Guide #*#"
#event GMInZone "#*#tells you,#*# gamemaster #*#"
#event GMInZone "#*#tells you,#*# Game Master #*#"
#event GMInZone "#*#tells you,#*# Customer Service #*#"
#event GMInZone "#*#tells you,#*# CSR #*#"
/declare noInvis int outer 1
#include Spell_Routines.inc
#include advpath.inc
|-- The normal debug - for normal play. Enable: "/echo", Disable: "/squelch /echo"
#define DEBUG_1 "/echo"
|-- Deeper debugging - enable when trying to find bugs. Enable: "/echo", Disable: "/squelch /echo"
#define DEBUG_2 "/echo"
|-- The Deepest debugging - will spam a lot. Enable: "/echo", Disable: "/squelch /echo"
#define DEBUG_3 "/echo"
|-- Also loot items?
#define LOOT_ITEMS FALSE
|-- Loot all items?
#define LOOT_ALL_ITEMS FALSE
|-- Destroy the remaining items -not in use atm
|#define LOOT_DESTROY False
|-- What lvl should the mob be before we bother looting it
#define LOOT_ABOVE_LEVEL 1
|-- Keep loot record - Will display how much you have looted + items
#define LOOT_KEEP_RECORD TRUE
|-- No matter other settings. If the value of the item is above this, GET IT! (Value is in copper)
|-- Not nodrop
#define LOOT_NORMAL_ITEMS_IF_VALUE_IS_ABOVE 40000
|-- No matter other settings. If the value of the item is above this and stackable, GET IT! (Value is in copper)
|-- Not lore, not nodrop
#define LOOT_STACKABLE_ITEMS_IF_VALUE_IS_ABOVE 4000
Sub Main
/call InitAPFVars 1 15 20
| ########### Make changes in spells as you need.
| The % of your spell duration bonus.
/declare SpellDurationBonus outer 30
|- If you have no focus item, leave it blank.
/declare BuffFocusItem outer ""
/declare SpellPetHeal string outer "Healing of Mikkily"
/declare SpellPetHealGem int outer 1
/declare SpellHeal string outer "Muada's Mending"
/declare SpellHealGem int outer 2
/declare SpellSlow string outer "Sha's Revenge"
/declare SpellSlowGem int outer 3
/declare SpellDeBuff string outer "Incapacitate"
/declare SpellDeBuffGem int outer 4
/declare SpellFirstNuke string outer "Ice Shard"
/declare SpellFirstNukeGem int outer 5
/declare SpellOtherNuke string outer "Frost Spear"
/declare SpellOtherNukeGem int outer 6
/declare SpellDoT string outer "Chimera Blood"
/declare SpellDoTGem int outer 7
/declare SpellATK string outer "Ferocity"
/declare SpellATKGem int outer 8
/declare SpellBuffsGem outer 9
/declare SpellPet outer "Spirit of Alladnu"
/declare SpellPetGem outer 9
/declare SpellPetBuff[5] string outer
/varset SpellPetBuff[1] "Growl of the Beast"
/varset SpellPetBuff[2] "Spirit of Irionu"
/varset SpellPetBuff[3] "Ferocity"
/varset SpellPetBuff[4] "Focus of Alladnu"
/varset SpellPetBuff[5] "Infusion of Spirit"
/declare ItemPetBuff[1,2] string outer
/varset ItemPetBuff[1,1] "Savage Lord's Totem"
/varset ItemPetBuff[1,2] "Savage Wildcaller's Blessing"
| ############ The Magic of single spell buffs...
| ############
| ############ /declare SpellBuff[2,2] string outer
| ############ Do only change the 1st number in [#,#]
| ############ If you have three single spells to cast change the 1st number to 3.
| ############ /declare SpellBuff[3,2] string outer
| ############
| ############ /varset SpellBuff[1,1] "Spirit of Sense"
| ############ This is the 1st line that is needed, Here you write your spell name
| ############ /varset SpellBuff[1,2] "Warrior,Monk,Cleric,Shaman,Enchanter,"
| ############ The 2nd line is for the classes who gets the buff.
| ############ NOTE: Only classes in group will get buffed
| ############ NOTE: End the class line with a , If not you can BLOW up your computer. ;P
/declare SpellBuff[5,2] string outer
/varset SpellBuff[1,1] Focus of Alladnu
/varset SpellBuff[1,2] "Bard,Beastlord,Berserker,Monk,Paladin,Ranger,Rogue,Warrior,"
/varset SpellBuff[2,1] Infusion of Spirit
/varset SpellBuff[2,2] "Bard,Beastlord,Berserker,Monk,Paladin,Ranger,Rogue,Shadowknight,Warrior,"
/varset SpellBuff[3,1] Stamina
/varset SpellBuff[3,2] "Cleric,Druid,Enchanter,Magician,Necromancer,Wizard,"
/varset SpellBuff[4,1] Chloroplast
/varset SpellBuff[4,2] "Bard,Beastlord,Berserker,Monk,Paladin,Ranger,Rogue,Shadowknight,Warrior,Necromancer,"
/varset SpellBuff[5,1] Frenzy
/varset SpellBuff[5,2] "Beastlord,"
| ############ Group buffs...
/declare SpellGrpBuff[2] string outer
/varset SpellGrpBuff[1] Spiritual Dominion
/varset SpellGrpBuff[2] Spiritual Vitality
/declare DoSingleBuffs outer TRUE
/declare DoBuffs outer TRUE
/declare AssistAt int outer 100
/declare CombatAt int outer 96
/declare PetCombatAt int outer 98
/declare CastDoTat int outer 98
/declare MinDoTat int outer 60
/declare MinNukeat int outer 10
/declare MinManaForNuke int outer 65
/declare NukeAt int outer 95
/declare DelayBetweenNukes int outer 0
/declare HealPetAt int outer 50
/declare HealGroupAt int outer 60
/declare HealInterrupt int outer 90
/declare DowntimeHealGroupAt int outer 40
/declare CastATK outer TRUE
/declare DoMelee outer TRUE
/declare DoDebuff outer FALSE
/declare DoSlow outer FALSE
/declare SlowAllAdds outer FALSE
/declare FastSlow outer FALSE
/declare SummonPet outer TRUE
/declare BuffPet outer TRUE
/declare HealPets outer TRUE
/declare DoDoT outer TRUE
/declare DoNuke outer TRUE
/declare DoHeal outer TRUE
/declare Verbose outer FALSE
/declare quitOnZone outer FALSE
/declare TetheredToHome outer TRUE
/declare PathFile outer "HS"
/declare AutoPull outer FALSE
/declare AutoPullDistance outer 125
/declare AutoPullEngageDistance outer 20
/declare AutoLoot outer FALSE
/declare AutoMove outer FALSE
/declare AllowAutoFollow outer TRUE
| This is a delay for how long Avatar will hold. (6min)
/declare AvatarDelay outer 4000
|Loot items we want to loot
/declare LootList[6] string outer
/varset LootList[1] "silk"
/varset LootList[2] "Dust of Decay"
/varset LootList[3] "Emerald"
/varset LootList[4] "Opal"
/varset LootList[5] "Pearl"
/varset LootList[6] "Peridot"
/squelch /alias /dodebuff /echo toggle malo
/squelch /alias /doslow /echo toggle slow
/squelch /alias /dofastslow /echo toggle fastslow
/squelch /alias /doroot /echo toggle root
/squelch /alias /dopet /echo toggle pet
/squelch /alias /dodot /echo toggle dot
/squelch /alias /donuke /echo toggle nuke
/squelch /alias /nukeat /echo toggle nukeat
/squelch /alias /dobuffs /echo toggle buffs
/squelch /alias /dosow /echo toggle sow
/squelch /alias /assistat /echo toggle assistat
/squelch /alias /dotat /echo toggle dotat
/squelch /alias /rootat /echo toggle rootat
/squelch /alias /combatat /echo toggle combatat
/squelch /alias /healmeleeat /echo toggle healmeleeat
/squelch /alias /healcastersat /echo toggle healcastersat
/squelch /alias /healtankat /echo toggle healtankat
/squelch /alias /doassist /echo toggle assist
/squelch /alias /healat /echo toggle healat
/squelch /alias /status /echo toggle show
/squelch /alias /show /echo toggle show
/squelch /alias /bothelp /echo toggle help
/squelch /alias /verbose /echo toggle verbose
/squelch /alias /resetbuffs /echo toggle resetbuffs
/squelch /alias /clearpathing /echo toggle clearpathing
/squelch /alias /dohot /echo toggle dohot
/squelch /alias /doheal /echo toggle doheal
/squelch /alias /HealPets /echo toggle HealPets
/squelch /alias /DoRootParking /echo toggle DoRootParking
/squelch /alias /buff /echo toggle buff
/squelch /alias /DoMelee /echo toggle DoMelee
/squelch /alias /CastATK /echo toggle CastATK
/squelch /alias /dofollow /echo toggle dofollow
/squelch /alias /ClearBuffees /echo toggle ClearBuffees
/declare M_Assist string outer
/declare OutDoors outer TRUE
/declare SpDuration outer
/declare SpCastTime outer
/declare SpDurBonus outer
/declare MainItem outer
/declare MeLoM outer FALSE
/declare TargetArray[4] string outer
/declare MobDebuffed outer FALSE
/declare MobSlowed outer FALSE
/declare PetOn outer FALSE
/declare MobRooted outer FALSE
/declare MobDoTed outer FALSE
/declare CombatOn outer TRUE
/declare i int local
/declare Exper float outer
/declare AAExp float outer
/varset Exper ${Me.Exp}
/varset AAExp ${Me.AAExp}
/squelch /declare ATKBuffed0 timer global 0
/squelch /declare ATKBuffed1 timer global 0
/squelch /declare ATKBuffed2 timer global 0
/squelch /declare ATKBuffed3 timer global 0
/squelch /declare ATKBuffed4 timer global 0
/squelch /declare ATKBuffed5 timer global 0
/declare CallManaTmr timer outer 0
/varset MobRooted FALSE
/varset MobDebuffed FALSE
/varset MobSlowed FALSE
/varset PetOn FALSE
/varset MobDoTed FALSE
/varset MobRooted FALSE
/varset MobDebuffed FALSE
/varset MobSlowed FALSE
/varset PetOn FALSE
/varset MobDoTed FALSE
/varset CombatOn FALSE
/varset TargetArray[1] NULL
/varset TargetArray[2] NULL
/varset TargetArray[3] NULL
/varset TargetArray[4] NULL
/squelch /stick off
/declare GroupMemHoTTime0 timer outer 0
/declare GroupMemHoTTime1 timer outer 0
/declare GroupMemHoTTime2 timer outer 0
/declare GroupMemHoTTime3 timer outer 0
/declare GroupMemHoTTime4 timer outer 0
/declare GroupMemHoTTime5 timer outer 0
/declare GroupMemPetHoTTime0 timer outer 0
/declare GroupMemPetHoTTime1 timer outer 0
/declare GroupMemPetHoTTime2 timer outer 0
/declare GroupMemPetHoTTime3 timer outer 0
/declare GroupMemPetHoTTime4 timer outer 0
/declare GroupMemPetHoTTime5 timer outer 0
/declare DebuffTimers[10] int outer
/declare grpBuffTimer timer outer
/declare grpBuffTimesAttempted int outer
/declare j int local 1
/declare following string outer FALSE
/declare tookAction int outer 0
/declare WaitingOnSpell int outer 0
/declare didCanni int outer 0
/declare noMoveCount int outer 0
/declare underAttack timer outer 0
/declare underAttackBy int outer NULL
/declare LastSLAdded int outer
/squelch /declare SafeLocs[20,2] float global
/declare PrevLoc[4] float outer
/varset PrevLoc[1] 0
/varset PrevLoc[2] 0
/varset PrevLoc[3] 0
/varset PrevLoc[4] 0
/declare HomeX int outer
/declare HomeY int outer
/declare DotTime timer outer
/declare MoveToTmr timer outer
/declare DoingMove outer 0
/declare PrevMana outer 0
/squelch /declare otherBuffees[0] string global
/declare nukeTimer timer outer 0
/declare GotMob int outer 0
/declare GotMobID int outer 0
/declare BuffsDone int outer 0
/declare delayMoveTimer timer outer 0
/declare doingPath int outer 0
/declare WaitForMob timer outer 0
/declare lootcnt int outer 0 |Loot counter
/declare stickID int outer 0
/declare perfectionNeeded int outer 0
/declare perfectionAnnounced int outer 0
/declare attemptedLoot int outer 0
/declare doorAttempt timer local 0
/declare DelayPull timer outer 0
/declare DidDelay int outer 0
/declare singleBuffsDone int outer 0
/declare DEBUG outer TRUE
/declare SAFETOCAST outer TRUE
/call MemSpells
/call SilentFunction
| ############### Target a player as Main Assist
/if ((!${Target.ID} || (!${Target.Type.Equal[PC]} && !${Target.Type.Equal[Pet]})) && !${Defined[Param0]}) {
/varset M_Assist ${Me.Pet.CleanName}
} else /if (${Defined[Param0]}) {
/varset M_Assist ${Param0}
} else {
/varset M_Assist ${Target.CleanName}
/assist off
}
/echo Assist set to ${M_Assist}
/if (${AutoPull}) {
/call GoHome
:GoHomeLoop
/call AdvPathPoll
/if (${PathingFlag}) /goto :GoHomeLoop
/varset DelayPull 0
/varset DidDelay 1
}
/varset HomeX ${Me.X}
/varset HomeY ${Me.Y}
:Main_Loop
/if (${DEBUG}) /echo Start of :Main_Loop
/varset tookAction 0
/varset WaitingOnSpell 0
/if (!${CombatOn} && ${Me.Combat}) /attack off
/if (!${FollowFlag} && !${PathingFlag}) {
DEBUG_3 D1
/squelch /stick off
/if (${CombatOn}) /target id ${TargetArray[4]}
/if (${CombatOn} && ${DoMelee}) /if (${Target.ID} && ${Target.ID} == ${TargetArray[4]} && ${Target.PctHPs} < ${CombatAt}) {
/squelch /stick 20 moveback behindonce
}
}
/if (${GotMobID} && ${WaitForMob}<=0 && !${GotMob}) {
/varset GotMobID 0
/varset WaitForMob 0
/varset MobRooted FALSE
/varset MobDebuffed FALSE
/varset MobSlowed FALSE
/varset PetOn FALSE
/varset MobDoTed FALSE
/varset CombatOn FALSE
/varset DotTime 0
/varset TargetArray[1] NULL
/varset TargetArray[2] NULL
/varset TargetArray[3] NULL
/varset TargetArray[4] NULL
/squelch /stick off
}
/if (${Me.Pet.Speed}>0) /if (${Math.Distance[${HomeY},${HomeX}:${Spawn[GotMobID].Y},${Spawn[GotMobID].X}]}>25) /if (${WaitForMob}>0 || ${GotMob}) {
/pet back
/varset PetOn FALSE
}
/if (${CombatOn} && !${doorAttempt}) {
/keypress use
/target id ${TargetArray[4]}
/varset doorAttempt 150
}
/if (${FollowFlag} || ${PathingFlag}) /call AdvPathPoll
/delay 1
/if (${PrevLoc[1]}!=${Me.X} || ${PrevLoc[2]}!=${Me.Y}) {
/if (${Math.Distance[${PrevLoc[1]},${PrevLoc[2]}:${PrevLoc[3]},${PrevLoc[4]}]} >= 10) {
/varset PrevLoc[3] ${PrevLoc[1]}
/varset PrevLoc[4] ${PrevLoc[2]}
}
/varset PrevLoc[1] ${Me.X}
/varset PrevLoc[2] ${Me.Y}
/varset noMoveCount 0
} else {
/vardata noMoveCount Math.Calc[${noMoveCount}+1]
}
/doevents
/if (${PathingFlag}) {
/if (!${doorAttempt}) {
/keypress use
/varset doorAttempt 150
}
/if (${underAttack} && !${GotMob}) {
/varset GotMob 1
/varset GotMobID ${underAttackBy}
/call GoHome
}
/if (!${GotMob}) {
/call PullNearestMob
/if (${Macro.Return}) {
/varset GotMob 1
/call GoHome
}
}
/call AdvPathPoll
/goto :Main_Loop
} else {
DEBUG_3 D2
/if (${GotMob}) {
/target id ${GotMobID}
/face nolook loc ${PrevLoc[4]}, ${PrevLoc[3]}
/varset WaitForMob 300
/varset GotMob 0
} else /if (!${CombatOn} && !${DidDelay}) {
/face nolook loc ${PrevLoc[4]}, ${PrevLoc[3]}
/varset DelayPull 300
/varset DidDelay 1
}
}
/if (${noMoveCount} > 20 || ${CombatOn}) {
DEBUG_3 D3
/if (${Me.Standing} && !${MoveToTmr} && !${FollowFlag} && !${Me.Moving} && !${PathingFlag}) {
/if (!${underAttack} && (${Me.PctMana} < 30 || !${DoMelee})) {
/squelch /stick off
/if (${Me.Standing} && !${underAttack} && ${Me.PctMana} < 85) /sit
/varset DoingMove 0
} else /if (${CombatOn} && ${Target.Type.Equal[NPC]} && !${Target.Type.Equal[Corpse]} && !${Target.Type.Equal[PET]} && ${Target.PctHPs} <= ${CombatAt}) {
/sit off
/attack on
/if (${CombatOn} && ${DoMelee}) /if (${Target.ID} == ${TargetArray[4]}) {
/squelch /stick hold 40% moveback
}
}
}
/if (!${PathingFlag} && !${GotMob} && (!${GotMobID} || !${WaitForMob} || ${Math.Distance[${HomeY},${HomeX}:${Spawn[${GotMobID}].Y},${Spawn[${GotMobID}].X}]} < ${AutoPullEngageDistance})) {
DEBUG_3 D4
/call GetTarget
}
/if (!${MoveToTmr} && !${FollowFlag} && !${PathingFlag}) /if (${DoingMove}) {
DEBUG_3 D5
/squelch /moveto off
/keypress forward
/keypress back
/delay 1
}
/if (${FollowFlag}) {
/if (${CombatOn}) {
DEBUG_3 D6
/varset FollowFlag 0
/echo Combat Detected. No longer following. Resuming program.
/keypress FORWARD
/goto :Main_Loop
}
}
DEBUG_2 Test 1
|- Do we move?
:Hold_Main
/varset BuffsDone 0
/varset singleBuffsDone 0
/if (!${FollowFlag} && ${Me.Moving}) /goto :Main_Loop
/if (!${MoveToTmr} && !${FollowFlag} && !${Me.Moving}) {
/if (!${underAttack} && (${Me.PctMana} < 30 || !${CombatOn} || !${DoMelee})) {
/squelch /stick off
/if (${Me.Standing} && !${underAttack} && ${Me.PctMana} < 85 ) /sit
/varset DoingMove 0
} else /if (${CombatOn} && ${Target.Type.Equal[NPC]} && !${Target.Type.Equal[Corpse]} && !${Target.Type.Equal[PET]} && ${Target.PctHPs} <= ${CombatAt}) {
/sit off
/attack on
/if (${Target.ID} == ${TargetArray[4]}) {
/squelch /stick hold 40% moveback
}
}
}
|- Let the group know Im LOM
/if (${Me.PctMana} < 15 && !${CallManaTmr}) {
/if (${Verbose}) /gsay ${Me.PctMana}% Mana
/varset CallManaTmr 900
}
|- Am I LoM?
/if (${Me.PctMana} < 40) /varset MeLoM TRUE
/if (${MeLoM}) /if (${Me.PctMana} > 40) /varset MeLoM FALSE
DEBUG_2 Test 2
|- Wait until spells are ready it doesn't think it can cast slow yet if it's been chain healing
/if (!${Me.SpellReady[1]} && !${Me.SpellReady[2]} && !${Me.SpellReady[3]} && !${Me.SpellReady[4]}) /goto :Main_Loop
DEBUG_2 Test 3
/if (${DoSlow}) /call CheckDebuffTimers
/if (${tookAction} && !${WaitingOnSpell}) /goto :Main_Loop
DEBUG_2 Test 4
/if (${DoSlow}) /call CheckSlowRadius
/if (${tookAction} && !${WaitingOnSpell}) /goto :Main_Loop
DEBUG_2 Test 5
/if (${Math.Distance[${HomeY},${HomeX}:${Spawn[GotMobID].Y},${Spawn[GotMobID].X}]}>25) /if (${WaitForMob}>0 || ${GotMob}) /goto :Main_Loop
|- Group Heals
/call Check_grpHPs
/if (${tookAction}) /goto :Main_Loop
DEBUG_2 Test 6
/if (${HealPets}) /call Check_grpPetHPs
/if (${tookAction}) /goto :Main_Loop
DEBUG_2 Test 7
/if (${MeLoM} || (${Me.PctMana} < 50 && ${Me.PctHPs} < 50) || ${perfectionNeeded}) {
/if (${Me.AltAbilityReady[Perfection of Spirit]}) {
/squelch /moveto off
/squelch /stick off
/keypress right
/keypress left
/delay 3
/target id ${Me.ID}
/if (!${perfectionAnnounced}) /g INC Perfection of Spirit - Group mana/health regen!
/varset perfectionAnnounced 1
/call Cast "Perfection of Spirit" alt
/if (${Macro.Return.Equal[CAST_SUCCESS]}) {
/varset perfectionNeeded 0
/varset perfectionAnnounced 0
}
/delay 2
}
}
DEBUG_2 Test 8
|- Check for mobs and do combat stuff
/if (${CombatOn}) /call Combat
/if (${tookAction}) /goto :Main_Loop
/if (${Me.PctMana} < 40 || ${CombatOn}) /goto :Main_Loop
DEBUG_2 Test 9
/if (${WaitingOnSpell}) /goto :FollowingBuffs
DEBUG_2 Test 10
|- Group Buffs
/if (${DoBuffs}) /if (!${grpBuffTimer}) /call GrpBuffs
/if (${WaitingOnSpell}) /goto :FollowingBuffs
/if (${tookAction}) /goto :Main_Loop
/if (${Me.PctMana} > 40) /if (${CastATK}) /if (${Me.SpellReady[${SpellATK}]}) {
/squelch /stick off
/squelch /moveto off
/call Cast_Avatar
/if (${tookAction}) /goto :Main_Loop
}
DEBUG_2 Test 11
|- Single Buff !
/if (${DoSingleBuffs}) /call SingleBuffs
/if (${WaitingOnSpell}) /goto :FollowingBuffs
/if (${tookAction}) /goto :Main_Loop
DEBUG_2 Test 12
|- Pet
/if (!${Me.Pet.ID} && ${SummonPet} && ${Spell[${SpellPet}].Mana} <= ${Me.CurrentMana}) {
/call checkCanCast ${SpellPet} gem${SpellPetGem}
/if (!${Macro.Return}) /goto :FollowingBuffs
/squelch /stick off
/squelch /moveto off
/call cast ${SpellPet} gem${SpellPetGem} 25s
/if (${DEBUG}) /echo :Main_Loop call (DEBUGGER14)
/goto :Main_Loop
}
DEBUG_2 Test 13
/if (${Me.Pet.ID} && ${BuffPet}) {
/call BuffPet
/if (${WaitingOnSpell}) /goto :FollowingBuffs
/if (${tookAction}) /goto :Main_Loop
}
/call Check_grpHPsDowntime
/if (${WaitingOnSpell}) /goto :FollowingBuffs
/if (${tookAction}) /goto :Main_Loop
/varset BuffsDone 1
DEBUG_2 Buffs done
:FollowingBuffs
DEBUG_2 Waiting on spell...
}
/goto :Main_Loop
/return
Sub MemSpells
/declare gemnum int local
/echo Memming spells. Hang on.
/if (${Me.Standing}) /sit
/if (${HealPets}) /if (${Me.Gem[${SpellPetHeal}]} && ${Me.Gem[${SpellPetHeal}]}!=${SpellPetHealGem}) {
/varset gemnum ${Me.Gem[${SpellPetHeal}]}
/notify SpellBookWnd SBW_Spell${gemnum} rightmouseup
/memspell ${SpellPetHealGem} ${SpellPetHeal}
/delay 5s
}
/if (${HealPets}) /if (!${Me.Gem[${SpellPetHeal}]}) {
/memspell ${SpellPetHealGem} ${SpellPetHeal}
/delay 5s
}
/if (${DoHeal}) /if (${Me.Gem[${SpellHeal}]} && ${Me.Gem[${SpellHeal}]}!=${SpellHealGem}) {
/varset gemnum ${Me.Gem[${SpellHeal}]}
/notify SpellBookWnd SBW_Spell${gemnum} rightmouseup
/memspell ${SpellHealGem} ${SpellHeal}
/delay 5s
}
/if (${DoHeal}) /if (!${Me.Gem[${SpellHeal}]}) {
/memspell ${SpellHealGem} ${SpellHeal}
/delay 5s
}
/if (${Me.Gem[${SpellSlow}]} && ${Me.Gem[${SpellSlow}]}!=${SpellSlowGem}) {
/varset gemnum ${Me.Gem[${SpellSlow}]}
/notify SpellBookWnd SBW_Spell${gemnum} rightmouseup
/memspell ${SpellSlowGem} ${SpellSlow}
/delay 5s
}
/if (!${Me.Gem[${SpellSlow}]}) {
/memspell ${SpellSlowGem} ${SpellSlow}
/delay 5s
}
/if (${DoDebuff}) /if (${Me.Gem[${SpellDeBuff}]} && ${Me.Gem[${SpellDeBuff}]}!=${SpellDeBuffGem}) {
/varset gemnum ${Me.Gem[${SpellDeBuff}]}
/notify SpellBookWnd SBW_Spell${gemnum} rightmouseup
/memspell ${SpellDeBuffGem} ${SpellDeBuff}
/delay 5s
}
/if (${DoDebuff}) /if (!${Me.Gem[${SpellDeBuff}]}) {
/memspell ${SpellDeBuffGem} ${SpellDeBuff}
/delay 5s
}
/if (${DoNuke}) /if (${Me.Gem[${SpellFirstNuke}]} && ${Me.Gem[${SpellFirstNuke}]}!=${SpellFirstNukeGem}) {
/varset gemnum ${Me.Gem[${SpellFirstNuke}]}
/notify SpellBookWnd SBW_Spell${gemnum} rightmouseup
/memspell ${SpellFirstNukeGem} ${SpellFirstNuke}
/delay 5s
}
/if (${DoNuke}) /if (!${Me.Gem[${SpellFirstNuke}]}) {
/memspell ${SpellFirstNukeGem} ${SpellFirstNuke}
/delay 5s
}
/if (${DoNuke}) /if (${Me.Gem[${SpellOtherNuke}]} && ${Me.Gem[${SpellOtherNuke}]}!=${SpellOtherNukeGem}) {
/varset gemnum ${Me.Gem[${SpellOtherNuke}]}
/notify SpellBookWnd SBW_Spell${gemnum} rightmouseup
/memspell ${SpellOtherNukeGem} ${SpellOtherNuke}
/delay 5s
}
/if (${DoNuke}) /if (!${Me.Gem[${SpellOtherNuke}]}) {
/memspell ${SpellOtherNukeGem} ${SpellOtherNuke}
/delay 5s
}
/if (${DoDoT}) /if (${Me.Gem[${SpellDoT}]} && ${Me.Gem[${SpellDoT}]}!=${SpellDoTGem}) {
/varset gemnum ${Me.Gem[${SpellDoT}]}
/notify SpellBookWnd SBW_Spell${gemnum} rightmouseup
/memspell ${SpellDoTGem} ${SpellDoT}
/delay 5s
}
/if (${DoDoT}) /if (!${Me.Gem[${SpellDoT}]}) {
/memspell ${SpellDoTGem} ${SpellDoT}
/delay 5s
}
/if (${CastATK}) /if (${Me.Gem[${SpellATK}]} && ${Me.Gem[${SpellATK}]}!=${SpellATKGem}) {
/varset gemnum ${Me.Gem[${SpellATK}]}
/notify SpellBookWnd SBW_Spell${gemnum} rightmouseup
/memspell ${SpellATKGem} ${SpellATK}
/delay 5s
}
/if (${CastATK}) /if (!${Me.Gem[${SpellATK}]}) {
/memspell ${SpellATKGem} ${SpellATK}
/delay 5s
}
/return
| ################# Ensures that the spell is memmed and ready to cast,
| # so we're not waiting for 5 minutes for the recast timer to tick down
Sub checkCanCast(string spellName,string spellGem)
/if ( ${Me.SpellReady[${spellName}]} ) {
/squelch /moveto off
/squelch /stick off
/delay 2
/return 1
}
/if ( !${Me.Gem[${spellName}]} ) {
/squelch /moveto off
/squelch /stick off
/delay 2
:mem_spell
/if ( ${Cursor.ID} ) {
/autoinventory
/delay 5
/goto :mem_spell
}
/memspell ${spellGem.Right[1]} "${spellName}"
/delay 6s ${Me.Gem[${spellName}]}
}
/varset tookAction 1
/varset WaitingOnSpell 1
/return 0
| ################# Checks for expired slow/debuff timers
Sub CheckDebuffTimers
/if (!${SAFETOCAST}) /return
/if (${DEBUG}) /echo In CheckDebuffTimers
/declare i int local 1
/for i 1 to ${DebuffTimers.Size}
/if (${DebuffTimers[${i}]}) /if (!${Spawn[${DebuffTimers[${i}]}].ID} || ${Spawn[${DebuffTimers[${i}]}].State.Equal[DEAD]}) {
/if (${Defined[DebuffTimer${DebuffTimers[${i}]}]}) {
/deletevar DebuffTimer${DebuffTimers[${i}]}
}
/varset DebuffTimers[${i}] 0
}
/if (${DebuffTimers[${i}]}) /if (${Defined[DebuffTimer${DebuffTimers[${i}]}]}) /if (${DebuffTimer${DebuffTimers[${i}]}}<=6) {
/if (${DEBUG}) /echo /call checkCanCast ${SpellSlow} gem${SpellSlowGem}
/call checkCanCast ${SpellSlow} gem${SpellSlowGem}
/if (${DEBUG}) /echo Macro.Return: ${Macro.Return}
/if (!${Macro.Return}) /return
/squelch /stick off
/squelch /moveto off
/if (${Me.Combat}) /attack off
/target id ${DebuffTimers[${i}]}
/if (${DEBUG}) /echo /call Slow
/call Slow
/target id ${TargetArray[4]}
/if (${CombatOn} && ${Target.Type.Equal[NPC]} && !${Target.Type.Equal[Corpse]} && !${Target.Type.Equal[PET]} && ${Target.PctHPs} <= ${CombatAt}) /attack on
}
/next i
/return
Sub SetDebuffTimer(int id,timer t)
/declare i int local 1
/for i 1 to ${DebuffTimers.Size}
/if (!${DebuffTimers[${i}]}) {
/varset DebuffTimers[${i}] ${id}
/if (!${Defined[DebuffTimer${DebuffTimers[${i}]}]}) {
/declare DebuffTimer${DebuffTimers[${i}]} timer outer ${t}
} else {
/varset DebuffTimer${DebuffTimers[${i}]} ${t}
}
/return
}
/next i
/return
Sub CheckSlowRadius
/if (!${SAFETOCAST}) /return
/if (!${DoSlow}) /return
DEBUG_3 D6
/declare s int local
/declare j int local 1
/declare i int local 1
/for i 1 to 10
/varset s ${Me.NearestSpawn[${i},npc].ID}
/for j 1 to ${DebuffTimers.Size}
/if (${DebuffTimers[${j}]} == ${s}) /return
/next j
/if (${Spawn[${s}].Distance}>${Spell[${SpellSlow}].Range} || ${Spawn[${s}].Distance} > ${AssistAt} || ${Spawn[${s}].Level} < 30) {
/squelch /target clear
/return
}
/if ((${Me.CurrentMana}<${Spell[${SpellSlow}].Mana})) /return
/call checkCanCast ${SpellSlow} gem${SpellSlowGem}
/if (!${Macro.Return}) /return
/squelch /stick off
/squelch /moveto off
/attack off
/target id ${s}
/delay 5
/call Slow
/if (!${SlowAllAdds}) /return
/next i
/target id ${TargetArray[4]}
/if (${Target.Type.Equal[NPC]} && !${Target.Type.Equal[Corpse]} && !${Target.Type.Equal[PET]} && ${Target.PctHPs} <= ${CombatAt}) /attack on
/return
| ################# This will check what Main Assist has in target.
Sub GetTarget
DEBUG_3 D7 (GetTarget)
/declare temp int inner 0
/declare i int local 1
/if (${GotMobID} && ${Spawn[${GotMobID}].Distance} < ${AutoPullEngageDistance}) {
/target id ${GotMobID}
/squelch /stick off
/squelch /moveto off
/target id ${GotMobID}
/varset TargetArray[1] ${Target.CleanName}
/varset TargetArray[2] ${Target.Level}
/varset TargetArray[3] ${Target.Name}
/varset TargetArray[4] ${Target.ID}
/varset CombatOn TRUE
/varset MobRooted FALSE
/varset MobDebuffed FALSE
/varset MobSlowed FALSE
/varset PetOn FALSE
/varset MobDoTed FALSE
/varset DotTime 0
/varset GotMobID 0
/varset WaitForMob 0
/return
}
/varset GotMobID 0
/varset WaitForMob 0
/if (${CombatOn} && !${Spawn[${TargetArray[4]}].Name.Equal[${TargetArray[3]}]} || ${Spawn[${TargetArray[4]}].Type.Equal[Corpse]}) {
/varset MobRooted FALSE
/varset MobDebuffed FALSE
/varset MobSlowed FALSE
/varset PetOn FALSE
/varset MobDoTed FALSE
/varset CombatOn FALSE
/varset DotTime 0
/if (${AutoLoot}) /call DoTheLooting ${TargetArray[4]}
/call GoHome
/varset TargetArray[1] NULL
/varset TargetArray[2] NULL
/varset TargetArray[3] NULL
/varset TargetArray[4] NULL
/squelch /stick off
/if (!${following.Equal[FALSE]}) {
/echo Combat over. Resume following ${following}.
/call FollowFunction "${following}"
}
}
/if (!${AutoPull}) {
DEBUG_3 D8
/squelch /stick off
/assist ${M_Assist}
/delay 7
/if (${Target.Type.Equal[NPC]}) {
/varset TargetArray[1] ${Target.CleanName}
/varset TargetArray[2] ${Target.Level}
/varset TargetArray[3] ${Target.Name}
/varset TargetArray[4] ${Target.ID}
/if (${Target.Distance}<=${AssistAt} && ${Target.ID}==${TargetArray[4]} && ${Target.PctHPs}<=${CombatAt}) /varset CombatOn TRUE
}
} else /if (${TargetArray[4]}) {
/return
}
/if (${Spawn[${TargetArray[4]}].ID} && !${Spawn[${TargetArray[4]}].Type.Equal[Corpse]} && ${Spawn[${TargetArray[4]}].Distance} > 50 && ${WaitForMob} <= 0) {
/varset GotMobID ${TargetArray[4]}
/varset WaitForMob 150
/return
}
/if (${Spawn[${TargetArray[4]}].ID} && !${Spawn[${TargetArray[4]}].Type.Equal[Corpse]}) /return
/for i 1 to ${DebuffTimers.Size}
/if (${DebuffTimers[${i}]}) /if (${Defined[DebuffTimer${DebuffTimers[${i}]}]}) {
/if (${Spawn[${DebuffTimers[${i}]}].Type.Equal[NPC]}) {
/target id ${DebuffTimers[${i}]}
/squelch /stick off
/squelch /moveto off
/target id ${DebuffTimers[${i}]}
/varset TargetArray[1] ${Target.CleanName}
/varset TargetArray[2] ${Target.Level}
/varset TargetArray[3] ${Target.Name}
/varset TargetArray[4] ${Target.ID}
/varset CombatOn TRUE
/varset MobRooted FALSE
/varset MobDebuffed FALSE
/varset MobSlowed FALSE
/varset PetOn FALSE
/varset MobDoTed FALSE
/varset DotTime 0
/return
}
}
/next i
/if (0 && ${AutoLoot} && !${attemptedLoot}) {
/target corpse
/if (${Target.ID} && ${Target.Type.Equal[Corpse]} && (${Target.Distance} < 50 || ${LineOfSight[${Me.Y},${Me.X},${Me.Z}:${Target.Y},${Target.X},${Target.Z}]})) {
/call DoTheLooting ${Target.ID}
/varset attemptedLoot 1
/call GoHome
}
}
/varset attemptedLoot 0
DEBUG_2 BuffsDone: ${BuffsDone}
/if (${AutoPull} && ${BuffsDone} && !${perfectionNeeded} && ${DelayPull} <= 0) {
/call StopFunction
/call PlayFunction "${PathFile} 1 cf pp noz"
/varset doingPath 1
}
/return
| ################### Check target and do stuff like slow, dot, pet attack etc.
Sub Combat
DEBUG_3 D9 (Sub Combat)
/target id ${TargetArray[4]}
/delay 3 ${Target.ID}==${TargetArray[4]}
/if (${Target.ID}==${TargetArray[4]}) /if (${Target.PctHPs}<=${CombatAt} && ${Target.Type.Equal[NPC]}) {
/if (${Target.Distance}>${Spell[${SpellSlow}].Range}) /call AttemptAvoid
}
/if (${CombatOn} && !${PetOn} && ${Target.ID}==${TargetArray[4]} && ${Target.PctHPs}<=${PetCombatAt}) {
/pet attack
/varset PetOn TRUE
}
/if (${CombatOn} && !${MobDebuffed} && ${DoDebuff} && ${Target.ID}==${TargetArray[4]}) {
/call DeBuff
/return
}
/if (${Defined[DebuffTimer${Target.ID}]} && ${DebuffTimer${Target.ID}} > 0) /if (${DotTime}<=0) /if (${Me.PctMana} > 65) /if (${CombatOn} && ${DoDoT} && ${Target.PctHPs}<=${CastDoTat} && ${Target.PctHPs}>=${MinDoTat}) {
/call checkCanCast ${SpellDot} gem${SpellDoTGem}
/if (!${Macro.Return}) /return
/squelch /stick off
/squelch /moveto off
/call cast ${SpellDot} gem${SpellDoTGem}
/if (${Macro.Return.Equal[CAST_SUCCESS]}) {
/varset DotTime ${Math.Calc[${Spell[${SpellDot}].Duration}*60-${Spell[${SpellDot}].CastTime}*10]}
} else {
/varset DotTime 50
}
/varset tookAction 1
/return
}
/if (${Me.Gem[${SpellNuke}]}) /if (${Me.PctMana} > ${MinManaForNuke}) /if (!${nukeTimer}) /if (${CombatOn} && ${DoNuke} && ${Target.PctHPs}<=${NukeAt} && ${Target.PctHPs}>=${MinNukeat}) {
/call checkCanCast ${SpellNuke} gem${SpellNukeGem}
/if (!${Macro.Return}) /return
/squelch /stick off
/squelch /moveto off
/call cast ${SpellNuke} gem${SpellNukeGem}
/if (${Macro.Return.Equal[CAST_SUCCESS]} || ${Macro.Return.Equal[CAST_RESISTED]}) {
/varset nukeTimer ${DelayBetweenNukes}
} else /if (${Macro.Return.Equal[CAST_OUTOFRANGE]}) {
/varset nukeTimer 150
}
/varset tookAction 1
/return
}
/if (${Me.Gem[${SpellNuke}]}) /if (${Me.PctMana} > ${MinManaForNuke}) /if (!${nukeTimer}) /if (${CombatOn} && ${DoNuke} && ${Target.PctHPs}<=${NukeAt} && ${Target.PctHPs}>=${MinNukeat}) {
/call checkCanCast ${SpellOtherNuke} gem${SpellOtherNukeGem}
/if (!${Macro.Return}) /return
/squelch /stick off
/squelch /moveto off
/call cast ${SpellOtherNuke} gem${SpellOtherNuke}
/if (${Macro.Return.Equal[CAST_SUCCESS]} || ${Macro.Return.Equal[CAST_RESISTED]}) {
/varset nukeTimer ${DelayBetweenNukes}
} else /if (${Macro.Return.Equal[CAST_OUTOFRANGE]}) {
/varset nukeTimer 150
}
/varset tookAction 1
/return
}
/target id ${TargetArray[4]}
/if (!${Target.Name.Equal[${TargetArray[3]}]} || !${Target.ID}) {
/varset MobRooted FALSE
/varset MobDebuffed FALSE
/varset MobSlowed FALSE
/varset PetOn FALSE
/varset MobDoTed FALSE
/varset CombatOn FALSE
/varset DotTime 0
/if (${AutoLoot}) /call DoTheLooting ${TargetArray[4]}
/call GoHome
/varset TargetArray[1] NULL
/varset TargetArray[2] NULL
/varset TargetArray[3] NULL
/varset TargetArray[4] NULL
/squelch /stick off
/varset AAExp ${Math.Calc[${Me.PctAAExp}-${AAExp}]}
/varset Exper ${Math.Calc[${Me.PctExp}-${Exper}]}
/if (!${following.Equal[FALSE]}) {
/echo Combat over. Resume following ${following}.
/call FollowFunction "${following}"
}
}
/return
Sub DeBuff
:DeBuff_Loop
DEBUG_3 D10 (:Debuff_Loop)
/if (${Target.PctHPs}<=${CombatAt} && ${Target.Type.Equal[NPC]}) {
/if (${Me.CurrentMana}<${Spell[${SpellDeBuff}].Mana}) {
/if (${Verbose}) /echo *** I don't have mana to cast ${SpellDebuff}
} else {
/call checkCanCast ${SpellDeBuff} gem${SpellDeBuffGem}
/if (!${Macro.Return}) /return
/squelch /stick off
/squelch /moveto off
/keypress left
/keypress right
/delay 3
/call cast ${SpellDeBuff} gem${SpellDeBuffGem} 6s
/varset tookAction 1
/if (${Macro.Return.Equal["CAST_RESISTED"]}) {
/if (${Verbose}) /gsay < %T > RESISTED ${SpellDeBuff} ! Trying again...
/call SetDebuffTimer ${Target.ID} 60
/return
}
/if (!${Macro.Return.Equal["CAST_SUCCESS"]}) {
/if (${Verbose}) /gsay < %T > has been debuffed with: ${SpellDeBuff}
/return
} else /if (${Macro.Return.Equal[CAST_OUTOFRANGE]}) {
/call AttemptAvoid
}
/varset MobDebuffed TRUE
}
}
/return