Moderator: MacroQuest Developers
Code: Select all
/if ((${autohealmode}>=1)&&(${Me.PctHPs}<=${selfhealpoint})) /call Healself
/if (${autohealmode}>=2) {
/if ((${Target.PctHPs}>${healpct})||(${Target.Distance}>${healspellrange})||(${Target.PctHPs}<=1)||(!${Target.ID})||(${Target.ID}!=${tanknameid})) {
/call Healgroup
}
}
/if ((${autohealmode}<2)&&(${Me.PctHPs}>${selfhealpoint})&&(${Me.PctMana}<=98)) /call MedTime
/call CheckEvents
/goto :tankwatchloop
}
/if (${Spawn[${Target.ID}].PctHPs}<${Math.Calc[0.5]*} && ${castEndTime}>37) {
/call Interrupt
/if (${Target.ID}==${TankID}) /call CastSpell "${LightMsg}" "${TankHS}" spell CheckHP
/return
Sub Healself
/if (${Me.PctHPs}>${selfhealpoint}) /return
/varset stophealpoint ${Math.Calc[${selfhealpoint}+5]}
/if ((!${Target.ID})||(${Target.PctHPs}>=${Math.Calc[1.1*${healpct}]})||(${Target.PctHPs}<=1)||(${Target.ID}!=${tanknameid})) {
/if ((${Me.PctHPs}<=${selfhealpoint})&&(${Me.PctHPs}>${dacastpoint})) {
/target myself
/delay 6 ${Target.Name.Equal[${Me}]}
/if (${Target.Name.Equal[${Me}]}) {
/if (${announce}==1) /g Casting ${patchheal} on %T
/call Cast "${patchheal}" gem2 1s CheckHP
/delay 15 ${Me.SpellReady[${patchheal}]}
}
}Code: Select all
Sub CheckHP
/if (${Spawn[${TankID}].PctHPs}<${Math.Calc[${MTHP}*0.5]} && ${castEndTime}>37) {
/call Interrupt
/if (${Target.ID}==${TankID}) /call CastSpell "${LightMsg}" "${TankHS}" spell CheckHP
/return
}
/if (!${Window[CastingWindow].Open}) /return
/if ((${autointerrupt}>=1)&&(${Target.PctHPs}>=${stophealpoint})) {
/if ((${announce}==1)&&(${duckspam}==1)) {
/g Ducking heal on %T
/e Ducking heal on ${Target.Name}
/varset duckspam 0
/timed 60 /varset duckspam 1 
Careful with using ${Spawn[whatever]}. If you want to know the HP of any entity that isnt in your group, you have to target it. Otherwise, your client will think it still has same HP as last time it was targeted, default full health. The client just isnt sent that kind of data otherwise. Probably in your example ${Spawn[whatever]} does happen to be targeted, so client would be giving accurate result of ${Spawn[whatever].PctHPs}. Personally, I like to talk about HP in terms of ${Target.PctHPs} or ${Group[${n}].PctHPs} for that reason. That looks like a really good idea though. How aboutA_Druid_00 wrote:I don't think anyone posted that here. Neolesh did post code similar to that in my Raid Druid thread though.You'll have to change the name of the variables to match whatever it is AFCleric uses, but it'd fit in here.Code: Select all
/if (${Spawn[${TankID}].PctHPs}<${Math.Calc[${MTHP}*0.5]} && ${castEndTime}>37) { /call Interrupt /if (${Target.ID}==${TankID}) /call CastSpell "${LightMsg}" "${TankHS}" spell CheckHP /return }
Code: Select all
/if ((${autointerrupt}==1)&&(${String[${Me.Casting}].Equal[Complete Healing]})) /if (${Target.PctHPs}<=${Math.Calc[${tankhealpoint}*0.5]})&&(${castEndTime}>${Math.Calc[${Math.Calc[${Spell[${patchheal}].MyCastTime}*10]}+5]})) {
/call Interupt
/return
}In most macs, I fully agree with you. But, since your mac has the tank targetted at ALL times, it's sort of a non issue. It's also in the CheckHP Sub, which implies that the target is your heal target. But yeah, I wouldn't use that type of logic in most subs.fantum409 wrote:Careful with using ${Spawn[whatever]}. If you want to know the HP of any entity that isnt in your group, you have to target it. Otherwise, your client will think it still has same HP as last time it was targeted, default full health. The client just isnt sent that kind of data otherwise. Probably in your example ${Spawn[whatever]} does happen to be targeted, so client would be giving accurate result of ${Spawn[whatever].PctHPs}.
I had the same issue with spell routines wanting to dismount me after successful heals. I ended up usingIncidentally, the line about !${Window[blahblah being open or else /return is a solution to a problem where checkhp was getting called by spell_routines.inc even after the spell had already landed, causing cleric to kill a horse when no need for it. Might have been from a problem with ${Me.Casting}, never tested/read spell_routines enough to know...
I havent tested this, but should be ok =) /cringes
Code: Select all
!${Me.Casting.ID}
Try putting both the AFCleric.mac and Spell_Routines.inc in the "MQ2"/Release/Macros FolderMystic_Blue wrote:I have placed that file in the /afkcleric folder, no joy.