Page 1 of 2

AFK Cleric

Posted: Tue May 04, 2004 1:33 am
by Digitalxero
This is so if you have to go AFK for a sec you will still keep your group healed, this is not intended to let you bot your cleric or anything

Code: Select all

|New AFK Cleric Macro
|afkcleric.mac
|Author: Digitalxero
|Usage: /macro afkcleric.mac <sit> <heal percent>
|Example: /macro afkcleric.mac 1 60

#event MeHit " hits YOU for "
#event OutOfMana "Insufficient Mana to cast this spell!"
#event OutOfRange "Your target is out of range, get closer!"
#event Fizzle "Your spell fizzles!"


Sub Main
/declare Healpct int outer ${Param1}
/declare Fastheal string outer Supernal Light
/declare Groupnum int outer
/declare i int outer
/declare Sit int outer ${Param0}
/declare Delay int outer
/declare Casting string outer

:chkevent
   /doevents
   /varset Groupnum ${Group}
   | *** AutoHeal ***
:Healcheck
   /for i 1 to ${Group}
      /if (${Group[${i}].PctHPs}<=${Healpct}) {
              /if (${Group[${i}].PctHPs}<1) /goto :nextmember
              /if (${Group[${i}].Class.Name.Equal["Warrior"]}) /goto :Tankheal
              /if (${Group[${i}].Class.Name.Equal["Paladin"]}) /goto :Tankheal
              /if (${Group[${i}].Class.Name.Equal["Shadow Knight"]}) /goto :Tankheal
              /if (${Group[${i}].Class.Name.Equal["Monk"]}) /goto :Tankheal
         /doevents
         /goto :CasterHeal

:Tankheal
         /if (!${Buff[Divine Barrier].ID}) {
             /target ${Group[${i}].Name}
             /stand
             /g CH on %t!
             /varset Casting Complete Healing
             /cast "Complete Healing"
             /doevents
             /varset Delay ${Math.Calc[${Spell[Complete Healing].MyCastTime}*10+10]}
             /delay ${Delay}
             /if (${Sit}==1) /sit
             /goto :nextmember
         }

:Casterheal
         /if (!${Buff[Divine Barrier].ID}) {
             /target ${Group[${i}].Name}
             /stand
             /g Fast Heal on %t!
             /varset Delay ${Math.Calc[${Spell[${Fastheal}].MyCastTime}*10+25]}
             /varset Casting ${Fastheal}
             /cast "${Fastheal}"
             /doevents
             /delay ${Delay}
             /if (${Sit}==1) /sit
         }
:nextmember
      }
   /next i
   /goto :chkevent
/return

Sub Event_MeHit
    /if (${Me.PctHPs}<=60 AND ${Me.PctHPs}>40) {
        /if (!${Buff[Divine Barrier].ID}) {
            /if (!${Me.Buff[Supernal Elixir].ID}) {
                /target myself
                /stand
                /g Elixir %t!
                /varset Casting Supernal Elixir
                /cast "Supernal Elixir"
                /doevents
                /varset Delay ${Math.Calc[${Spell[Supernal Elixir].MyCastTime}*10+5]}
                /delay ${Delay}
            }
        }
    } else /if (${Me.PctHPs}<=40 AND ${Me.PctHPs}>25) {
        /if (!${Buff[Divine Barrier].ID}) {
            /target myself
            /stand
            /g Fast Heal on %t!
            /varset Delay ${Math.Calc[${Spell[${Fastheal}].MyCastTime}*10+25]}
            /varset Casting ${Fastheal}
            /cast "${Fastheal}"
            /doevents
            /delay ${Delay}
        }
    } else {
        /stand
        /if (!${Buff[Divine Barrier].ID}) {
            /varset Casting Divine Barrier
            /cast "Divine Barrier"
            /doevents
            /varset Delay ${Math.Calc[${Spell[Divine Barrier].MyCastTime}*10+5]}
            /delay ${Delay}
            /if (${Buff[Divine Barrier].ID}) /g DBed! NO HEALS for 18 Sec
        }
    }
