Maskoi
old and salty
- Joined
- Sep 28, 2005
- RedCents
- 82,796¢
KissAssist.mac v4.0 Updated 09/02/2011
Instructions/Settings Info Click Here
Current Features
- Supports all classes for DPS Melee, Caster and Bards
- Supports any level character
- Set up characters to Pull, Tank or Assist others.
- Select Player, Mercenary or Pet as Main Assist
- Toons can follow Main Assist, remain stationary or return to anchor spot after mob dies.
- Pets supported
- Keep all buffs up Auras, Group, Self, Pet and Clickys
- Creates an ini file for each toon
- Separate Melee and Casting DPS settings.
- Single Buff section for ease of use supports Spells/AA's/Items
- Single DPS section for ease of use Spells/AA's/Items/Discs
- Auto Mana/Endurance med detection depending on class.
- Med settings to turn ON/Off and percentages to Start/Stop
- Separate Bard twist setting for combat and non combat
- Single Heal section for ease of use. Heal with any class
- Loot mobs and set up what items to keep. sell, or destroy via ninjadvloot and separate loot.ini file
- Auto accept rez if turned on via MQ2Rez
- Auto accept party Invites
- Auto accept trades from other players/toons
- Mount support AA or Item.
- Mez mobs feature
- Auto detect progression servers and set variables accordingly for features not yet available. i.e. Extended Target Window.
- Commands to turn on/off major features i.e. healing, mezzing, melee etc.
- Basic mercenary control - Define when merc attacks.
- Supports Attack Buffs
- Supports Autofire
- Supports Nuke Type Heals, i.e. Frozen Gift etc
- Rez players
- Auto revive Mercs
- AFK Tools - Inspired by AHTools
- Burn Section
- Pull mobs ini file support
- Mez Immune ini file support
- Recognition for players on Zek server
- EQBC message support.
K.I.S.S. Assist is our macro for all classes/levels for exclusive use of our subscribers at RedGuides/NotAddicted.com.
Requires plugins* MQ2Cast, MQ2Exchange, MQ2Melee, MQ2MoveUtils, Mq2Rez, & MQ2Twist (Bards) , Extended Target Window and ninjadvloot.inc file.
* All plugins are included in both our NA Official Compile.
Rich (BB code):
| - kissassist.mac v4.0 by Maskoi 09/02/2011
| - KISS Asisst - A simple multi class assist macro
| Requires MQ2Cast, MQ2Exchange. MQ2Melee, MQ2MoveUtils, MQ2Rez ninjadvloot inc file and Extended target window
| Usage - /mac kissassist assist TankName 95
| or target Main Tank and /mac kissassist assist
| This macro was written exclusively for subscribers of Redguides/NotAddicted.com
| -------------------------------------------------------------------------------------
#turbo 40
#include ninjadvloot.inc
#define DEBUG "/squelch /echo"
#define DEBUGBUFFS "/squelch /echo"
#define DEBUGCOMBAT "/squelch /echo"
#define DEBUGHEAL "/squelch /echo"
#define DEBUGMEZ "/squelch /echo"
#define DEBUGPULL "/squelch /echo"
#Event Burn "#*#|${BurnText}|#*#"
#Event CantSee "You cannot see your target."
#Event CantHit "You can't hit them from here."
#Event GainSomething "#*#You have gained|#1#|"
#event GoMOn "You have been granted a gift of#*#"
#event GoMOff "Your gift of#*#mana fades."
#Event GotHit "#*#YOU for#*#points of damage."
#Event OutDoor "#*#outdoors#*#"
#Event OutDoor "You can not summon a mount here."
#Event MezBroke "#1# has been awakened by #2#.
#Event MezImmune "Your target cannot be mesmerized#*#"
#Event MezImmune "Your spell did not take hold#*#"
#Event TaskUpdate "#*#Your task |#1#| has been updated#*#"
#Event ToggleVariable "[MQ2] Toggle #1#"
#Event ToggleVariable "[MQ2] Toggle #1# #2#"
#Event TooClose "Your target is too close to use a ranged weapon!!"
#Event TooFar "Your target is too far away, get closer!"
#Event Zoned "You have entered#*#"
|-------------------------------------------------------------------------------------
| Sub Main
|-------------------------------------------------------------------------------------
Sub Main
/declare MacroName string outer KissAssist
/declare MacroVer string outer 4.0
/declare IniFileName string outer ${MacroName}_${Me.CleanName}.ini
/declare InfoFileName string outer ${MacroName}_Info.ini
| ************************* General **************************************|
| Edit settings in your KissAssist_ToonName.ini file
/call LoadIni General KissAssistVer string ${MacroVer}
/call LoadIni General Role string Assist
/call LoadIni General CampRadius int 50
/call LoadIni General CampRadiusExceed int 400
/call LoadIni General ReturnToCamp int 0
/call LoadIni General ChaseAssist int 0
/call LoadIni General ChaseDistance int 25
/call LoadIni General MedOn int 1
/call LoadIni General MedStart int 20
/call LoadIni General MedCombat int 0
/call LoadIni General LootOn int 0
/call LoadIni General RezAcceptOn int 0
/call LoadIni General AcceptInvitesOn int 1
/call LoadIni General GroupWatchOn int 1
/call LoadIni General EQBCOn int 0
| ************************* Buffs ****************************************|
/call LoadIni Buffs BuffsOn int 0
/declare Buffs[15] string outer
/call LoadIni Buffs Buffs string NULL Buffs
| ************************* Melee ****************************************|
/call LoadIni Melee AssistAt int 95
/if (${Select[${Me.Class.ShortName},BST,BER,MNK,PAL,RNG,ROG,SHD,WAR]}) {
/call LoadIni Melee MeleeOn int 1
} else {
/call LoadIni Melee MeleeOn int 0
}
/call LoadIni Melee FaceMobOn int 1
/call LoadIni Melee MeleeDistance int 75
/call LoadIni Melee StickHow string snaproll rear
/call LoadIni Melee AutoFireOn int 0
| ************************* DPS ******************************************|
/call LoadIni DPS DPSOn int 0
/call LoadIni DPS DPSSkip int 20
/call LoadIni DPS DPSInterval int 2
/declare DPS[8] string outer
/call LoadIni DPS DPS string NULL DPS
|** /declare Recover[2] string 0
/call LoadIni Mana Recover string NULL Recover
/call LoadIni Mana GoM string NULL **|
| ************************* Bard *****************************************|
/if (${Me.Class.Name.Equal[Bard]}) {
/call LoadIni General TwistOn int 0
/call LoadIni General TwistWhat string "Twist order here"
/call LoadIni General ManaSong string "Mana song here to twist during med time"
/call LoadIni Melee MeleeTwistOn int 0
/call LoadIni Melee MeleeTwistWhat string "DPS twist order here"
}
| ************************* Heals ***************************************|
/call LoadIni Heals Help string "Format Spell|% to heal at i.e. Devout Light Rk. II|50"
/call LoadIni Heals HealsOn int 0
/declare Heals[8] string outer
/call LoadIni Heals Heals string NULL Heals
/if (${Select[${Me.Class.ShortName},CLR,NEC,SHM,DRU,PAL]}) {
/call LoadIni Heals AutoRezOn int 0
/call LoadIni Heals AutoRezWith string "Your Rez Item/AA/Spell"
}
| ************************* Pet *****************************************|
/if (${Select[${Me.Class.ShortName},SHM,BST,ENC,MAG,NEC,SHD,WIZ]}) {
/call LoadIni Pet PetOn int 0
/call LoadIni Pet PetSpell string "YourPetSpell"
/call LoadIni Pet PetShrinkOn int 0
/call LoadIni Pet PetShrinkSpell string "Tiny Companion"
/call LoadIni Pet PetBuffsOn int 0
/declare PetBuffs[8] string outer
/call LoadIni Pet PetBuffs string NULL PetBuffs
}
| ************************* Mez *****************************************|
/if (${Select[${Me.Class.ShortName},BRD,ENC]}) {
/call LoadIni Mez MezOn int 0
/call LoadIni Mez MezRadius int 50
/call LoadIni Mez MezMinLevel int "Min Mez Spell Level"
/call LoadIni Mez MezMaxLevel int "Max Mez Spell Level"
/call LoadIni Mez MezStopHPs int 80
/call LoadIni Mez MezSpell string "Your Mez Spell"
/declare MezCount[10] int outer 0
/declare MezImmuneID int outer 0
/call LoadIni "${Zone}" MezImmune string "List up to 10 mobs. Use full names i.e. a green snake,a blue tiger,a wide eye ooze or NULL" 0 ${InfoFileName}
}
| ************************* Burn ****************************************|
/declare Burn[6] string outer
/call LoadIni Burn BurnText string "Decepticons Attack"
/call LoadIni Burn Burn string NULL Burn
| ************************* Pull ****************************************|
/call LoadIni Pull PullWith string "Melee"
/call LoadIni Pull MaxRadius int 350
/call LoadIni Pull MaxZRange int 50
/call LoadIni Pull LoSFailOn int 0
| ************************* AFKTools ************************************|
/call LoadIni AFKTools AFKToolsOn int 0
/call LoadIni AFKTools AFKGMAction string "/quit"
/call LoadIni AFKTools AFKPCRadius int 150
| Do Not Edit These *****************************************************|
/declare MainAssist string outer
/declare CampZone int outer ${Zone.ID}
/declare CampXLoc int outer ${Me.X}
/declare CampYLoc int outer ${Me.Y}
/declare LookForward int outer ${Me.Heading.DegreesCCW}
/declare Attacking int outer 0
/declare PetAttack int outer 0
/declare MedStat string outer
/declare PetShrunk int outer 0
/declare MiscGem string outer 8
/declare Twisting int outer 0
/declare DPSTwisting int outer 0
/declare AddsInCamp int outer 0
/declare MyTargetID int outer 0
/declare MyTargetName string outer 0
/declare ValidTarget int outer 0
/declare MountOn int outer 1
/declare WasTwisting int outer 0
/declare CastResult string outer
/declare TanksMob int outer 0
/declare AggroCheck string outer
/declare AggroTargetID string outer
/declare FailMax int outer 3
/declare Pulled int outer 0
/declare PullRange int outer
/declare PullRangeActual int outer
/declare CombatStart int outer 0
/declare Pulling int outer 0
/declare DurationMod float outer 1
/declare MobCount int outer 0
/declare AddsArray[50,3] string outer NULL
/declare PCsDetected int outer 0
/declare FailCounter int outer 0
/declare MercInGroup int outer 0
/declare DMZ int outer ${Select[${Zone.ID},345,344,202,203,279]}
/declare LastZone int outer 0
/declare JustZoned int outer 0
/declare MercAssisting int outer 0
/declare XTSlot int outer 0
/declare TLP int outer 0
| Set AA DurationMod for various timer from Spell Casting Reinforcement AA
/if (${Me.AltAbility[Spell Casting Reinforcement]}==6) /varset DurationMod 1.15
/if (${Me.AltAbility[Spell Casting Reinforcement]}==12) /varset DurationMod 1.3
/if (${Me.AltAbility[Spell Casting Reinforcement]}==20) /varset DurationMod 1.5
/if (${Me.AltAbility[Spell Casting Reinforcement]}==28) /varset DurationMod 1.7
| Compensate for Progression servers not having Extended Target Window
/if (${Select[${MacroQuest.Server},fippy,vulak]}) {
/noparse /varset AggroCheck ${SpawnCount[npc radius ${MeleeDistance} zradius 25]}
/noparse /varset AggroTargetID ${NearestSpawn[1,npc radius 20 zradius 25].ID}
/varset TLP 1
} else {
/declare n int local
/declare XSlotTotal int local 5
/declare AutoHaterCount int local 0
/if (${Me.AltAbility[Eyes Wide Open]}==5) /varset XSlotTotal 6
/if (${Me.AltAbility[Eyes Wide Open]}==10) /varset XSlotTotal 7
/for n 1 to ${XSlotTotal}
/if (${Me.XTarget[${n}].Type.Equal[Auto Hater]}) {
/if (${XTSlot}==0) /varset XTSlot ${n}
/varcalc AutoHaterCount ${AutoHaterCount}+1
}
/next n
/if (${XTSlot}==0) {
/echo You have no slots in you r Extended Target Window set to Auto.
/echo Please set at least 1 slot to Auto and restart KissAssist.
/end
}
/noparse /varset AggroCheck ${Me.XTarget}
/noparse /varset AggroTargetID ${Me.XTarget[${XTSlot}].ID}
/call LoadIni Merc Help string "To use: Turn off Auto Assist in Manage Mercenary Window"
/call LoadIni Merc MercOn int 0
/call LoadIni Merc MercAssistAt int 92
}
/if (${Select[${Me.Class.ShortName},BST,BRD,CLR,DRU,ENC,MAG,NEC,PAL,RNG,SHM,SHD,WIZ]}) /varset MedStat Mana
/if (${Select[${Me.Class.ShortName},BER,MNK,ROG,WAR]}) /varset MedStat Endurance
/declare i int local
| Declare timers for DPS duration spells
/for i 1 to ${DPS.Size}
/declare DPSTimer${i} timer outer 5
/declare ABTimer${i} timer outer 0
/next i
| Declare timers for Heal duration spells
/declare j int local
/declare k int local
| Declare timers for Heal duration spells
/for j 1 to ${Heals.Size}
/declare SpellGH${j} timer outer 0
/for k 0 to 5
/declare Spell${j}GM${k} timer outer 0
DEBUG Spell${j}GM${k} ${Spell${j}GM${k}}
/next k
/next j
| Declare timers for mezzing
/declare l int local
/for l 1 to 10
/declare MezTimer${l} timer outer 0
/declare MMTimer${l} timer outer 0
/next l
| Declare timers for Attack Buffs duration spells
/declare m int local
/for m 1 to 5
/declare RezTimer${m} timer outer 0
/next m
/if (${KissAssistVer.NotEqual[${MacroVer}]}) {
/echo Version Mismatch Detected, Writing Aliases this can take up to 1 min
/squelch /alias /looton /echo toggle LootOn
/squelch /alias /buffson /echo toggle BuffsOn
/squelch /alias /dpson /echo toggle DPSOn
/squelch /alias /meleeon /echo toggle MeleeOn
/squelch /alias /healson /echo toggle HealsOn
/squelch /alias /peton /echo toggle PetOn
/squelch /alias /mezon /echo toggle MezOn
/squelch /alias /chase /echo toggle ChaseAssist
/squelch /alias /camphere /echo toggle ReturnToCamp
/squelch /alias /autofireon /echo toggle AutoFireOn
/squelch /alias /autorezon /echo toggle AutoRezOn
/ini "${IniFileName}" "General" "KissAssistVer" "${MacroVer}"
}
|-------------------------------------------------------------------------------------
| Check if required plugins are loaded and settings
|-------------------------------------------------------------------------------------
/call CheckPlugin MQ2Cast
/call CheckPlugin MQ2Exchange
/call CheckPlugin MQ2Melee
/call CheckPlugin MQ2Moveutils
/call CheckPlugin MQ2Rez
| Turn aggro mode off and turn on melee mode in MQ2Melee
/if (${MeleeOn}) {
/squelch /melee aggro=0
/squelch /melee melee=1
/squelch /melee stickbreak=1
}
| Set MQ2moveutils variables
/stick set verbflags 0
/stick set breakonkb on
/stick set breakonmouse off
/stick set breakdist ${CampRadiusExceed}
/stick set breakonwarp on
/stick set usefleeing on
| Set up MQ2rez if RezAcceptOn=1
/if (${RezAcceptOn}) {
/squelch /rez accept on
/squelch /rez loot off
} else /squelch /rez accept off
| Initialize variables for ninjadvloot.inc include file
/call SetupAdvLootVars
|-------------------------------------------------------------------------------------
| - Assign Main Tank from command line parameter or targeted player, merc or pet
|-------------------------------------------------------------------------------------
/if (${Defined[Param0]}) {
/varset Role ${Param0}
}
/if (!${Defined[Param1]}) {${DMZ}
/varset MainAssist ${Target.CleanName}
}
| Check command line for tank name
/if (${Defined[Param1]}) {
/varset MainAssist ${Param1}
/delay 10
/target id ${Spawn[${MainAssist}].ID}
}
| Error control no tank selected end macro
/if (!${Spawn[${Target}].ID} || !${Select[${Target.Type},Mercenary,PC,Pet]}) {
/echo You do not have a Mercenary, PC or Pet targeted. Please target Main Tank and restart macro.
/end
}
| Targeted myself end macro
/if (${Target.CleanName.Equal[${Me.CleanName}]} && ${Role.Equal[assist]}) {
/echo You cannot assist yourself! Please target Main Tank and restart macro.
/end
}
/if (${Defined[Param2]} && ${Role.NotEqual[tank]}) {
/varset AssistAt ${Param2}
}
/call CheckRoles
/if (${Select[${Role},puller,pullertank,hunter]}) /call LoadIni "${Zone}" MobsToPull string "List up to 25 mobs. Can be partial names Example: rat,snake,bear or ALL for all mobs" 0 ${InfoFileName}
/echo ================================
/echo Redguides/NotAddicted.com presents
/echo ${MacroName} v.${MacroVer} by Maskoi
/echo ================================
/if (${Select[${Role},tank]}) {
/if (${MainAssist.Equal[${Me}]}) {
/echo I am Main Tank & Main Assist
} else {
/echo I am Tank & KissAssisting >> ${MainAssist} <<
}
} else /if (${Select[${Role},puller]}) {
/echo I am Puller. KissAssisting >> ${MainAssist} << at ${AssistAt}%
} else /if (${Select[${Role},pullertank]}) {
/echo I am Puller & Tank.
} else /if (${Select[${Role},hunter]}) {
/echo I am Hunting.
} else {
/echo KissAssisting >> ${MainAssist} << at ${AssistAt}%
}
/squelch /target clear
/squelch /assist off
|-------------------------------------------------------------------------------------
| Main Loop
|-------------------------------------------------------------------------------------
:MainLoop
/doevents
/call DoMezStuff
/call CanIDoStuff
/call MercsDoWhat
/call DoWeMed
/call DoPetStuff
/call CheckBuffs
/call DoHealStuff
/call DoBardStuff
/call GroupWatch
/call FindMobToPull
/call Assist
/call Combat
/call CheckForAdds
/call LootStuff
/call DoWeMove
/call AFKTools
/goto :MainLoop
/return
|-------------------------------------------------------------------------------------
| SUB: Assist - Get Main Tank's target
|-------------------------------------------------------------------------------------
Sub Assist
/if (${DMZ}) /return
/declare AssistCount int local 0
/declare HighestLevelID int local 0
/declare i int local
:AssistAgain
/doevents
DEBUGCOMBAT Assist: Enter
/if (${ChaseAssist}) /call DoWeMove
/if (${Spawn[${MainAssist}].ID} && ${MainAssist.NotEqual[${Me}]} && ${Spawn[${MainAssist}].Distance}<200) {
/assist ${MainAssist}
} else /if (${MainAssist.Equal[${Me}]} && !${Me.Hovering}) {
| If adds and tanking grab highest level mob to kill first.
/call MobRadar ${MeleeDistance}
/if (${MobCount}>1) {
/varset HighestLevelID ${AddsArray[1,1]}
/for i 1 to ${MobCount}
/if (${Spawn[${HighestLevelID}].Level}<${AddsArray[${i},2]} && ${Spawn[${HighestLevelID}].Distance}<${MeleeDistance}) /varset HighestLevelID ${AddsArray[${i},1]}
/next i
/squelch /target id ${HighestLevelID}
} else {
/squelch /target id ${AggroTargetID}
}
} else {
/squelch /target id ${AggroTargetID}
}
/delay 5
/call ValidateTarget
DEBUGCOMBAT Target:${Target.CleanName} ValidTarget:${ValidTarget} Marco Return:${Marcro.Return}
/if (${ValidTarget}==0) {
/squelch /target clear
/varcalc AssistCount ${AssistCount}+1
/if (${AssistCount}<=3) /goto :AssistAgain
/return
}
/varset MyTargetID ${Target.ID}
/varset MyTargetName ${Target.CleanName}
DEBUGCOMBAT MyTargetName:${MyTargetName} ID:${MyTargetID}
DEBUGCOMBAT Assist: Leave
/return
|-------------------------------------------------------------------------------------
| SUB: Validate Target
|-------------------------------------------------------------------------------------
Sub ValidateTarget
DEBUGCOMBAT ValidateTarget Enter
/declare i int local
/declare j int local
/declare PullValid int local 0
/varset ValidTarget 0
/if (!${Target.ID}) /return NoTarget
/if (${Select[${Target.Type},CAMPFIRE,CORPSE,CHEST,TRIGGER,TRAP,TIMER,ITEM,MOUNT,Mercenary]}) /return
/if (${Pulling} && !${Pulled}) {
/if (${Select[${Role},puller,pullertank]} && !${Target.LineOfSight}) {
/if (!${LoSFailOn}) {
/return LOS
} else {
/if (${FailCounter}<${FailMax}-1) /return LOS
}
}
/if (${SpawnCount[loc ${Target.X} ${Target.Y} radius 25 pc]}>=1) /return PCNear
DEBUGPULL ${MobsToPull}
/if (${MobsToPull.Find[All]}) /goto :SkipPullValidate
/for j 1 to 10
DEBUGPULL ${j} ${MobsToPull.Arg[${j},,]} ${Target.CleanName.Find[${MobsToPull.Arg[${j},,]}]}
/if (${Target.CleanName.Find[${MobsToPull.Arg[${j},,]}]}) {
/varset PullValid 1
/goto :SkipPullValidate
}
/next j
/if (!${PullValid}) /return PullMob
:SkipPullValidate
}
/if (${Target.Type.Equal[Pet]} && ${Target.Master.Type.Equal[PC]}) /return PET-PC
/if (!${Select[${MacroQuest.Server},zek]} && ${Select[${Target.Type},PC]}) /return PC
| This prevents characters on the Zek server from attacking PC targets in their group
/if (${Select[${MacroQuest.Server},zek]} && ${Select[${Target.Type},PC]}) {
/for i 0 to 5
/if (${Target.ID}==${Group.Member[${i}].ID}) /return GroupMember
/next i
/if (${Target.ID}==${Spawn[${MainAssist}].ID}) /return MA
}
/varset ValidTarget 1
DEBUGCOMBAT ValidateTarget: Leave
/return ${ValidTarget}
|-------------------------------------------------------------------------------------
| SUB: Combat
|-------------------------------------------------------------------------------------
Sub Combat
/doevents
/if (!${MyTargetID} || !${Target.ID} || ${DMZ}) /return
DEBUGCOMBAT Combat: Enter
/if (${ChaseAssist}) /call DoWeMove
/if (${MezOn}) /call DoMezStuff
/if (${HealsOn}) /call DoHealStuff
| Check Target Hps and type NPC or NPC Pet
/if (${Spawn[${MyTargetID}].PctHPs}<=${AssistAt} && ${Spawn[${MyTargetID}].Distance}<${MeleeDistance}) {
/if (!${Attacking}) {
/varset MercAssisting 0
/varset CombatStart 1
/echo ATTACKING -> ${Target.CleanName} <-
/if (${EQBC.Connected} && ${EQBCOn} && ${Select[${Role},Tank,PullerTank,Hunter]}) /docommand /bc [+y+]TANKING-> ${Spawn[${MyTargetID}].CleanName} <- ID:${MyTargetID}[+x+]
}
/if (${FaceMobOn}) /face
/if (${MeleeOn} && !${Attacking}) {
/varset Attacking 1
/if (${Me.Sitting}) /stand
/if (!${AutoFireOn}) {
/moveto id ${MyTargetID} mdist 15
/if (${StickHow.NotEqual[0]}) /stick ${StickHow} id ${MyTargetID}
| Speed up tanks attacking inc mobs MQ2Melee /killthis can cause a delay
/if (${Select[${Role},tank,pullertank,hunter]}) /attack on
/killthis
}
}
:Attack
/doevents
/if (${MercOn} && !${MercAssisting} && ${MyTargetID}) /call MercsDoWhat
/if (${MezOn}) /call DoMezStuff
/if (${Me.Pet.ID} && !${PetAttack}) {
/pet attack
/varset PetAttack 1
}
/if (${DPSOn}) /call CombatCast
/if (${HealsOn}) {
/if (!${DPSOn} && !${MeleeOn}) /target ${MainAssist}
/call DoHealStuff
}
/if (${Me.Class.Name.Equal[Bard]}) /call DoBardStuff
/call CombatTargetCheck
/if (${AutoFireOn} && !${Me.AutoFire}) /autofire
/if (${Attacking} && ${MeleeOn} && ${Target.PctHPs}<=${Math.Calc[${AssistAt}-5]} && ${Target.Distance}<${MeleeDistance} && !${AutoFireOn}) {
/if (!${Me.Combat}) {
/if (${Me.Sitting}) /stand
/killthis
}
/if (${StickHow.NotEqual[0]} && !${Stick.Active} && ${Target.Distance}>15) /stick ${StickHow} id ${MyTargetID}
}
/if (${Spawn[${MyTargetID}].Type.Equal[Corpse]} || !${Spawn[${MyTargetID}].ID}) {
/call CombatReset
/call CheckForAdds
/call DoWeMove
/return
}
/if (${Spawn[${MyTargetID}].Type.NotEqual[Corpse]} || ${Spawn[${MyTargetID}].ID} || ${Melee.Status.NotEqual[FEIGNING]}) /goto :Attack
}
DEBUGCOMBAT Combat: Leave
/return
|-------------------------------------------------------------------------------------
| SUB: CombatTargetCheck
|-------------------------------------------------------------------------------------
Sub CombatTargetCheck
/if (${Target.ID}!=${MyTargetID} && ${Spawn[${MyTargetID}].ID}) {
/squelch /target id ${MyTargetID}
/delay 15 ${Target.ID}==${MyTargetID}
}
/return
|-------------------------------------------------------------------------------------
| SUB: Combat Cast
|-------------------------------------------------------------------------------------
Sub CombatCast
DEBUGCOMBAT CombatCast: Enter
/declare i int local 0
/declare DPSText string local
/declare DPSAt int local ${AssistAt}
/declare DPSTargetID int local ${MyTargetID}
/declare DPSItem string local
/for i 1 to ${DPS.Size}
/doevents
/if (${MezOn}) /call DoMezStuff
/if (${HealsOn}) /call DoHealStuff
/if (${MercOn} && !${MercAssisting} && ${MyTargetID}) /call MercsDoWhat
/call CombatTargetCheck
/if (${Spawn[${MyTargetID}].Type.Equal[Corpse]} || !${Spawn[${MyTargetID}].ID}) {
/return
}
DEBUGCOMBAT ${DPS[${i}]} ${DPS[${i}].Arg[1,|]} ${DPS[${i}].Arg[2,|]} ${DPS[${i}].Arg[3,|]}
| - Check for 2nd value in dps for mob health
/if (${DPS[${i}].Arg[2,|].Length}) {
/varset DPSText ${DPS[${i}]}
/varset DPS[${i}] ${DPSText.Arg[1,|]}
/varset DPSAt ${DPSText.Arg[2,|]}
/if (${DPSText.Arg[3,|].Find[MA]}) /varset DPSTargetID ${Spawn[${MainAssist}].ID}
/if (${DPSText.Arg[3,|].Find[Me]}) /varset DPSTargetID ${Me.ID}
DEBUGCOMBAT ${DPS[${i}].Arg[1,|]} ${DPSAt} ${DPSTargetID}
}
/if (${Target.PctHPs}>${DPSAt} || ${Target.PctHPs}<${DPSSkip} || ${DPS[${i}].Equal[NULL]} || ${ABTimer${i}} || ${DPSTimer${i}} || (!${Select[${MacroQuest.Server},zek]} && ${Target.Type.NotEqual[NPC]})) /goto :skipcast
DEBUGCOMBAT CombatCast: "${DPS[${i}]}" Target: ${Target.ID} Timer: ${DPSTimer${i}}
/delay 20 ${Cast.Ready[${DPS[${i}]}]}
/call CastWhat "${DPS[${i}]}" ${DPSTargetID}
DEBUGCOMBAT CombatCast: ${Macro.Return}
/if (${Macro.Return.Equal[CAST_SUCCESS]}) {
/echo ** ${DPS[${i}]} on >> ${Spawn[${DPSTargetID}].CleanName} <<
/if (${FindItemCount[=${DPS[${i}]}]}) {
/varcalc DPSTimer${i} ${FindItem[=${DPS[${i}]}].Spell.Duration.TotalSeconds}*10
/goto :skipcast
} else /if (${Me.Book[${DPS[${i}]}]}) {
| - Attack Buff Timers are seperate. DPS timers are cleared after every fight.
/if (${Select[${DPSTargetID},${Me.ID},${Spawn[${MainAssist}].ID}]}) {
/varcalc ABTimer${i} (${Spell[${DPS[${i}]}].Duration.TotalSeconds}*${DurationMod})*10
DEBUGCOMBAT Spell:${DPS[${i}]} Timer:ABTimer${i} Time:${ABTimer${i}}
/goto :skipcast
| - Custom timer for cleric pets
} else /if (${Me.Class.Name.Equal[Cleric]} && (${DPS[${i}].Find[Zeal]} || ${DPS[${i}].Find[Unswerving]})) {
/zone /varset DPSTimer${i} 5m
/goto :skipcast
| - Custom timer for counterbias
} else /if (${Me.Class.Name.Equal[Shaman]} && ${DPS[${i}].Find[counterbias]}) {
/varset DPSTimer${i} 1.5m
/goto :skipcast
} else /if (${Spell[${DPS[${i}]}].Duration}>0) {
/varcalc DPSTimer${i} ${Spell[${DPS[${i}]}].Duration.TotalSeconds}*10
/goto :skipcast
} else {
/varset DPSTimer${i} ${DPSInterval}s
/goto :skipcast
}
} else /if (${Spell[${DPS[${i}]}].Duration}>0) {
/varcalc DPSTimer${i} ${Spell[${DPS[${i}]}].Duration.TotalSeconds}*10
/goto :skipcast
} else {
/varset DPSTimer${i} ${DPSInterval}s
}
}
/call CheckCasting
:skipcast
DEBUGCOMBAT ${DPS[${i}]} ${Macro.Return} DPSTimer${i} ${DPSTimer${i}}
| Reset values if 2nd value in dps for mob health exists
/if (${DPSText.Arg[2,|].Length}) {
/varset DPS[${i}] ${DPSText}
/varset DPSAt ${AssistAt}
/varset DPSText
/varset DPSTargetID ${MyTargetID}
}
/next i
DEBUGCOMBAT CombatCast: Leave
/return
|-------------------------------------------------------------------------------------
| SUB: CombatReset
|-------------------------------------------------------------------------------------
Sub CombatReset
DEBUGCOMBAT CombatReset: Enter
/echo SLAIN >> ${MyTargetName} <<
/declare i int local
/declare j int local
/call MobRadar ${MeleeDistance}
/for j 1 to 50
/if (${AddsArray[${j},1].Equal[${MyTargetID}]}) /call RemoveFromArray ${j}
/if (${MobCount}==0) /call RemoveFromArray ${j}
/next j
/varset MyTargetID 0
/varset MyTargetName
/varset ValidTarget 0
/varset MercAssisting 0
/varset CombatStart 0
/varset Pulled 0
/squelch /attack off
/squelch /target clear
/varset Attacking 0
/for i 1 to ${DPS.Size}
/varset DPSTimer${i} 0
/next i
/if (${Me.Class.Name.Equal[Bard]}) /call DoBardStuff
/if (${Me.Pet.ID}) {
/varset PetAttack 0
/pet back off
/if (${Me.AltAbility[Pet Discipline]}) /pet hold on
/if (${Select[${Role},puller,pullertank]}) /pet guard
}
/call LootStuff
DEBUGCOMBAT CombatReset: Leave
/return
|-------------------------------------------------------------------------------------
| SUB: Check for adds
|-------------------------------------------------------------------------------------
Sub CheckForAdds
/call MobRadar ${MeleeDistance}
/if (!${MobCount} || ${DMZ}) /return
DEBUG CheckForAdds: Enter
/if (!${TLP} && ${AggroTargetID} || ${TLP} && ${SpawnCount[npc targetable radius ${MeleeDistance} zradius 50]}) {
/varset AddsInCamp 1
/if (!${MyTargetID}) {
/popup Add(s) in camp detected
/echo Add(s) in camp detected
/if (${EQBC.Connected} && ${EQBCOn} && ${MainAssist.Equal[${Me}]}) /docommand /bc [+r+]Add(s) in camp detected[+x+]
}
:moreadds
/delay 5
/call Assist
/if (${MezOn}) /call DoMezStuff
/call Combat
DEBUG stuck here
/call MobRadar ${MeleeDistance}
/if (${DMZ}) /return
/if (${MobCount}>0 && ${AggroTargetID}) /goto :moreadds
/varset AddsInCamp 0
}
DEBUG CheckForAdds: Leave
/return
|-------------------------------------------------------------------------------------
| SUB: CastWhat
|-------------------------------------------------------------------------------------
Sub CastWhat(string castWhat,int castTargetID)
DEBUG CastWhat: Enter castWhat - ${castWhat} castTargetID - ${castTargetID}
/varset CastResult CAST_FAIL
/if (${Me.CombatAbility[${castWhat}]} && !${Me.CombatAbilityTimer[${castWhat}]}) {
/disc ${castWhat}
/varset CastResult CAST_SUCCESS
}
| - Check & cast if item
/if (${FindItem[=${castWhat}].ID} && ${FindItem[${castWhat}].Timer}==0) {
/casting "${castWhat}"|item -targetid|${castTargetID}
/delay 2s
/varset CastResult ${Cast.Result}
}
| - Check & cast if AA
/if (${Me.AltAbility[${castWhat}]} && ${Me.AltAbilityReady[${castWhat}]}) {
/if (${Me.Class.Name.NotEqual[Bard]}) {
/casting "${castWhat}"|alt -targetid|${castTargetID} -maxtries|2
/varset CastResult ${Cast.Result}
}
/if (${Me.Class.Name.Equal[Bard]}) {
/alt act ${Me.AltAbility[${castWhat}].ID}
/varset CastResult CAST_SUCCESS
}
}
| - Check & cast if spell
/if (${Me.Book[${castWhat}]} && ${Spell[${castWhat}].Mana}<=${Me.CurrentMana}) {
| Mem spell if not memmed
/if (!${Me.Gem[${castWhat}]}) {
/if (${Bool[${Plugin[mq2instantmem]}]}) {
/memspell ${MiscGem} "${castWhat}"
} else {
/memorize "${castWhat}" ${MiscGem}
}
/delay 150 ${Cast.Ready[${castWhat}]}
}
/if (${Cast.Ready[${castWhat}]}) {
/casting "${castWhat}" -maxtries|2 -targetid|${castTargetID}
/varset CastResult ${Cast.Result}
}
}
:WaitOnCasting
/if (${Me.Class.Name.NotEqual[Bard]} && ${Cast.Status.NotEqual}) /goto :WaitOnCasting
DEBUG CastWhat: Leave
/return ${CastResult}
|-------------------------------------------------------------------------------------
| SUB: Do We Move
|-------------------------------------------------------------------------------------
Sub DoWeMove
/if (!${ReturnToCamp} && !${ChaseAssist}) /return
/call EndMacroIf
DEBUG DoWeMove: Enter
| - Shuts off ReturnToCamp if a toon moves a big distance defined by CampRadiusExceed ie CoH
/if (${ReturnToCamp}) {
/if (${Math.Distance[${CampYLoc},${CampXLoc}]} > ${CampRadiusExceed} && !${Pulled}) {
/varset ReturnToCamp 0
/echo Leashing exceeded distance of ${CampRadiusExceed} turning off ReturnToCamp
/return
}
/if (${Math.Distance[${CampYLoc},${CampXLoc}]} > ${CampRadius} && !${AddsInCamp}) {
/moveto loc ${CampYLoc} ${CampXLoc} mdist 1
:InCampYet
/delay 10
/if (${Math.Distance[${CampYLoc},${CampXLoc}]} > ${CampRadius}) /goto :InCampYet
/if (!${Target.ID}) /face heading ${LookForward}
}
}
/if (${ChaseAssist}) {
DEBUG ChaseAssist
/if (!${Spawn[${MainAssist}].ID} || ${Spawn[${MainAssist}].Distance} > ${CampRadiusExceed} || ${Math.Calc[${Spawn[${MainAssist}].Z}-${Me.Z}]}>100) {
DEBUG ChaseAssist exceed camp check
/varset ChaseAssist 0
/echo ChaseAssist distance exceeded: Turning off ChaseAssist
}
/if (${Spawn[${MainAssist}].Distance} > ${ChaseDistance} && ${Spawn[${MainAssist}].Distance} < ${CampRadiusExceed}) {
DEBUG ChaseAssist MA distance check
/stick ${ChaseDistance} id ${Spawn[${MainAssist}].ID} loose
:AreWeThere
/delay 10
/if (${Me.Moving}) /goto :AreWeThere
}
}
DEBUG DoWeMove: Leave
/return
|-------------------------------------------------------------------------------------
| SUB: DoWeMed
|-------------------------------------------------------------------------------------
Sub DoWeMed
/if (!${MedOn}) /return
DEBUG DoWeMed enter
/if (!${Me.Moving}) {
/if (${Me.Pct${MedStat}}<${MedStart}) {
/squelch target clear
/echo MEDDING-> ${MedStart}% ${MedStat} time to med.
:wait_for_resume
/doevents
/delay 5
/call CheckCasting
/delay 5
/if (!${Me.Sitting}) /sit
/if (!${MedCombat}) {
/call CheckForAdds
/call DoWeMove
/call CheckBuffs
/if (${AggroTargetID}) /return
}
/if (${Me.Pct${MedStat}}<100) /goto :wait_for_resume
:done_medding
/if (${Me.Sitting}) /stand
}
}
DEBUG DoWeMed leave
/return
|-------------------------------------------------------------------------------------
| SUB: CheckCasting
|-------------------------------------------------------------------------------------
Sub CheckCasting
:NotCasting
/if (${Me.Class.Name.NotEqual[Bard]} && ${Cast.Status.NotEqual}) /goto :NotCasting
/return
|-------------------------------------------------------------------------------------
| SUB: CheckBuffs
|-------------------------------------------------------------------------------------
Sub CheckBuffs
/doevents
/if (!${BuffsOn}) /return
/call CanIDoStuff
/if (${ChaseAssist}) /call DoWeMove
DEBUGBUFFS CheckBuffs: enter
/declare i int local
/declare j int local
/declare FullText string local 0
/declare 1stPart string local 0
/declare 2ndPart string local 0
/declare 3rdPart string local 0
/declare 4thPart string local 0
| Group Buffs
/for i 1 to ${Buffs.Size}
/call CanIDoStuff
/call CheckForAdds
| If Buffs=NULL skip to next buff
/if (${Buffs[${i}].Equal[Null]} || ${Buffs[${i}].Arg[3,|].Equal[0]}) /goto :SkipBuff
DEBUGBUFFS #${i} Buff${i}=${Buffs[${i}]}
| Check for spells with 2 parts such as Exigent Focusing Rk. II,Talisman of Soul's Unity Rk. II - Set Buffs to the buff
/if (${Buffs[${i}].Arg[2,|].Length}) {
/varset FullText ${Buffs[${i}]}
/varset 1stPart ${Buffs[${i}].Arg[1,|]}
/varset 2ndPart ${Buffs[${i}].Arg[2,|]}
/varset 3rdPart ${Buffs[${i}].Arg[3,|]}
/varset 4thPart ${Buffs[${i}].Arg[4,|]}
/varset Buffs[${i}] ${Buffs[${i}].Arg[1,|]}
/if (${FullText.Arg[2,|].Equal[Mana]}) /varset 2ndPart Mana
/if (${FullText.Arg[2,|].Equal[Aura]}) /varset 2ndPart Aura
/if (${FullText.Arg[2,|].Equal[Mount]}) /varset 2ndPart Mount
/if (${FullText.Arg[2,|].Equal[Dual]}) /varset 2ndPart Dual
/if (${FullText.Arg[2,|].Equal[Me]}) /varset 2ndPart Me
/if (${FullText.Arg[2,|].Equal[MA]}) /varset 2ndPart MA
}
DEBUGBUFFS -- 1st assigned: ${2ndPart} ${Buffs[${i}]}
| Check if aura is up and if it stacks with existing buffs
/if (${2ndPart.Equal[Aura]}) {
| mage exception becasue aura is on pet not in song window
/if ((${Select[${Me.Class.ShortName},MAG]} && !${Me.PetBuff[${3rdPart}]} && ${Me.Pet.Distance}<175) || (!${Select[${Me.Class.ShortName},MAG]} && !${Me.Song[${3rdPart}].ID} && ${Spell[${3rdPart}].Stacks[0]})) {
DEBUGBUFFS Aura
/echo Casting Aura >> ${1stPart} <<
| - Mutant Bards do this
/if (${Me.Class.ShortName.Equal[BRD]}) {
/if (!${Me.Gem[${1stPart}]}) {
/memorize "${1stPart}"|8
/delay 30
}
/squelch /twist once ${Me.Gem[${1stPart}]}
/delay 50
/goto :SkipBuff
}
| - Normal casting
/if (${Select[${Me.Class.ShortName},BER,MNK,ROG,WAR]}) {
/disc ${1stPart}
} else {
/casting "${1stPart}"|${MiscGem}
}
/delay 5s
}
/goto :SkipBuff
}
| Cast mount
/if (${2ndPart.Equal[Mount]} && !${3rdPart.Find[0]} && !${Me.Mount.ID} && !${Attacking} && ${MountOn}) {
DEBUGBUFFS Mount
/call CastWhat "${1stPart}" ${Me.ID}
/if (${Macro.Return.NotEqual[CAST_SUCCESS]}) /varset MountOn 0
/goto :SkipBuff
}
| Check and Cast mana type spells/aas/items - Canni/Paragon/Harvest
/if (${2ndPart.Equal[Mana]}) {
/if (${Me.PctMana}<=${3rdPart} && ${Me.PctHPs}>${4thPart} && !${Attacking}) {
DEBUGBUFFS Canni/Paragon/Harvest
/call CastWhat "${1stPart}" ${Me.ID}
/if (${Macro.Return.Equal[CAST_SUCCESS]}) /echo Casting >> ${1stPart} << for mana
/goto :SkipBuff
}
}
/if (${Select[${2ndPart},Aura,Mount,Mana]}) /goto :SkipBuff
| Check for spells with 2 parts such as Exigent Focusing Rk. II,Talisman of Soul's Unity Rk. II - Set Buffs to buff part of spell
/if (${FullText.Arg[2,|].Equal[Dual]}) /varset Buffs[${i}] ${3rdPart}
| Check if buff is up and if it stacks with existing buffs
DEBUGBUFFS BuffSlot: ${Me.Buff[${Buffs[${i}]}].ID} SongSlot: ${Me.Song[${Buffs[${i}]}].ID} Stacks: ${Spell[${Buffs[${i}]}].Stacks[0]} 2nd Part: ${Select[${2ndPart},Aura,Mount,Mana]}<1 Tar Type: ${Spell[${Buffs[${i}]}].TargetType}
/if ((!${Me.Buff[${Buffs[${i}]}].ID} || !${Me.Song[${Buffs[${i}]}].ID}) && ${Spell[${Buffs[${i}]}].Stacks[0]}) {
| Check for spells with 2 parts such as Exigent Focusing Rk. II,Talisman of Soul's Unity Rk. II - Set Buffs to actual spell
/if (${FullText.Arg[2,|].Equal[Dual]}) /varset Buffs[${i}] ${1stPart}
DEBUGBUFFS -- 2nd asssigned: ${Buffs[${i}]}
| If Target.Type=Group then buff self with group buff
/if (${Spell[${Buffs[${i}]}].TargetType.Find[group]}>=1) {
/call CastWhat "${Buffs[${i}]}" ${Me.ID}
/if (${Macro.Return.Equal[CAST_SUCCESS]}) /echo Buffing >> ${Buffs[${i}]} <<
/delay 20
}
| If Target.Type=Single then buff each party member with single buff
/if (${Spell[${Buffs[${i}]}].TargetType.Find[single]}) {
/if (${Group}) {
DEBUGBUFFS Group Buff
/for j 0 to ${Group}
| Check if party member is in zone and within spell range and if spell is set to cast on self only |Me
/if (!${Group.Member[${j}].ID} || ${Spawn[${Group.Member[${j}]}].Distance}>=${Spell[${Buffs[${i}]}].Range} || ${2ndPart.Equal[Me]} && ${i}>=1) /goto :nextmember
/call CastWhat "${Buffs[${i}]}" ${Group.Member[${j}].ID}
/if (${Macro.Return.Equal[CAST_SUCCESS]}) {
/echo Buffing ${Buffs[${i}]} on ${Group.Member[${j}].CleanName}
/delay 60 ${Me.SpellReady[${Buffs[${i}]}]}
}
/delay 20
:nextmember
/next j
} else {
/call CastWhat "${Buffs[${i}]}" ${Me.ID}
/delay 20
}
}
| If Target.Type=self then buff self
/if (${Spell[${Buffs[${i}]}].TargetType.Find[self]}) {
DEBUGBUFFS Self Buff
/call CastWhat "${Buffs[${i}]}" ${Me.ID}
/delay 20
}
| Check if buff needs pet as target ie Mage's Symbiosis line of mana buffs
/if (${Spell[${Buffs[${i}]}].TargetType.Find[pet]} || ${Select[${Spell[${Spell[${Buffs[${i}]}].ID}].Name.Arg[2,]},Symbiosis,Siphon,Simulacrum]}) {
DEBUGBUFFS Self Buff that targets pet ie mage mana buff line
/call CastWhat "${Buffs[${i}]}" ${Me.Pet}
/delay 20
}
}
| If buff is an item click it
/if (${FindItem[${Buffs[${i}]}].Spell.Stacks[0]} && (!${Me.Buff[${FindItem[${Buffs[${i}]}].Spell}].ID} || !${Me.Buff[${FindItem[${Buffs[${i}]}].Spell}].ID}) && ${FindItem[${Buffs[${i}]}].Timer}==0 && ${Select[${2ndPart},Aura,Mount,Mana]}<1) {
DEBUGBUFFS Items
/if (${Twist}) /multiline ; /squelch /twist off ; /varset Twisting 0
/echo Clicking > ${Buffs[${i}]} <
/call CastWhat "${Buffs[${i}]}" ${Me.ID}
/delay 15s !${Me.Casting.ID}
}
:SkipBuff
| Reset spell vars
/if (${FullText.Arg[2,|].Length}) {
/varset Buffs[${i}] ${FullText}
/varset FullText 0
/varset 1stPart 0
/varset 2ndPart 0
/varset 3rdPart 0
/varset 4thPart 0
}
/next i
DEBUGBUFFS CheckBuffs leave
/return
|-------------------------------------------------------------------------------------
| SUB: DoPetStuff
|-------------------------------------------------------------------------------------
Sub DoPetStuff
/doevents
/if (!${PetOn} || ${Mobcount}) /return
DEBUG DoPetStuff: enter
/declare i int local
/if (${Me.Pet.CleanName.Equal[${Me.Name}`s familiar]}) /pet get lost
/if (!${Me.Pet.ID} && ${Spell[${PetSpell}].Mana}<=${Me.CurrentMana}) {
/delay 3
/casting "${PetSpell}"|8 -maxtries|2
/delay 350 ${Cast.Ready[${PetSpell}]}
/if (${My.Pet.ID}) /echo My pet is now: ${Me.Pet.CleanName} from ${PetSpell}
/if (${Select[${Role},puller,pullertank]}) /pet guard
/if (${Me.AltAbility[Pet Discipline]}) /pet hold on
}
/if (${Me.Pet.ID}) {
| Pet Buffs
/if (${PetBuffsOn}) {
/for i 1 to ${PetBuffs.Size}
/if (${PetBuffs[${i}].Equal[Null]}) /goto :SkipPetBuff
DEBUG ${i} ${Me.PetBuff[${PetBuffs[${i}]}]} ${PetBuffs[${i}]}
/if (!${Me.PetBuff[${PetBuffs[${i}]}]}) {
/call CastWhat "${PetBuffs[${i}]}" ${Me.Pet.ID}
/delay 20
}
/if (${FindItem[=${PetBuffs[${i}]}].ID} && !${Me.PetBuff[${FindItem[${PetBuffs[${i}]}].Spell}]}) {
/call CastWhat "${PetBuffs[${i}]}" ${Me.Pet.ID}
}
:SkipPetBuff
/next i
}
/if (${Me.Pet.Height}<1) /varset PetShrunk 1
DEBUG Pet Height: ${Me.Pet.Height} PetShrunk: ${PetShrunk}
/if (!${PetShrunk} && ${PetShrinkOn}) {
/call CastWhat "${PetShrinkSpell}" ${Me.Pet.ID}
/varset PetShrunk 1
/delay 20
/squelch /target clear
}
}
DEBUG DoPetStuff: leave
/return
|----------------------------------------------------------------------------
| SUB: Check Plugin
|----------------------------------------------------------------------------
Sub CheckPlugin(string pluginname)
DEBUG CheckPlugin: enter
/if (!${Bool[${Plugin[${pluginname}]}]}) {
/squelch /plugin ${pluginname}
/echo ${pluginname} not detected! This macro requires it! Loading ...
}
DEBUG CheckPlugin: leave
/return
|----------------------------------------------------------------------------
| SUB: Load Ini
|----------------------------------------------------------------------------
Sub LoadIni(string sectionName, string varName, string varType, string varValue, string varArray, string FileName)
| DEBUG Sub Loadini ${sectionName} ${varName} ${varType} ${varValue} ${varArray}
/if (!${Defined[FileName]}) {
/declare FileName string local
/varset FileName ${IniFileName}
}
| /if (${Defined[FileName]}) /echo ${FileName}
/if (${${varArray}.Size}>0) {
/declare i int local
/for i 1 to ${${varArray}.Size}
/if (!${Ini[${FileName},${sectionName},${varArray}${i}].Length}) /ini "${FileName}" "${sectionName}" "${varArray}${i}" "${varValue}"
/if (${Ini[${FileName},${sectionName},${varArray}${i}].Length}) /varset ${varArray}[${i}] ${Ini[${FileName},${sectionName},${varArray}${i}]}
/next i
/return
} else {
/if (!${Defined[${varName}]} && ${Defined[varType]}) /declare ${varName} ${varType} outer
/if (!${Ini[${FileName},${sectionName},${varName}].Length}) {
/if (${varValue.Length}) {
/ini "${FileName}" "${sectionName}" "${varName}" "${varValue}"
/varset ${varName} ${varValue}
| DEBUG Sub Loadini /varset ${varName} ${varValue}
}
} else {
/varset ${varName} ${Ini[${FileName},${sectionName},${varName}]}
}
}
DEBUG LoadIni: leave
/return
|----------------------------------------------------------------------------
| SUB: End Mac If
|----------------------------------------------------------------------------
Sub EndMacroIf
/doevents
DEBUG EndMacroIf: Enter
/if (${GameState.Equal[CHARSELECT]}) /endmac
| I died wait for rez loop
:WaitOnRez
/if ((${Me.Hovering} || ${CampZone} != ${Zone.ID}) && ${RezAcceptOn}) {
/if (${Attacking}) /call CombatReset
/delay 10
/goto :WaitOnRez
}
/if (!${RezAcceptOn} && ${CampZone} != ${Zone.ID}) /endmac
DEBUG EndMacroIf: leave
/return
|----------------------------------------------------------------------------
| SUB: Do Bard Stuff
|----------------------------------------------------------------------------
Sub DoBardStuff
/if (${Me.Class.Name.NotEqual[Bard]}) /return
DEBUG DoBardStuff: Enter
/if (${MeleeTwistOn} && ${Attacking} && !${DPSTwisting}) {
/varset DPSTwisting 1
/varset Twisting 0
/squelch /twist ${MeleeTwistWhat}
/echo == Starting melee twist
}
/if (${TwistOn} && !${Attacking} && !${Twisting}) {
/varset DPSTwisting 0
/varset Twisting 1
/squelch /twist ${TwistWhat}
/echo == Starting normal twist
}
/if (!${TwistOn} && !${Attacking} && ${Twist}) /squelch /twist off
/delay 1
| - Mutant Bards do this
DEBUG DoBardStuff: leave
/return
|----------------------------------------------------------------------------
| SUB: Do Heal Stuff
|----------------------------------------------------------------------------
Sub DoHealStuff
/if (!${HealsOn} || ${Target.Type.Equal[corpse]} && !${AutoRezOn} || ${Me.Moving} || ${Window[RespawnWnd].Open}) /return
DEBUGHEAL DoHealStuff: Enter
/doevents
/declare i int local
/declare j int local
/declare CorpseID int local
/declare HealSpell string local
/declare HealPct string local
/declare HealFirst int local 0
/declare GroupHealth string local 1
/declare NotDead int local 0
/for j 1 to ${Heals.Size}
/if (${Heals[${j}].Equal[NULL]} || ${Heals[${j}].Arg[2,|].Equal[0]}) /goto :NextHeal
/varset HealSpell ${Heals[${j}].Arg[1,|]}
/varset HealPct ${Heals[${j}].Arg[2,|]}
/varset HealFirst 0
/if (${Heals[${j}].Arg[3,|].Find[MA]}) /varset HealFirst ${Spawn[${MainAssist}].ID}
| /if (${Me.CombatState.Equal[COOLDOWN]} && ${Select[${Spell[${HealSpell}].TargetType},Single,Self]}) /varset HealPct 98
/for i 0 to ${Group}
| Check for Main Assist heal priority
/if (${HealFirst} && ${Group.Member[${i}].ID}!=${HealFirst}) /goto :nextmember
| Check for player hovering or corpse and skip heal if true
/if (${Group.Member[${i}].Type.NotEqual[Mercenary]} && (${Group.Member[${i}].Hovering} || ${Spawn[${Group.Member[${i}]}].Type.Equal[Corpse]})) /goto :nextmember
DEBUGHEAL GM:${i} ${Group.Member[${i}]} Heal:${j} ${HealSpell} HealAt:${HealPct} HealTimer:Spell${j}GM${i} ${Spell${j}GM${i}}
| Check conditons for heals
/if ((${Select[${Spell[${HealSpell}].TargetType},Single,Self]} || ${Spell[${FindItem[${HealSpell}].Spell}].TargetType.Find[self]}) && ${Group.Member[${i}].PctHPs}<=${HealPct} && ${Group.Member[${i}].ID} && ${Group.Member[${i}].Distance}<=${Spell[${HealSpell}].MyRange} && ${Spell${j}GM${i}}==0 && ${HealPct}>=1) {
/if (${Me.Combat}) {
/attack off
/if (${AutoFireOn} && ${Me.AutoFire}) /autofire
/delay 20 !${Me.Combat}
}
/squelch /target id ${Group.Member[${i}].ID}
/delay 5
/if (${Target.ID}==${Group.Member[${i}].ID}) {
/delay 15 ${Cast.Ready[${HealSpell}]}
/call CastWhat "${HealSpell}" ${Group.Member[${i}].ID}
/delay 10
/if (${Macro.Return.Equal[CAST_SUCCESS]}) {
/echo -- ${HealSpell} on >> ${Group.Member[${i}].CleanName} <<
/if (${EQBC.Connected} && ${EQBCOn}) /docommand /bc [+o+]${HealSpell} on >> ${Group.Member[${i}].CleanName} <<[+x+]
/varcalc Spell${j}GM${i} (${Spell[${HealSpell}].Duration.TotalSeconds}*${DurationMod})*10
DEBUGHEAL Assign Timer:Spell${j}GM${i} (${Spell[${HealSpell}].Duration.TotalSeconds}*${DurationMod}) ${Spell${j}GM${i}}
/call CheckCasting
}
}
}
:nextmember
| Check if my pet needs healing
/if (${Heals[${j}].Arg[3,|].Find[PET]} && ${Group.Member[${i}].ID}==${Me.ID} && ${Me.Pet.PctHPs}<=${HealPct} && ${Me.Pet.ID} && ${Me.Pet.Distance}<${Spell[${HealSpell}].MyRange}) {
DEBUGHEAL PET (${Heals[${j}].Arg[3,|].Find[PET]} && ${Group.Member[${i}].ID}==${Me.ID} && ${Me.Pet.PctHPs}<=${HealPct} && ${Me.Pet.ID} && ${Me.Pet.Distance}<${Spell[${HealSpell}].MyRange})
/call CastWhat "${PetHealSpell}" ${Me.Pet.ID}
/if (${Macro.Return.Equal[CAST_SUCCESS]}) {
/echo -- ${HealSpell} on >> ${Me.Pet.CleanName} <<
/if (${EQBC.Connected} && ${EQBCOn}) /docommand /bc [+o+]${HealSpell} on >> ${Me.Pet.CleanName} <<[+x+]
/varcalc Spell${j}GM${i} (${Spell[${HealSpell}].Duration.TotalSeconds}*${DurationMod})*10
}
}
| Calculate total group health for group heal spells
/if (${Group.Member[${i}].ID} && ${Group.Member[${i}].Type.NotEqual[corpse]} && ${Group.Member[${i}].Distance}<100) {
DEBUGHEAL GM:${i} Health:${Group.Member[${i}].PctHPs}
/varcalc GroupHealth ${GroupHealth}+${Group.Member[${i}].PctHPs}
/varcalc NotDead ${NotDead}+1
}
| Check for group member corpses and rez
/if (${Group.Member[${i}].Type.Equal[corpse]} && ${AutoRezOn} && ${RezTimer${i}}==0 && ${i}>0) {
/if (${Group.Member[${i}].Type.Equal[corpse]} && ${Group.Member[${i}].Distance}<100) {
/tar pc ${Group.Member[${i}].CleanName}
/delay 5 ${Target.ID}
/if (${Target.Distance}<100) {
/if (${Target.Distance}>20) /corpse
/delay 10
/call CastWhat "${AutoRezWith}" ${Target.ID}
/delay 10s ${Cast.Status.Equal}
/if (${Macro.Return.Equal[CAST_SUCCESS]}) {
/echo REZZED =>> ${Group.Member[${i}]} <<=
/if (${EQBC.Connected} && ${EQBCOn}) /docommand /bc [+o+]REZZED =>> ${Group.Member[${i}]} <<=[+x+]
/varset RezTimer${i} 5m
} else {
/varset RezTimer${i} 1m
}
}
}
}
/next i
| Use Group Heals if total group health % below assigned group heal %
/if (!${Group} || ${Me.Hovering}) {
/varset GroupHealth 100
/varset NotDead 1
}
DEBUGHEAL Group Spell/Item:${Spell[${HealSpell}].TargetType.Find[group]}/${Spell[${FindItem[${HealSpell}].Spell}].TargetType.Find[group]}) Group Health {Math.Calc[${GroupHealth}/${NotDead}]} HealAt:${HealPct} Timer:${Spell${j}GM${i}}==0 On/Off:${HealPct}
/if (${Group} && (${Spell[${HealSpell}].TargetType.Find[group]} || ${Spell[${FindItem[${HealSpell}].Spell}].TargetType.Find[group]}) && ${Math.Calc[${GroupHealth}/${NotDead}]}<=${HealPct} && ${Spell${j}GM${i}}==0 && ${HealPct}>=1) {
/call CastWhat "${HealSpell}" ${Me.ID}
/delay 10s !${Me.Casting.ID}
/if (${Macro.Return.Equal[CAST_SUCCESS]}) {
/echo -- ${HealSpell} on >> Group <<
/if (${EQBC.Connected} && ${EQBCOn}) /docommand /bc [+o+]${HealSpell} on >> Group <<[+x+]
/varcalc SpellGH${i} (${Spell[${HealSpell}].Duration.TotalSeconds}*${DurationMod})*10
DEBUGHEAL Assign Timer:SpellGH${i} (${Spell[${HealSpell}].Duration}*${DurationMod}.TotalSeconds) ${SpellGH${i}}
}
}
:NextHeal
/delay 1
/next j
DEBUGHEAL DoHealStuff: Leave
/return
|-------------------------------------------------------------------------------------
| SUB: Loot Stuff
|-------------------------------------------------------------------------------------
Sub LootStuff
/if (!${LootOn}) /return
DEBUG LootStuff: Enter
/if (${Me.FreeInventory}==0) {
/echo Inventory is full. Looting OFF
/varset LootOn 0
}
/doevents
| Reset mdist for ninjadvloot
/squelch /moveto mdist 10
/call LootMobs
DEBUG LootStuff: Leave
/return
|-------------------------------------------------------------------------------------
| SUB: Do Mez Stuff
|-------------------------------------------------------------------------------------
Sub DoMezStuff
/if (!${MezOn} || ${Window[RespawnWnd].Open} || ${DMZ}) /return
/declare i int local
/call MobRadar ${MezRadius}
/for i 1 to 10
| Every Mez test conditon is listed seperately for clarity
| Test -> array not empty, target=array, above mez hps, within mez levels, line of sight, not a giant, immune list, already mez'd timer
/if (${AddsArray[${i},1].Equal[NULL]}) /goto :SkipMez
/if (${AddsArray[${i},1].Equal[${MyTargetID}]}) /goto :SkipMez
/if (${Spawn[${AddsArray[${i},1]}].PctHPs}<${MezStopHPs}) /goto :SkipMez
/if (${AddsArray[${i},2]}>${MezMaxLevel} || ${AddsArray[${i},2]}<${MezMinLevel}) /goto :SkipMez
/if (!${Spawn[${AddsArray[${i},1]}].LineOfSight}) /goto :SkipMez
/if (${Spawn[${AddsArray[${i},1]}].Body.Name.Equal[Giant]}) /goto :SkipMez
/if (${MezImmune.Find[${AddsArray[${i},3]}]}) {
/if (${MMTimer${i}}==0) /docommand /bc [+g+]MEZ Immune Detected -> ${AddsArray[${i},3]} <- ID:${AddsArray[${i},1]}[+x+]
/varset MMTimer${i} 1m
/goto :SkipMez
}
/if (${Me.CurrentMana}<${Spell[${MezSpell}].Mana}) /goto :SkipMez
/if (${MezTimer${i}} > 0) /goto :SkipMez
DEBUGMEZ MezTimer${i} ${MezTimer${i}} ${Spawn[${AddsArray[${i},1]}].ID} ${i}
/if (${Me.Combat}) {
/attack off
/delay 25 !${Melee.Combat}
}
/call MezMobs ${Spawn[${AddsArray[${i},1]}].ID} ${i}
:SkipMez
/next i
DEBUGMEZ DoMezStuff: Leave
/return
|-------------------------------------------------------------------------------------
| MobRadar
|-------------------------------------------------------------------------------------
Sub MobRadar(int CountRadius)
/if (${DMZ}) /return
DEBUG MobRadar ${CountRadius} Enter
/declare NMob string local
/declare i int local
/varset MobCount ${SpawnCount[npc targetable radius ${CountRadius} zradius 50]}
/for i 1 to ${MobCount}
/varset NMob ${NearestSpawn[${i},npc targetable radius ${CountRadius} zradius 50].ID}
/if (${i}>10) /goto :ArrayExceed
/if (${MobCount}>0 && ${Select[${NMob},${AddsArray[1,1]},${AddsArray[2,1]},${AddsArray[3,1]},${AddsArray[4,1]},${AddsArray[5,1]},${AddsArray[6,1]},${AddsArray[7,1]},${AddsArray[8,1]},${AddsArray[9,1]},${AddsArray[10,1]}]}==0) /call AddToArray ${NMob}
/if (${AddsArray[${i},1].NotEqual[NULL]} && ${Spawn[${AddsArray[${i},1]}].Type.Equal[Corpse]} || !${Spawn[${AddsArray[${i},1]}].ID}) /call RemoveFromArray ${i}
:ArrayExceed
/next i
DEBUG MobRadar leave
/return
|-------------------------------------------------------------------------------------
| SUB: Add to Array
|-------------------------------------------------------------------------------------
Sub AddToArray(int AddMobID)
/if (!${AddMobID}) /return
DEBUG AddToArray ${AddMobID} enter
/declare i int local
/for i 1 to 10
/if (${AddsArray[${i},1].Equal[NULL]}) {
/varset AddsArray[${i},1] ${Spawn[${AddMobID}].ID}
/varset AddsArray[${i},2] ${Spawn[${AddMobID}].Level}
/varset AddsArray[${i},3] ${Spawn[${AddMobID}].CleanName}
DEBUG ARRAY Assign >> ${AddsArray[${i},3]} << to AddsArray${i}.
/return
}
/next i
DEBUG AddToArray leave
/return
|-------------------------------------------------------------------------------------
| SUB: Remove From Array
|-------------------------------------------------------------------------------------
Sub RemoveFromArray(int ArNum)
/if (${AddsArray[${ArNum},1].Equal[NULL]}) /return
DEBUG RemoveFromArray ${ArNum} enter
DEBUG ARRAY Remove >> ${AddsArray[${ArNum},3]} << from AddsArray${ArNum}.
/varset AddsArray[${ArNum},1] NULL
/varset AddsArray[${ArNum},2] NULL
/varset AddsArray[${ArNum},3] NULL
/if (${MezOn}) {
/varset MezCount[${ArNum}] 0
/varset MezTimer${ArNum} 0
}
DEBUG RemoveFromArray leave
/return
|-------------------------------------------------------------------------------------
| SUB: Mez Mobs
|-------------------------------------------------------------------------------------
Sub MezMobs(int MobID, int TimerNum)
DEBUGMEZ MezMobs enter MobID:${MobID} Timer#:${TimerNum}
/declare MezFail int local 0
/squelch /target id ${MobID}
/varset MezImmuneID ${Target.ID}
/if (${Target.ID}==${MobID}) {
/if (${MezCount[${TimerNum}]}<1) /echo MEZZING-> ${Spawn[${MobID}].CleanName} <- ID:${MobID}
/if (${EQBC.Connected} && ${EQBCOn} && ${MezCount[${TimerNum}]}<1) /docommand /bc [+g+]MEZZING-> ${Spawn[${MobID}].CleanName} <- ID:${MobID}[+x+]
/if (${MezCount[${TimerNum}]}>=1) /echo ReMEZZING-> ${Spawn[${MobID}].CleanName} <- ID:${MobID}
/if (${EQBC.Connected} && ${EQBCOn} && ${MezCount[${TimerNum}]}>=1) /docommand /bc [+g+]ReMEZZING-> ${Spawn[${MobID}].CleanName} <- ID:${MobID}[+x+]
| Chanter mez code
:retrymez
/if (${Me.Class.Name.Equal[Enchanter]}) {
/delay 3s ${Cast.Ready[${MezSpell}]}
/call CastWhat "${MezSpell}" ${MobID}
/doevents
/delay 5s ${Cast.Status.Equal}
/varcalc MezFail ${MezFail}+1
/if (${Macro.Return.Equal[CAST_SUCCESS]}) {
/varcalc MezCount[${TimerNum}] ${MezCount[${TimerNum}]}+1
/varcalc MezTimer${TimerNum} (${Spell[${MezSpell}].Duration.TotalSeconds}*10)*.85
DEBUGMEZ MezTimer${TimerNum} ${MezTimer${TimerNum}}
}
/if (${Macro.Return.Equal[CAST_RESIST]} && ${MezFail}<2) {
/echo MEZ Resisted -> ${Spawn[${MobID}].CleanName} <- ID:${MobID}
/docommand /bc [+g+]MEZ Resisted -> ${Spawn[${MobID}].CleanName} <- ID:${MobID}[+x+]
/goto :retrymez
}
}
| Bard mez code
/if (${Me.Class.Name.Equal[Bard]}) {
/if (${Me.Combat}) {
/attack off
}
/delay 25 !${Melee.Combat}
/squelch /twist once ${Me.Gem[${MezSpell}]}
/doevents
/squelch /clear target
/delay 35
/varcalc MezCount[${TimerNum}] ${MezCount[${TimerNum}]}+1
/varset MezTimer${TimerNum} 120
}
}
DEBUGMEZ MezMobs leave
/return
|-------------------------------------------------------------------------------------
| SUB: Event MezBroke
|-------------------------------------------------------------------------------------
Sub Event_MezBroke(meztext,mezmob,mezbreaker)
DEBUGMEZ event mezbroke enter
/if (!${MezOn}) /return
/declare i int local
/echo => ${mezbreaker} <= has AWAKENED ${mezmob}.
/if (${EQBC.Connected} && ${EQBCOn}) /docommand /bc [+g+]>> ${mezbreaker} << has awakened -> ${mezmob}<-[+x+]
/if (${Spawn[mezbreaker].CleanName.NotEqual[${MainAssist}]}) {
/for i 1 to 10
/if (${AddsArray[${i},1].Equal[${Spawn[${mezmob}].ID}]}) {
/echo Resetting Mez Timer ${mezmob} ID:${Spawn[${mezmob}].ID}]}
| /varset MezCount[${i}] 0
/varset MezTimer${i} 0
}
/next i
}
DEBUGMEZ event mezbroke leave
/return
|-------------------------------------------------------------------------------------
| SUB: Event MezImmune
|-------------------------------------------------------------------------------------
Sub Event_MezImmune
/if (${Select[${Me.Class},Bard,Enchanter]}==0) /return
/declare ImmuneAdd string local ${MezImmune}
/if (${ImmuneAdd.Find[null]}) {
/varset ImmuneAdd ${Spawn[${MezImmuneID}].CleanName}
} else {
/varset ImmuneAdd ${ImmuneAdd},${Spawn[${MezImmuneID}].CleanName}
}
/if (!${MezImmune.Find[${Spawn[${MezImmuneID}].CleanName}]}) /ini "${InfoFileName}" "${Zone}" "MezImmune" "${ImmuneAdd}"
/echo MEZ Immune -> ${Spawn[${MezImmuneID}].CleanName} <- ID:${MezImmuneID} Adding to MezImmune list.
/docommand /bc [+g+]MEZ Immune -> ${Spawn[${MezImmuneID}].CleanName} <- ID:${MezImmuneID} Adding to MezImmune list.[+x+]
/varset MezImmune ${ImmuneAdd}
/return
|-------------------------------------------------------------------------------------
| SUB: DoMiscStuff
|-------------------------------------------------------------------------------------
Sub DoMiscStuff
DEBUG DoMiscStuff enter
| Accept trades
/if (${Window[TradeWnd].Open} && ${Window[TradeWnd].HisTradeReady} && !${Cursor.ID}) /notify TradeWnd TRDW_Trade_Button leftmouseup
| Accept group invite
/if (${Window[GroupWindow].Child[GW_FollowButton]} && ${AcceptInvitesOn}) /invite
DEBUG DoMiscStuff leave
/return
|-------------------------------------------------------------------------------------
| SUB: Event_ToggleVariable Check whenever the player is changing any variable via /echo
|-------------------------------------------------------------------------------------
Sub Event_ToggleVariable(string Line, string Command, string Command2)
/declare i int local
| Toggle Variables & Set Variables
/if (${Defined[${Command}]}) {
/declare OnOff local
/if (${Command2.NotEqual[NULL]}) {
/varset ${Command} ${Command2}
} else /if (${${Command}}) {
/varset ${Command} 0
/varset OnOff Off
/if (!${ChaseAssist} && ${Stick.Active}) /squelch /stick off
} else {
/varset ${Command} 1
/varset OnOff On
/if (${Command.Equal[ChaseAssist]}) {
/if (${ReturnToCamp}) /varset ReturnToCamp 0
}
| Turn on return to camp & set new y,x coord
/if (${Command.Equal[ReturnToCamp]}) {
/varset CampXLoc ${Me.X}
/varset CampYLoc ${Me.Y}
/varset LookForward ${Me.Heading.DegreesCCW}
| Turn off ChaseAssit if on
/if (${ChaseAssist}) {
/varset ChaseAssist 0
/squelch /stick off
/echo >> ChaseAssist Off
}
/echo >> New camp set ${Me.Y}, ${Me.X}
}
}
| /ini "${IniFileName}" "${sectionName}" "${varName}" "${varValue}"
/echo >> Set ${Command}: ${OnOff}
/return
}
/return
|-------------------------------------------------------------------------------------
| SUB: Can I do Stuff - Check if invis moving ducked etc
|-------------------------------------------------------------------------------------
Sub CanIDoStuff
DEBUG CanIDoStuff enter
:IAmBusy
/if (${MacroQuest.GameState.Equal[CHARSELECT]}) /end
/doevents
/call DoMiscStuff
/call EndMacroIf
/delay 2
/if (${Me.Moving} || ${Me.State.Equal[feign]} || (!${ChaseAssist} && !${AggroTargetID} && ${Me.Invis} && ${Me.Class.Name.NotEqual[Rogue]}) || ${Me.Stunned} || ${Me.Ducking} || ${Me.State.Equal[BIND]} ) /goto :IAmBusy
/if (${Window[MerchantWnd]} || ${Window[TradeWnd]} || ${Window[GiveWnd]} || ${Window[LootWnd]} || ${Window[SpellBookWnd]} || ${Window[BigBankWnd]} || ${Window[LootWnd]} || ${Window[BankWnd]} || ${Window[TributeMasterWnd]} || ${Window[GuildTributeMasterWnd]}) /goto :IAmBusy
DEBUG CanIDoStuff leave
/return
|-------------------------------------------------------------------------------------
| SUB: Mercs Do What
|-------------------------------------------------------------------------------------
Sub MercsDoWhat
DEBUG MercsDoWhat enter
/if (!${MercOn}) /return
/if (${Me.Mercenary.Equal[Active]}) /varset MercInGroup 1
| Revive the merc if dead and previously detected in group
/if (${MercInGroup} && ${Window[MMGW_ManageWnd].Child[MMGW_SuspendButton].Enabled} && ${Me.Mercenary.Equal[UNKNOWN]}) /notify MMGW_ManageWnd MMGW_SuspendButton LeftMouseUp
/if (${MercAssistAt}>=${Spawn[${MyTargetID}].PctHPs} && ${Me.Mercenary.Equal[Active]} && ${CombatStart} && !${MercAssisting}) {
/mercassist
DEBUGCOMBAT MERC ${Spawn[${MyTargetID}].CleanName} %:${Spawn[${MyTargetID}].PctHPs} ID:${Spawn[${MyTargetID}].ID}
/varset MercAssisting 1
}
DEBUG MercsDoWhat leave
/return
|-------------------------------------------------------------------------------------
| Check and set roles
|-------------------------------------------------------------------------------------
Sub CheckRoles
DEBUG CheckRoles enter
/if (${Role.Equal[tank]}) {
DEBUG Looks like I am Main Tank. Wish me luck.
/if (!${Defined[MainAssist]}) /varset MainAssist ${Me}
/squelch /melee aggro=1
/varset AssistAt 100
/varset StickHow front 12
}
/if (${Role.Equal[puller]}) {
DEBUGPULL role puller
DEBUGPULL Looks like I am Puller.
/varset ReturnToCamp 1
/varset CampRadiusExceed ${MaxRadius}
/if (${Pet.ID}) /pet guard
/call PullRange
}
/if (${Role.Equal[pullertank]}) {
DEBUGPULL role pullertank
DEBUGPULL Looks like I am Puller and Tank.
/varset MainAssist ${Me}
/squelch /melee aggro=1
/varset AssistAt 100
/varset StickHow front 12
/varset ReturnToCamp 1
/varset CampRadiusExceed ${MaxRadius}
/if (${Pet.ID}) /pet guard
/call PullRange
}
/if (${Select[${Role},hunter]}) {
DEBUGPULL role hunter
DEBUGPULL Looks like I am Hunting.
/varset MainAssist ${Me}
/squelch /melee aggro=1
/varset AssistAt 100
/varset StickHow front 12
/varset CampRadiusExceed ${MaxRadius}
/varset ReturnToCamp 0
/if (${Pet.ID}) /pet follow
/call PullRange
}
DEBUG CheckRoles leave
/return
|-------------------------------------------------------------------------------------
| SUB: PullRange
|-------------------------------------------------------------------------------------
Sub PullRange
DEBUGPULL PullRange enter
/if (${PullWith.Equal[Melee]}) /call PullVars 15 Melee 15
/if (${Me.CombatAbility[${PullWith}]} || ${Me.Book[${PullWith}]} || ${Me.AltAbility[${PullWith}]}) {
/if (${Select[${Role},puller,pullertank]}) /call PullVars ${Math.Calc[${Spell[${Spell[${PullWith}].ID}].Range}/1.25]} "${PullWith}" ${Spell[${Spell["${PullWith}"].ID}].Range}
/if (${Select[${Role},hunter]}) {
/call PullVars ${Math.Calc[${Spell[${Spell[${PullWith}].ID}].Range}/2.75]} "${PullWith}" ${Spell[${Spell["${PullWith}"].ID}].Range}
}
}
DEBUGPULL PullRange leave
/return
|-------------------------------------------------------------------------------------
| SUB: PullVars
|-------------------------------------------------------------------------------------
Sub PullVars(int pRange, pType, int pRange2)
DEBUGPULL PullVars enter
/varset PullRange ${pRange}
/varset PullWith ${pType}
/varset PullRangeActual ${pRange2}
DEBUGPULL PullVars leave
/return
|-------------------------------------------------------------------------------------
| SUB: FindMobToPull
|-------------------------------------------------------------------------------------
Sub FindMobToPull
/if (${AggroTargetID} || ${DMZ}) /return
/if (!${Select[${Role},puller,pullertank,hunter]}) /return
DEBUGPULL FindMobToPull enter
/doevents
/declare CurrentRadius int local
/varset Pulling 0
/echo Looking for Close Range Mobs
:FindMob
/doevents
/call CheckForAdds
/call GroupWatch
| Auto add any untargetable npc, aura etc to ignore alert list
/squelch /alert add 1 untargetable
/for CurrentRadius 0 to ${MaxRadius} step 10
| /echo ${CurrentRadius}
/squelch /target radius ${CurrentRadius} npc zradius ${MaxZRange} noalert 1
/if (${Target.ID}) {
/varset Pulling 1
/call ValidateTarget
DEBUGPULL Target: ${Target.CleanName} Valid: ${ValidTarget} NoValid ${Macro.Return}
/if (${ValidTarget}==0) {
/squelch /alert add 1 id ${Target.ID}
/squelch /target clear
/varset Pulling 0
/goto :FindMob
}
/echo PULLING-> ${Target.CleanName} <- ID:${Target.ID} at ${Int[${Target.Distance}]} feet.
/if (${EQBC.Connected} && ${EQBCOn}) /docommand /bc [+t+]PULLING-> ${Target.CleanName} <- ID:${Target.ID} at ${Int[${Target.Distance}]} feet.[+x+]
/varset MyTargetID ${Target.ID}
/varset MyTargetName ${Target.CleanName}
/varset Pulling 0
/call Pull
/return
}
/next CurrentRadius
/if (!${Target.ID}) {
/delay 5
/varcalc FailCounter ${FailCounter}+1
/echo No Valid Target in Range ${MaxRadius} - ${FailCounter} Time(s)
/call AlertClear
/if (${FailCounter}>=${FailMax}) {
/echo Waiting 30s for Respawns...
/moveto loc ${CampYLoc} ${CampXLoc} mdist 10
/varset FailCounter 0
/call PullDelay 30
/return
}
/goto :FindMob
}
DEBUGPULL FindMobToPull leave
/return
|-------------------------------------------------------------------------------------
| SUB: PullDelay
|-------------------------------------------------------------------------------------
Sub PullDelay(int TimerAmount)
DEBUG PullDelay ${TimerAmount} enter
/declare PDTimer timer local ${TimerAmount}s
/varset Pulling 0
:WaitForTimer
/doevents
/call CheckForAdds
/call DoWeMove
/delay 2
/if (${PDTimer}) /goto :WaitForTimer
DEBUG PullDelay leave
/return
|-------------------------------------------------------------------------------------
| SUB: GroupWatch
|-------------------------------------------------------------------------------------
Sub GroupWatch
/if (!${GroupWatchOn}) /return
DEBUG GroupWatch enter
/declare i int local
/declare GMType string local
/declare GMName string local
/declare GMClass string local
/declare GMStat string local
/if (!${Spawn[${MainAssist}].ID} && !${Select[${Role},tank,pullertank,hunter]}) {
/echo I am not detecting Main Assist pausing.
:WaitForMA
/doevents
/call CheckForAdds
/call CheckBuffs
/if (${Spawn[${MainAssist}].ID}) {
/echo Main Assist is back resuming action.
/return
}
/delay 5
/goto :WaitForMA
}
/for i 1 to 5
/if (!${Group.Member[${i}].ID}) /goto :SkipCheck
|** /if (${Group.Member[${i}].Type.Equal[corpse]}) {
/echo ${Group.Member[${i}].CleanName} is dead waiting.
/call PullDelay 300
/return
} **|
/varset GMType ${Group.Member[${i}].Type}
/varset GMName ${Group.Member[${i}].CleanName}
/varset GMClass ${Group.Member[${i}].Class.ShortName}
/if (${Select[${GMClass},BER,MNK,ROG,WAR]}) {
/varset GMStat Endurance
} else {
/varset GMStat Mana
}
DEBUG ${i} /call CheckStats 1 "${GMName}" "${GMClass}" "${GMType}" ${GMStat} 20 90
/call CheckStats 1 "${GMName}" "${GMClass}" "${GMType}" ${GMStat} 20 90
:SkipCheck
/next i
DEBUG GroupWatch leave
/return
|-------------------------------------------------------------------------------------
| SUB: CheckStats
|-------------------------------------------------------------------------------------
Sub CheckStats(int statcheck, charname, ckclass, cktype, stat, int pause,int resume)
/if (!${statcheck} || !${Spawn[${ckclass} ${cktype} ${charname}].ID} || ${Spawn[${ckclass} ${cktype} ${charname}].Current${stat}}>${pause}) /return
DEBUGPULL CheckStats enter
DEBUGPULL statcheck ${statcheck} charname ${charname} ckclass ${ckclass} stat ${stat} pause ${pause} resume ${resume}
/echo Waiting for ${charname} to med up to ${resume}% ${stat}.
/if (${EQBC.Connected} && ${EQBCOn} && ${Select[${Role},pullertank,hunter]}) /docommand /bc [+t+]Waiting for >> ${charname} << to med up to ${resume}% ${stat}.[+x+]
/varset Pulling 0
/if (!${Me.Mount.ID} && !${Me.Sitting}) /sit
:wait_for_resume
/doevents
/call CheckForAdds
/call CheckBuffs
/if (${Spawn[${ckclass} ${charname}].Current${stat}}<${resume}) /goto :wait_for_resume
/echo ${charname} is now above ${resume}% ${stat} resuming activity.
/if (${EQBC.Connected} && ${EQBCOn} && ${Select[${Role},pullertank,hunter]}) /docommand /bc [+t+]${charname} is now above ${resume}% ${stat} resuming activity.[+x+]
/if (!${Me.Mount.ID} && ${Me.Sitting}) /stand
DEBUGPULL CheckStats leave
/return
|-------------------------------------------------------------------------------------
| SUB: Pull
|-------------------------------------------------------------------------------------
Sub Pull
/if (!${Select[${Role},puller,pullertank,hunter]}) /return
DEBUGPULL Pull enter
/declare PullTimer timer local 300
/declare PullAttempts int local 0
/declare PullDist float local ${Math.Calc[${PullRange}/1.25]}
/varset Pulled 0
/declare AutoFireOff int local ${AutoFireOn}
DEBUGPULL PullDist: ${PullDist}
| Set autofire setting off during pulls if not using ranged item to pull
/if (${AutoFireOff}) /varset AutoFireOn 0
:PullAgain
| - Filter to prevent pulling until AA/Disc/Spell is ready.
/if (!${AggroTargetID} && ${Select[${PullWith},Melee,Range]}==0 && ${Select[TRUE,${Me.SpellReady[${PullWith}]},${Me.AltAbilityReady[${PullWith}]},${Me.CombatAbilityReady[${PullWith}]}]}==0) /goto :PullAgain
/varset PullAttempts 0
DEBUGPULL START PULL
/if (${Target.Distance}>${PullDist} && ${Math.Distance[${Spawn[${Target.ID}].Y},${Spawn[${Target.ID}].X}:${CampYLoc},${CampXLoc}]}) /moveto id ${Target.ID} mdist ${PullDist}
:WeThereYet
/doevents
| Pull counter used to in conjunction with 1s delay for timing
/varcalc PullAttempts ${PullAttempts}+1
| Exit pull and reset if timed out or wander to0 far from camp
/if (${PullTimer}==0 || ${Math.Distance[${CampYLoc},${CampXLoc}]} > ${Math.Calc[${MaxRadius}/1.1]}) {
/call ResetPull
/goto :DonePulling
}
| Make range smaller to creep closer to mob if los or moving
/varcalc PullDist ${PullDist}/1.1
| Try and pull again after 7 seconds or 3 seconds if target is moving
/if (${PullAttempts}>7 || ${PullAttempts}>3 && ${Target.Speed}>25) /goto :PullAgain
| 1s timer used in conjunction with PullAttempts to control pulling
/delay 10
DEBUGPULL ${PullAttempts}
| If random aggro while pulling, stop and return to camp
/if (${AggroTargetID}) /goto :DonePulling
| Distance loop check until mob in range to pull
/if (${Target.Distance}>${PullRange}) /goto :WeThereYet
| If mob move out of line of sight during pul try moveto mob again
/if (!${Target.LineOfSight} && !${Select[${Role},hunter]}) /goto :PullAgain
/if (${Target.ID} && ${Target.Distance}<${PullRangeActual}) {
| Handle pulling with Melee setting
/if (${PullWith.Equal[Melee]}) {
DEBUGPULL Attacking
| Turn off mq2melee function so pullertank doesn't attack mob on pull
/if (${Select[${Role},pullertank]}) /squelch /melee melee=0
:AttackAgain
/face fast
/attack on
/delay 5
/if (${AggroTargetID} && ${Target.PctHPs}==100) /goto :AttackAgain
| Turn off combat so puller returns to camp
/if (${Select[${Role},puller,pullertank]}) {
:StopCombat
/attack off
/stick off
| Cycle until combat off and mob is aggro'd
/if (${Me.Combat} && (${AggroTargetID} || ${Target.PctHPs}<100)) /goto :StopCombat
/squelch /target clear
| Turn on mq2melee function back on after pull
/if (${Select[${Role},pullertank]}) /squelch /melee melee=1
}
/varset Pulled 1
} else {
/call CastWhat "${PullWith}" ${Target.ID}
/if (${Macro.Return.Equal[CAST_SUCCESS]}) /varset Pulled 1
/delay 1s ${AggroTargetID}
}
}
| If pull failed start over while timer > 0
/if (!${Pulled}) /goto :PullAgain
:DonePulling
DEBUGPULL Done Pulling
/if (${ReturnToCamp}) /call DoWeMove
DEBUGPULL Return To Camp
| Turn autofire back on
/if (${AutoFireOff}) {
DEBUGPULL AutoFire on
/varset AutoFireOff 0
/varset AutoFireOn 1
}
/if (${Pulled}) {
/if (!${Select[${Role},hunter]}) {
DEBUGPULL Wait For Mob
| Additonal check mq2melee is back on
/if (${Select[${Role},pullertank]}) /squelch /melee melee=1
:WaitForMob
/if (${Target.ID} && ${MoveTo.Stopped}) /timed 15 /face nolook fast
/doevents
/call CheckForAdds
/delay 1
| Assist main tank on inc
/if (${Select[${Role},puller]}) /call Assist
| if target lost somehow add to ignore list and continue pulls
/if (!${AggroTargetID}) {
/squelch /alert add 1 id ${Target.ID}
/return
}
/if (${Target.PctHPs}>=${AssistAt} || ${Target.Distance}>=${CampRadius}) /goto :WaitForMob
}
/if (${Target.ID}) /face nolook fast
/call Combat
}
DEBUGPULL Pull leave
/return
|-------------------------------------------------------------------------------------
| SUB: Reset Pull variables
|-------------------------------------------------------------------------------------
Sub ResetPull
DEBUGPULL ResetPull enter
/doevents
/varset Pulled 0
/attack off
/moveto off
/squelch /target clear
/squelch /alert clear 1
DEBUGPULL ResetPull leave
/return
|-------------------------------------------------------------------------------------
| SUB: alert clear
|-------------------------------------------------------------------------------------
Sub AlertClear
DEBUGPULL AlertClear
DEBUGPULL Clearing Alert list.
/squelch /alert clear 1
DEBUGPULL leave AlertClear
/return
|-------------------------------------------------------------------------------------
| SUB: Event CantSee
|-------------------------------------------------------------------------------------
Sub Event_CantSee
DEBUGPULL Event_CantSee
| Reset position via stick
/if (${Attacking}) {
DEBUGPULL Can't See my target. Moving Closer.
/if (${Me.Sitting}) /stand
/squelch /face fast
/if (${StickHow.NotEqual[0]}) {
/stick ${StickHow} id ${MyTargetID}
} else /stick 15 !front id ${MyTargetID}
}
DEBUGPULL leave Event_CantSee
/return
|----------------------------------------------------------------------------
| SUB: Event GotHit
|----------------------------------------------------------------------------
Sub Event_GotHit
/if (${AggroTargetID} && !${Target.ID} && !${ReturnToCamp}) {
/call CheckForAdds
}
/return
|----------------------------------------------------------------------------
| SUB: Event Zoned
|----------------------------------------------------------------------------
Sub Event_Zoned
/echo Just zoned
/varset LastZone ${Zone.ID}
| Shut down combat and mez in GH, GL, PoK, PoT, and Abysmal
/if (${Select[${Zone.ID},345,344,202,203,279]}) {
/varset DMZ 1
} else /varset DMZ 0
/varset ReturnToCamp 0
/varset JustZoned 1
/return
Sub Event_TooClose
/call CheckForAdds
/if (${MyTargetID} && ${AutoFireOn}) {
/varset AutoFireOn 0
/killthis
/timed 300 /varset AutoFireOn 1
}
/return
Sub Event_TooFar
/if (${Target.Distance}<${MeleeDitance} && ${MeleeOn}) /squelch /stick ${StickHow}
/return
Sub Event_TaskUpdate(Line,name)
/if (${EQBC.Connected} && ${EQBCOn}) /docommand /bc [+t+]Task updated...(${name})[+x+]
/return
Sub Event_GainSomething(string Line,string text)
/if (!${EQBC.Connected} || !${EQBCOn}) /return
/if (${Line.Find["ABILITY POINT!"]}) {
/docommand /bc [+w+]${Me.Name} gained an AA, now has ${Me.AAPoints} unspent[+x+]
} else /if (${Line.Find[LEVEL]}) {
/docommand /bc [+w+]${Me.Name} gained a level, now is Level ${Me.Level}[+x+]
} else /if (${Line.Find[GROUP LEADERSHIP]}) {
/docommand /bc} [+w+]${Me.Name} gained group leadership, now has ${Me.GroupLeaderPoints} unspent[+x+]
}
/return
|----------------------------------------------------------------------------
| SUB: AFK Tools
|----------------------------------------------------------------------------
Sub AFKTools
DEBUG AFKTools enter
/if (!${AFKToolsOn} || ${CampZone}!=${Zone.ID}) /return
/varset PCsDetected 0
/declare i int local
:PCsGoAway
/doevents
/call CheckForAdds
/delay 10
/if (${Spawn[gm].ID}) {
/echo GM DETECTED
/if (${EQBC.Connected} && ${EQBCOn}) /docommand /bc [+r+]** GM DETECTED **[+x+]
/docommand ${AFKGMAction}
}
/if (${Math.Distance[${CampYLoc},${CampXLoc}]} < ${CampRadius} && ${SpawnCount[PC Radius ${AFKPCRadius} zradius 100]}>${SpawnCount[PC group]} && ${Group}) {
/if (!${PCsDetected}) {
/echo **PCS DETECTED IN CAMP RADIUS**
/if (${EQBC.Connected} && ${EQBCOn}) /docommand /bc [+r+]**PCS DETECTED IN CAMP RADIUS**[+x+]
/for i 1 to ${SpawnCount[PC Radius ${AFKPCRadius} zradius 100]}
/echo **${NearestSpawn[${i},PC Radius ${AFKPCRadius} zradius 100].CleanName}**
/if (${EQBC.Connected} && ${EQBCOn}) /docommand /bc [+r+]**${NearestSpawn[${i},PC Radius ${AFKPCRadius} zradius 100].CleanName}**[+x+]
/next i
/beep
/delay 2
/beep
/delay 2
/beep
/varset PCsDetected 1
/timed 3000 /varset PCsDetected 0
}
/delay 5s
/goto :PCsGoAway
}
DEBUG AFKTools leave
/return
|----------------------------------------------------------------------------
| SUB: Burn Section
|----------------------------------------------------------------------------
Sub Event_Burn
/declare i int local
/echo BURN ACTIVATED => Autobots Transform <=
/if (${EQBC.Connected} && ${EQBCOn}) /docommand /bc [+r+]BURN ACTIVATED => Autobots Transform <=[+x+]
/for i 1 to ${Burn.Size}
/delay 10 ${Cast.Ready[${Burn[${i}]}]}
/if (${Burn[${i}].NotEqual[null]}) /call CastWhat "${Burn[${i}]}"
/next i
/return
View attachment 4697
If you like KissAssist and would like to help keep up my enthusiasm
for adding/updating features, Please consider donating. Thanks
Ninjadvloot.ini is included with NA Official Compile or get it here
Last edited:


.
