Rot.mac Ver 1.0 - Smart CH rotation macro

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

Moderator: MacroQuest Developers

Draimen
a lesser mummy
a lesser mummy
Posts: 69
Joined: Sun Jan 25, 2004 3:13 pm

Rot.mac Ver 1.0 - Smart CH rotation macro

Post by Draimen » Fri Jul 30, 2004 12:59 am

First off. This macro was made for bot clerics so if would be easier for them to be put in rotations. The macro works for CH rots that use the following format:

/1 CH to Target, Bobdole is next in (20)
/pause 3, /cast 1
/pause 17, /cast 1
/1 Go Bobdole

So if your guild uses some other way to do CH rot then this macro is not for you. You could also use it if your guild doesn't use the /pause function and your clerics count in their heads, the macro will count for you.

This macro was not meant for every cleric to use or to simply go afk in the middle of a fight.

OK, here is how this works.
/macro rot delay cleric1 cleric2 cleric3 tank1 tank2 tank3
The macro sets up the CH rot and the tank order in the order you type them in. You can type in the orders like the following:
cleric1 tank1 cleric2
or
tank1 tank2 cleric1
However, the order of the clerics and tanks is what determines the order of the rot. Meaning,
/macro rot 20 cleric1 cleric2 cleric3 tank1 tank2
Would make the rot: Cleric1 Cleric2 Cleric3 - Delay 20 - Tanks: Tank1 Tank2
/macro rot 20 cleric1 tank1 cleric2 cleric3 tank2
Will do the same thing.

The delay MUST come 1st.

The macro will check the classes and the spelling of the PC's. Meaning if you spell a name wrong, it will end. If you try to put a ranger in there, it will end. So if the macro ends as soon as it begins, check spelling and it the PC's are in the zone with you.

The macro supports up to 20 clerics and druids as healers, and up to 5 warriors as tanks. I will eventually make it so knights can be used as well.

The macro relies on the person before you in the rot to say the word "go". Only the person before you can make you go. They can say "Go You" or "You Go" or simply "Go". The macro then takes your turn, waits the specified delay, then tells the person after you to go.

If the cleric before you or after you dies, the macro will readjust the rot order. So if the cleric before you dies, then it will trigger when the person before that person says go. If the cleric after you dies, it will tell the person after that person to go next.

The macro currently does not readjust if the dead cleric comes back.

If the 1st tank dies, the macro switches to the 2nd tank, then the 3rd if he dies, and so on.

The macro will check for distance. If you are out of CH range and less that 250 feet away, it will face the MT and move in CH range.

Known Issues:
1) If the MT is OOR when you try to cast the macro will not tell the next person to go. This is a problem with spell_routines.inc that I am working on. Thus only applies if they are OOR and you get the Target is OOR message. If the MT moves OOR mid cast you are fine.

To Do:
1) Implement a way for the macro to readjust if a dead cleric comes back in.

2) Announce LoM, Dead, Silenced, etc to channel.

3) Implement changing of delay or order through tells.

4) Implement a way for the macro to execute your turn if the cleric before you does not take their turn.

Please leave suggestions and feedback here.
Last edited by Draimen on Fri Jul 30, 2004 1:21 am, edited 2 times in total.

Draimen
a lesser mummy
a lesser mummy
Posts: 69
Joined: Sun Jan 25, 2004 3:13 pm

Post by Draimen » Fri Jul 30, 2004 1:00 am

Code: Select all

|** rot.mac - Smart CH Rotation macro by Draimen
    Last Modified 07-28-04
    
    This macro will react to incoming chat and execute your turn
    in a CH rotation.  The macro will adjust if the cleric before
    you, or after you dies and if the tank dies.  The macro currently
    supports up to 20 clerics and 5 tanks.
    
    Usage:  /macro rot delay cleric1 cleric2 cleric3 tank1 tank2 tank3
    
    The delay MUST be given first.  The order you type in clerics and tanks
    is the order the macro sets the rotation and tank order to.  However
    you do not have to put clerics first, then tanks.  You can type:
    
    /macro rot delay cleric1 tank1 cleric2 cleric3 tank2
    
    or
    
    /macro rot delay tank1 tank2 cleric1 tank3 cleric2
    
    etc.
    
    The macro executes your turn in the rot when it sees the cleric before
    you say "go".  The syntax or case doesn't matter, as long as the person
    before you in the rot says go, you will execute.  So it can be "Go Next"
    or "Next go" or anything really.
    
    You will need to edit the channel variable below to the name of the channel
    your guild uses for the rot.  You cna also edit the healrange if you use
    extended range items.
    
    This macro uses spell_routines.inc by Rusty~ for spell casting which is
    found here: http://macroquest2.com/phpBB2/viewtopic.php?t=7568 **|

#Include spell_routines.inc

#Event Go "|${beforeme}|#*#Go#*#"

Sub Main

/declare channel string outer your channel here
/declare healrange int outer 100