/return

Sub Event_Fizzle
    /goto :Healcheck
/return

Sub Event_OutOfMana
    /g OOM, meding
    /if (${Sit}==1) /sit
    /delay 5s
/return

Sub Event_OutOfRange
    /g %t your OOR!
    /delay 1s
/return

Sub Event_Fizzle
    /cast "${Casting}"
/return

Posted: Tue May 04, 2004 12:49 pm
by Micro

Code: Select all

/if (${Group[${i}].PctHPs}<1) /goto :nextmember
I just had to giggle when I saw this. I dunno why its so funny but I'm tickled :)

Posted: Tue May 04, 2004 2:01 pm
by Micro
Here is my take on the above code, I have removed the redundant routines, removed the /doevents from the events and other places it shouldnt be, and reversed the input of params to allow someone to just enter the percent and skip the second var.

I'm going to expand on this later to help it deal with pulling situations and an unslowed mob.

Code: Select all

|Cleric Macro 2 based on AFK Cleric
|Usage: /macro cleric2 <heal percent> <sit>
|Example: /macro cleric2 60 1

#event MeHit " hits YOU for "
#event OutOfMana "Insufficient Mana to cast this spell!"
#event OutOfRange "Your target is out of range, get closer!"
#event Fizzle "Your spell fizzles!"


Sub Main(int p1,int p2)
   /declare Healpct int outer ${p1}
   /declare Sit int outer ${p2}

   /declare Fastheal string outer Supernal Remedy
   /declare Fullheal string outer Complete Healing
   /declare HealOverTime string outer Supernal Elixir
   /declare SaveMyAss string outer Divine Barrier
   /declare i int outer
   /declare Delay int outer
   /declare FizzleSpell string outer

:Healcheck
   /doevents
   /delay 1
   /if (${Me.ManaPct}<10) /goto :Healcheck
   /for i 1 to ${Group}
      /if (!${Buff[Divine Barrier].ID} && ${Group[${i}].PctHPs}<=${Healpct}) {
              /if (${Group[${i}].PctHPs}<1) /goto :SkipHeal
              /if (${Group[${i}].Class.Name.Equal["Warrior"]} || ${Group[${i}].Class.Name.Equal["Paladin"]} || ${Group[${i}].Class.Name.Equal["Shadow Knight"]} || ${Group[${i}].Class.Name.Equal["Monk"]} ) {
                   /call DoHeal(${i},${Fullheal})
                   } else {
                   /call DoHeal(${i},${Fastheal})
                   }
      }
:SkipHeal
   /next i
   /goto :Healcheck
/return

sub DoHeal(int membernum,string spellname)
   if (${membernum}>=1) /target ${Group[${membernum}].Name}
   if (${membernum}==0) /target myself
   /stand
   /g Casting ${spellname} on %t
   /cast "${spellname}"
   /varset FizzleSpell ${spellname}
   /varset Delay ${Math.Calc[${Spell[${Fullheal}].MyCastTime}*10+25]}
   /delay ${Delay}
   /if (${Sit}==1) /sit
/return

Sub Event_MeHit
   /if (${Buff[${SaveMyAss}].ID}) {
      /echo How the heck did I get hit when I have ${SaveMyAss}?!
      /call Fuck_you_SOE
      /return
      }

    /if (${Me.PctHPs}<=70 AND ${Me.PctHPs}>50 && !${Me.Buff[${HealOverTime}].ID}) /call DoHeal(0,${HealOverTime})
    /if (${Me.PctHPs}<=50 AND ${Me.PctHPs}>25) /call DoHeal(0,${Fastheal})
    /if (${Me.PctHPs}<=25 AND ${Me.PctHPs}>0)  /call DoHeal(0,${SaveMyAss})
/return

sub Fuck_you_SOE
   /echo your petition has been deleted, we dont care.
/return

Sub Event_Fizzle
    /cast "${FizzleSpell}"
    /varset Delay ${Math.Calc[${Spell[${FizzleSpell}].MyCastTime}*10+25]}
    /delay ${Delay}
