AFK Cleric

Post your completed (working) macros here. Only for macros using MQ2Data syntax!

Moderator: MacroQuest Developers

Digitalxero
a ghoul
a ghoul
Posts: 129
Joined: Tue Sep 10, 2002 5:01 pm

AFK Cleric

Post by Digitalxero » Tue May 04, 2004 1:33 am

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

Micro
a lesser mummy
a lesser mummy
Posts: 40
Joined: Fri Mar 12, 2004 5:56 pm

Post by Micro » Tue May 04, 2004 12:49 pm

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 :)

Micro
a lesser mummy
a lesser mummy
Posts: 40
Joined: Fri Mar 12, 2004 5:56 pm

Post by Micro » Tue May 04, 2004 2:01 pm

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


magictiger
a snow griffon
a snow griffon
Posts: 450
Joined: Sun Mar 21, 2004 2:24 pm

Post by magictiger » Tue May 04, 2004 3:17 pm

/echo your petition has been deleted, we dont care.
Good times!

Seariz
a lesser mummy
a lesser mummy
Posts: 52
Joined: Thu Feb 06, 2003 1:22 pm
Location: The Computer
Contact:

Micro

Post by Seariz » Thu May 27, 2004 9:58 pm

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.
Every work group has one sadistic nut who makes the job unbearable for everyone else. That's why they hired me!

User avatar
fearless
Not a Psychic
Posts: 2684
Joined: Wed Mar 10, 2004 3:52 pm

Post by fearless » Thu May 27, 2004 10:33 pm

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!

User avatar
ieatacid
Developer
Developer
Posts: 2727
Joined: Wed Sep 03, 2003 7:44 pm

Post by ieatacid » Thu May 27, 2004 11:20 pm

Yeah that avatar blows :?

User avatar
Stults
a lesser mummy
a lesser mummy
Posts: 52
Joined: Tue May 25, 2004 11:47 pm

Re:

Post by Stults » Thu May 27, 2004 11:25 pm

That avatar has to go :evil:

wassup
Official Guardian and Writer of TFM
Official Guardian and Writer of TFM
Posts: 1487
Joined: Sat Oct 26, 2002 5:15 pm

Re: Micro

Post by wassup » Fri May 28, 2004 12:52 am

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.

Azum
a hill giant
a hill giant
Posts: 229
Joined: Wed Jun 04, 2003 5:04 am

Post by Azum » Fri May 28, 2004 12:54 am

Code: Select all

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

Seariz
a lesser mummy
a lesser mummy
Posts: 52
Joined: Thu Feb 06, 2003 1:22 pm
Location: The Computer
Contact:

Post by Seariz » Fri May 28, 2004 12:59 am

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? =)
Every work group has one sadistic nut who makes the job unbearable for everyone else. That's why they hired me!

rheally
decaying skeleton
decaying skeleton
Posts: 7
Joined: Sat May 29, 2004 4:05 am

Post by rheally » Sat May 29, 2004 2:14 pm

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!

bzt
a lesser mummy
a lesser mummy
Posts: 77
Joined: Fri Oct 10, 2003 3:39 pm

Post by bzt » Sat Jun 12, 2004 9:29 pm

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.

fantum409
a ghoul
a ghoul
Posts: 141
Joined: Fri Nov 14, 2003 10:03 pm

Post by fantum409 » Sat Jun 12, 2004 10:03 pm

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.

bzt
a lesser mummy
a lesser mummy
Posts: 77
Joined: Fri Oct 10, 2003 3:39 pm

Post by bzt » Fri Jun 18, 2004 10:44 am

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.