/declare rotorder[20] string outer NULL
/declare delay int outer
/declare tankorder[5] string outer NULL
/declare paramcount int outer 0
/declare pccount int outer 0
/declare index int local
/declare clericcount int outer 0
/declare tankcount int outer 0
/declare menumber int outer
/declare beforeme string outer
/declare afterme string outer
/declare nextspam int outer 0
/declare pcs[25] string outer NULL
/declare notfoundcount int outer 0
/declare notfound[25] string outer NULL
/declare clericlist[25] string outer NULL
/declare clnum int outer 0
/declare tanklist[25] string outer NULL
/declare tlnum int outer 0
/declare rotcount int outer 0

/if (!${Defined[Param2]}) {
   /echo Usage /macro rot delay cleric1 cleric2 tank1 tank2
   /endmacro
}

/varset delay ${Param0}

/echo Starting rot macro

/for index 0 to 25 [1]
/if (${Defined[Param${index}]}) /varcalc paramcount ${paramcount}+1
/next index

/varcalc pccount ${paramcount}-1

/for index 1 to ${pccount} [1]
/varset pcs[${index}] ${Param${index}}
/next index

/for index 1 to ${pccount} [1]
/if (${String[${Spawn[pc ${pcs[${index}]}]}].Equal[NULL]}) {
   /varset notfound[${index}] ${pcs[${index}]}
   /varcalc notfoundcount ${notfoundcount}+1
}
/next index

/if (${notfoundcount}>0) {
   /for index 1 to ${notfoundcount} [1]
      /if (${String[${notfound[${index}]}].NotEqual[NULL]}) /echo ${notfound[${index}]} is not a valid PC name, ending macro.
   /next index
   /endmacro
}

/for index 1 to ${pccount} [1]
/varcalc clnum ${clnum}+1
/if ((${String[${Spawn[pc ${pcs[${index}]}].Class}].Equal[Cleric]})||(${String[${Spawn[pc ${pcs[${index}]}].Class}].Equal[Druid]})) {
   /varcalc clericcount ${clericcount}+1
   /varset clericlist[${clnum}] ${pcs[${index}]}
} else {
   /varcalc clnum ${clnum}-1
}
/next index

/for index 1 to ${pccount} [1]
/varcalc tlnum ${tlnum}+1
/if (${String[${Spawn[pc ${pcs[${index}]}].Class}].Equal[Warrior]}) {
   /varcalc tankcount ${tankcount}+1
   /varset tanklist[${tlnum}] ${pcs[${index}]}
} else {
   /varcalc tlnum ${tlnum}-1
}
/next index

/call Rotorder

/call Tankorder

/echo Rot order is:
/for index 1 to ${clericcount} [1]
/if (${String[${rotorder[${index}]}].NotEqual[NULL]}) /echo ${rotorder[${index}]}
/next index

/echo

/echo Tank order is:
/for index 1 to ${tankcount} [1]
/if (${String[${tankorder[${index}]}].NotEqual[NULL]}) /echo ${tankorder[${index}]}
/next index

/echo
/echo Delay is ${Param0}

:mainloop

/if ((!${Spawn[${beforeme}].ID})||(${String[${Spawn[${beforeme}].Type}].Equal[corpse]})) /call Rotorder
/if ((!${Spawn[${afterme}].ID})||(${String[${Spawn[${afterme}].Type}].Equal[corpse]})) /call Rotorder

/if ((!${Spawn[${tankorder[1]}].ID})||(${String[${Spawn[${tankorder[1]}].Type}].Equal[corpse]})) /call Tankorder

/if (${String[${tankorder[1]}].NotEqual[NULL]}) {
   /target ${tankorder[1]}
} else {
   /echo All tanks dead, ending
   /beep
   /endmacro
}

/if ((${Target.Distance}>${healrange})&&(${Target.Distance}<250)) {
   :farloop
   /if (${Me.Sitting}) /stand
   /face
   /keypress forward hold
   /delay 5 ${Target.Distance}<${healrange}
   /keypress forward
   /if (${Target.Distance}>${healrange}) /goto :farloop
}

/doevents

/goto :mainloop

/return


Sub Rotorder
/declare index int local 0
/declare rotnum int local 0

/varset rotcount 0
/varset menumber 0

/for index 1 to 20 [1]
/varset rotorder[${index}] NULL
/next index

/for index 1 to ${clericcount} [1]
/varcalc rotnum ${rotnum}+1
/if ((${String[${Spawn[${clericlist[${index}]}]}].NotEqual[NULL]})&&(${String[${Spawn[${clericlist[${index}]}].Type}].NotEqual[corpse]})) {
   /varset rotorder[${rotnum}] ${clericlist[${index}]}
   /varcalc rotcount ${rotcount}+1
} else {
   /varcalc rotnum ${rotnum}-1
}
/next index

/for index 1 to ${clericcount} [1]
/if (${String[${rotorder[${index}]}].Equal[${Me}]}) /varset menumber ${index}
/next index

/if (${menumber}>1) /varset beforeme ${rotorder[${Math.Calc[${menumber}-1]}]}
/if (${menumber}==1) /varset beforeme ${rotorder[${rotcount}]}

/if (${menumber}<${rotcount}) /varset afterme ${rotorder[${Math.Calc[${menumber}+1]}]}
/if (${menumber}==${rotcount}) /varset afterme ${rotorder[1]}