/return

Sub Event_OutOfMana
    /g OOM, meding
    /if (${Sit}==1) /sit
    /delay 5s
/return

Sub Event_OutOfRange
    |/g %t your OOR!
    /delay 1s
/return


Posted: Tue May 04, 2004 3:17 pm
by magictiger
/echo your petition has been deleted, we dont care.
Good times!

Micro

Posted: Thu May 27, 2004 9:58 pm
by Seariz
Ok, I’m quite a newbie at macros and I am getting this problem with Micro's copy of the macro.
No such 'character' member 'ManaPct'
Cleric.mac@26 (main(int p1, int p2)): /if (${Me.ManaPct}<10 /goto :Healcheck

I’m guessing it’s the other way around, PctMana? But not sure...any help would be much appreciated! Thank you.

Posted: Thu May 27, 2004 10:33 pm
by fearless
WTF Seariz . . . Last time I checked, 1/4 width of my screen is a bit LARGE.

You are negatively impacting the copy / pastablity of the macro's! The trolls will revolt! Fix it quick!

Posted: Thu May 27, 2004 11:20 pm
by ieatacid
Yeah that avatar blows :?

Re:

Posted: Thu May 27, 2004 11:25 pm
by Stults
That avatar has to go :evil:

Re: Micro

Posted: Fri May 28, 2004 12:52 am
by wassup
Seariz wrote:Ok, I’m quite a newbie at macros and I am getting this problem with Micro's copy of the macro.
No such 'character' member 'ManaPct'
Cleric.mac@26 (main(int p1, int p2)): /if (${Me.ManaPct}<10 /goto :Healcheck

I’m guessing it’s the other way around, PctMana? But not sure...any help would be much appreciated! Thank you.
Try looking at the statement again... you are missing something.

Oh, and ditch that stupid sig.

Posted: Fri May 28, 2004 12:54 am
by Azum

Code: Select all

/if (${Me.PctMana}<10)

Posted: Fri May 28, 2004 12:59 am
by Seariz
Thanks for the help and the wonderful compliments on my sig I didn’t even remember I had lol, who wants to volunteer to find me a cool one? =)

Posted: Sat May 29, 2004 2:14 pm
by rheally
I get an error saying it cant cast the heal spell. I do a /cast "supernal remedy" and it works. BUt inside of the macro it cannot cast the spell!

Posted: Sat Jun 12, 2004 9:29 pm
by bzt
im having an issue with pet classes..if a pet class has the pet summoned, it wont heal the owner, it always targets the pet. The pet will be FH, and the owner about dead, and its spamming heals to the pet. I retarget, and it goes right back to the pet.

Posted: Sat Jun 12, 2004 10:03 pm
by fantum409
the problem is:

Code: Select all

/target Tankname
will target the closest entity with that name. In the case of beastlords, for example, the pet is Tankname's warder. if warder is closer than player, the warder is targeted every time.

Fortunately, the /target command can be filtered. try this:

Code: Select all

/target pc Tankname
With that, you can edit the macro above so it wont bug out on pets... but be advised the logic in this macro doesn't prioritize heals. It will look through the group in numerical order and the first name it comes to that qualifies for any kind of heal gets it, even if the next person needs it more. For example: all players in a 6 person group are full health, then person 3 takes dmg. 3 is targeted right away and healed, then the macro checks 4,5,6 then starts again at 1, 2, etc. If during the time 3 is being casted on, person four takes a little dmg but 5,6,1, or 2 take worse dmg they have to wait for 4 to get his heal because he is next in line, even if 4 has only minor injury and 5,6,1,2 have major injury.

Posted: Fri Jun 18, 2004 10:44 am
by bzt
love this macro.. The other afkcleric one LOCKS you in on a person. Say you are in a group and you need to rebuff virtue on a person who got dispelled, and that person isnt your MT..with this macro I can just target them and cast. With the other one I have to stop the macro, buff them, and then restart the macro.


Great job here!

edit: not that im putting down the other afkcleric macro, it works fine, just not for me.