/return

Sub Tankorder
/declare index int local 0
/declare tanknum int local 0

/for index 1 to 5 [1]
/varset tankorder[${index}] NULL
/next index

/for index 1 to ${tankcount} [1]
/varcalc tanknum ${tanknum}+1
/if ((${String[${Spawn[${tanklist[${index}]}]}].NotEqual[NULL]})&&(${String[${Spawn[${tanklist[${index}]}].Type}].NotEqual[corpse]})) {
   /varset tankorder[${tanknum}] ${tanklist[${index}]}
} else {
   /varcalc tanknum ${tanknum}-1
}
/next index

/return


Sub Event_Go

/varset nextspam 1
/chat #${channel} CH to < %T > ${afterme} is next in ${delay}
/call Cast "Complete Healing" gem3 2s Next

/return

Sub Next

/if (${nextspam}==1) /timed ${delay} /chat #${channel} Go ${afterme}
/varset nextspam 0

/return


spell_routines.inc can be found here:

http://macroquest2.com/phpBB2/viewtopic.php?t=7568
Last edited by Draimen on Fri Jul 30, 2004 1:06 am, edited 1 time in total.

Draimen
a lesser mummy
a lesser mummy
Posts: 69
Joined: Sun Jan 25, 2004 3:13 pm

Post by Draimen » Fri Jul 30, 2004 1:01 am

(blank)

theafkxper
a hill giant
a hill giant
Posts: 207
Joined: Sun Sep 08, 2002 6:41 pm

Post by theafkxper » Fri Jul 30, 2004 3:35 am

Looks great, cant wait to try it when i 8box, but one thing you may consider..

If the Chain is long enough that there is time to click the epic between casts, target nearest corpse and rez it. Could prioritize (Clerics, then Druids, then Warriors then dps.. etc), or be turned off.

Dunno, just sounded like a decent idea at 3:30 am as im reading this :smile:

-afk

Draimen
a lesser mummy
a lesser mummy
Posts: 69
Joined: Sun Jan 25, 2004 3:13 pm

Post by Draimen » Fri Jul 30, 2004 11:16 am

Yes I am open to comments, suggestions, fixes. I have a few more thngs to do then I will look into adding features.

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

Post by fantum409 » Fri Jul 30, 2004 8:18 pm

Very cool macro Draimen! I'm working out one that my cleric and druid will use to 2 box heal, but its simpler and uses a global variable to time heals between the 2.

This looks like another cool tool for the eq arsenal.

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

Post by magictiger » Sat Jul 31, 2004 2:18 am

Now if only I could get the clerics in my guild to do this... /sigh

Process
a lesser mummy
a lesser mummy
Posts: 73
Joined: Fri Jun 25, 2004 5:30 pm

Having Some Trouble

Post by Process » Tue Aug 03, 2004 2:59 am

I'm trying to get this to work, but it keeps crapping out after the first heal.

Ok, I start the macro up on all 3 clerics (Each cleric types /mac rot 30 tankname cleric1name cleric2name cleric3name. I send a tell to the first cleric to "go" (Is that even how I'm supposed to start the macro's CH chain?). The first cleric starts healing - NP. The first cleric sends a message in the channel to go, the 2nd cleric starts healing, the 2nd cleric sends a "go" message into the channel and the 3rd cleric starts healing.

After all clerics finish with their 1st heal, the macro errors out with:

DoCommand - Couldn't parse #Event Go "|$(beforeme)#*#Go#*#"

Any ideas? This seems like a kick ass macro, I'd love to get it working.

Thanks

Draimen
a lesser mummy
a lesser mummy
Posts: 69
Joined: Sun Jan 25, 2004 3:13 pm

Post by Draimen » Tue Aug 03, 2004 2:41 pm

No clue why you are getting that error. The only problems I am aware of are with spell_routines.inc. alot of people having problems with crashing when they start to cast.

As for starting the CH chain. The 1st person can press their CH chain key to start it manually, or the last person in the rot can say "go" to make the 1st person start.

Like I said in my 1st post though, this macro will fail if every single cleric uses it. If one of your clerics is killed after they start casting but before they say Go Next in the channel, then the next cleric just stands there looking dumb.

eonblu
decaying skeleton
decaying skeleton
Posts: 3
Joined: Wed Mar 10, 2004 3:33 pm

Post by eonblu » Mon Sep 06, 2004 12:52 pm

any chance this macro could support sitting after casting the Heal. This works great but never saw my cleric sitting =(

Boredbard
a ghoul
a ghoul
Posts: 89
Joined: Thu Nov 27, 2003 11:49 am

Post by Boredbard » Wed Sep 08, 2004 6:23 pm

Yaulp is better than sitting most of the time (less agro, dead clerics do no good)

JimJohnson
a grimling bloodguard
a grimling bloodguard
Posts: 1299
Joined: Sat Oct 11, 2003 6:00 am

Post by JimJohnson » Wed Sep 08, 2004 7:10 pm

Also get your mana regen from yalp for that 1 tic you are casting sometimes 2. As with sitting you would miss both.