Goto page 1, 2, 3  Next Public Macros Spawn & NearestSpwan issu
Reply
Spawn & NearestSpwan issu
HI dudes :)

I'm trying to use the spawn and nearestspawn tlo through the peq mq2 release.

I'm having a weird issu on a script

I'm trying to use the Spawn or NearestSpawn
like
Macro
More +
 NearestSpawn[pc Blumblum]

It works great

Now if i try to use this in a sub like
Macro
More +

mysub (string name)
if (  {NearestSpawn[pc ${name}]} )
{/return OK} else {return KO}

it will always return "KO". The use of a variable ${name} is not accepted

Am i doing something wrong ?


even simpliest, if i'm doing this
somewhere before => (${name}=blumblum
Macro
More +
 /target ${name}

it returns "they are no spawn 0 100 matching blumblum

i'm getting crazy with this
Wed May 11, 2011 11:52 pm
never actually tried to use "name" because it is generally a reserved keyword in pretty much every programming language.


Macro
More +
MySub (string ToonName)
    if ( ${NearestSpawn[pc ${ToonName}]} ) {
        /return OK
    } else {
        /return KO
    }
/return

_________________
Sorvani
Thu May 12, 2011 12:10 am
Senior Project Member
yeah i had the same feeling and change my variable name
it doesn't work either
any time i use a SPAWN or NearestSpawn with a ${toonname} it returns null

i'm trying to debut it with simple thing like

Macro
More +
/echo ${NearestSpawn[pc ${tooname}]}

to debug it step by step...And no luck. i've checked my toon is in the same zone, is not ano or role...not sure it can block, but just in case.

if i do a
Macro
More +
/echo ${NearestSpawn[pc blumblum]}
it works perfectly
Thu May 12, 2011 12:29 am
Looked closer at what you were doing sorry i didn't read it carefully last night.

${Spawn} and ${NearestSpawn} return the spawn's server side name. That is a string and can not be converted to a boolean.

Macro
More +
Sub Main

        /call MySub Sorvani
        /echo ${Macro.Return}

/return

Sub MySub(string ToonName)
        /if ( ${NearestSpawn[pc ${ToonName}].ID} ) {
                /return OK
        } else {
                /return KO
        }
/return

_________________
Sorvani
Thu May 12, 2011 7:50 am
Senior Project Member
Hehe, my fault, i'm not really clear explaining my bug

Actually the code i made is not exactly the one i wrote (i made the post this morning and didn't check the syntax), and my issue is not with the boolean casting :)

I'll try to explain again

If i have somewhere a variable initialized ${tooname} wich contains the string "blumblum"
Then
When i do this simple instruction in my code
/echo ${NearestSpawn[pc ${tooname}]}

=> it returns null

if i don't use a variable but i put directly my toon name in the NearestSpawn tlo, it works perfectly

/echo ${NearestSpawn[pc ${blumblum}]}

Why i want to use this :
I make a script where i catch a tell to my cleric, get the teller name, catch his ID, then i target him through his ID. (and then i can buff him, heal him whatever).

So i use the NearestSpawn fonction, because it has a .ID attribute

And well, because of the bug i explained below, it doesn't work.
The only workaround i have is something like this
(code may be messy, i'm writing it from work, and i'm still a mq2 newbie)



Macro
More +
sub MyplayerID (String teller)
|get all player & number in buff range
/varset Playercount ${SpawnCount[radius 100]}
      /declare Allmytoon[${Playercount}] int local
      /declare Mytoon int local
      /for x 1 to ${Playercount}
         /varset Allmytoon[${x}] ${NearestSpawn[${x}, radius 100].ID}
         /if ${Allmytoon[${x}].Name.Equal[${teller}]} /varset ${Mytoon} ${Allmytoon[${x}].ID)
      /next x
Thu May 12, 2011 9:36 am
Troubleshooting something when the actual code is not posted is not something I spend time on. post the exact code you are having a problem with and I'll troubleshoot it.

Based on what you posted the first time, the code I posted above works just fine. copy it and paste it into a file called test.mac and then run it, you will see it returns OK/KO correctly.
_________________
Sorvani
Thu May 12, 2011 9:44 am
Senior Project Member
There is no reason to target by ID if you don't start the routine with the ID. Either way you have to search for the ID, either in the /target command, or in the Spawn/NearestSpawn object.

You could use Nearest Spawn to gather the ID of the teller, and then use that ID in the target command, like this:
/varset TellerID ${Spawn[PC Blumblum].ID}
/target ID ${TellerID}

but how is that different from:
/target ID ${Spawn[PC Blumblum].ID}

and then, how is that different than:
/target PC Blumblum

If you are getting the teller's name, then using the search string "PC Blumblum" in the spawn object the resultant spawn you get is the same resulting spawn you get from using the same exact search string with the /target command. They both call the same routine within the MQ code. So you are effectively taking a name, casting it to a spawn (with the Spawn object), then casting that to an ID (with the .ID property), then casting that back to a spawn (with the target command).




Macro
More +
#event heal "#1# tells you, 'heal me'"

Sub event_heal
|skip the spawn object since /target
|uses the exact same code to resolve a
|search string in addition to performing
|the target action on that spawn
/target PC =${Param1}

|make sure the target we got is the
|one we want
/if (${Me.Target.Name.NotEqual[${Param1}]}) {
    /echo couldn't target ${Param1}
    /return
}

|put your healing, buffing, whatever here

/return
Thu May 12, 2011 9:55 am
Project Lead
OK my bad i'll put the whole code
I'm using this macro afcleric, i founded there http://www.macroquest2.com/phpBB3/viewtopic.php?f=43&t=7567

It's the first time i try to use a macro, and of course, it doesnt' work (wouldn't be fun, would be ? :p)
What does not work is the buffing part : you send a tell to the cleric, it targets you, then buff you.
The target part doesn't work, on my PC.

I try to isolate the issue, and , after debugging through some /echo, i founded that the macro bugged in this sub function

Macro
More +

Sub FindExactPC(string name)
   /declare nameid int local
   /declare counter int local 1
   :FindNext
   /if (!${NearestSpawn[${counter}, pc ${name}].ID}) /return NOT_FOUND
   /varset nameid ${NearestSpawn[${counter}, pc ${name}].ID}
   /if (${Spawn[${nameid}].CleanName.Equal[${name}]}) {
      /target id ${nameid}
      /delay 1s ${Target.ID}==${nameid}
      /if (${Target.ID}==${nameid}) /return TARGET_SUCCESS
   }
   /varcalc counter ${counter}+1
   /if (${NearestSpawn[${counter}, pc ${name}].ID}) /goto :FindNext
/return NOT_FOUND


This line : /if (!${NearestSpawn[${counter}, pc ${name}].ID}) /return NOT_FOUND
always return the NOT_FOUND, whatever i do.
My cleric is like at a distance of 10 from my monk blumblum, in POT.
So it should work....

I spend like 3 hours trying many things, and came to the conclusion that the issue came from the NearestSpawn fonction, who doesn't like the ${name}. As Sorvani suggested, i change the variable Name, because it could be a reserved keyword. Doesn't solve the issue.

I'm not sure of my explanation, really i'm a newbie

Since it doesn't work, at leat on my PC, i'm trying to redo this sub with something similar :)
Thu May 12, 2011 10:19 am
That code matches the version I posted and happens to be the cleric macro I use most of the time. I keep saying I'm going to write my own but i never have done it yet.

I use the UF client now, and I previously used the SoD client with this macro.
I honestly can not remember if I used this macro on the Titanium client.

Here is what mine looks like.
Macro
More +
Sub FindExactPC(string name)
   /declare nameid int local
   /declare counter int local 1
   :FindNext
   /if (!${NearestSpawn[${counter}, pc ${name}].ID}) /return NOT_FOUND
   /varset nameid ${NearestSpawn[${counter}, pc ${name}].ID}
   /if (${Spawn[${nameid}].CleanName.Equal[${name}]}) {
      /target id ${nameid}
      /delay 1s ${Target.ID}==${nameid}
      /if (${Target.ID}==${nameid}) /return TARGET_SUCCESS
   }
   /varcalc counter ${counter}+1
   /if (${NearestSpawn[${counter}, pc ${name}].ID}) /goto :FindNext
/return NOT_FOUND

_________________
Sorvani
Thu May 12, 2011 10:32 am
Senior Project Member
I use the Steam underfoot version too..
Our macro matches, but still it doesn't work for me

So i guess there's something wrong with my environnement (my pc, my MQ2 ini whatever)
Thu May 12, 2011 10:35 am
There are some good macros in the VIP section if you have access.
Thu May 12, 2011 10:51 am
Listen to This Guy
ok 3 more hours trying to understand why the af cleric macro doesn't work )
my conclusion so far is that as soon as my in the EVENT_CHAT part, spawn [${mytoon}]/ NearestSpawn[${mytoon}] don't work, but i don't get why

IF someone is kind enough to test the macro on his pc, with Underfoot client, and underfoot peq release.
To test "the bug", just send /tell mycleric hot me
It will goes into the heal over time buffing, which use the Event_CHAT and FindExactPC, which use NearestSpawn.

I'm pretty sure i missed something obvious

Here is the code Afcleric.mac

Macro
More +
#include spell_routines.inc
#include ChatParse.inc
|#include mokaddon.inc

#Event IRCchat "<#1#> #2#"
#Chat Chat
#Chat tell
#chat group

Sub Main

|------------READ THIS SECTION AND EDIT IF NEEDED-----------|

   /declare mychannel string outer ChangeMeLine13
   /declare usegroupchat int outer 0
   /declare useircchat int outer 0
   /declare autohealmode int outer 3
   /declare healspell string outer Complete Healing
   /declare healspellrange int outer 100
   /declare patchheal string outer Holy Light
   /declare patchhealrange int outer 100
   /declare hotspell string outer Supernal Elixir
   /declare hotspellrange int outer 100
   /declare daspell string outer Divine Barrier
   /declare yaulpspell string outer Yaulp VI
   /declare usegroupheal int outer 1
   /declare groupheal string outer Word of Replenishment
   /declare grouphealrange int outer 70
   /declare announce int outer 1
   /declare autosit int outer 1
   /declare distancetosit int outer 40
   /declare autointerrupt int outer 1
   /declare onlyhealfd int outer 0
   /declare interrupt2healself int outer 1
   /declare interrupt2healselfhp int outer 65
   /declare noInvis int outer 1
   /declare defaultstophealpoint int outer 80
   /declare acbuff string outer Ward of Gallantry
   /declare longhpbuff string outer Virtue
   /declare singlesymbuff string outer Symbol of Kazad
   /declare groupsymbuff string outer Kazad's Mark
   /declare spellhastebuff string outer Blessing of Reverence
   /declare groupspellhastebuff string outer Aura of Reverence
   /declare rgcspell string outer Remove Greater Curse
   /declare healpetmode int outer 2
   /declare pethealpoint int outer 65
   /declare manatohealpet int outer 25
   /declare pethealspell string outer Complete Healing
   /declare pethealspellrange int outer 100
   /declare nukeone string outer Reproach
   /declare nuketwo string outer Order
   /declare stunone string outer Sound of Divinity
   /declare stuntwo string outer Shock of Wonder
|   /declare mokaddon int outer 1
   /declare edbuffitem string outer Foresight Sash

|** Tweak Heals Here - tankhealpoint is for War/Pal/SK other
than MT, casterhotpoint and casterpatchpoint refer to
wiz/mag/enc/dru, necshmpatchpoint refers to necros and
shamans, defaultpatchpoint refers to all other classes.   **|


   /declare selfhealpoint int outer 50
   /declare dacastpoint int outer 29
   /declare tankhealpoint int outer 65
   /declare casterhotpoint int outer 85
   /declare casterpatchpoint int outer 60
   /declare necshmpatchpoint int outer 50
   /declare defaultpatchpoint int outer 70
   /declare healpotpoint int outer 0

|**---------------Divine Arbitration Config-----------------|

Fine tune div arb interruptions. interrupt2divarb is the
threshold for interrupting other spells for target/self HP
dropping below divarbpoint. interrupt2divarb is in 1/10th
seconds, so if 16 is used, spells with more than 1.6 seconds
left would be interrupted if divarbpoint HP is reached. **|

   /declare usedivarb int outer 1
   /declare divarbpoint int outer 25
   /declare healafterdivarb int outer 1
   /declare interrupt2divarb int outer 14

|**---------------------TrickyDA Config---------------------|

The following are HP buffs cleric will click off, in order,
to get above 40% HP and avoid low HP aggro. Clr will then
click off DA and resume duties, beg new buffs, etc. To
enable, set trickyda to 1, 0 will disable **|


   /declare trickyda int outer 0
   /if (${trickyda}==1) {
      /declare intcount int outer 0
      /declare trickybuff[20] string outer
      /varset trickybuff[1] Virtue
      /varset trickybuff[2] Hand of Virtue
      /varset trickybuff[3] Conviction
      /varset trickybuff[4] Hand of Conviction
      /varset trickybuff[5] Focus of Soul
      /varset trickybuff[6] Focus of the Seventh
      /varset trickybuff[7] Wunshi's Focusing
      /varset trickybuff[8] Talisman of Wunshi
      /varset trickybuff[9] Protection of the 9
      /varset trickybuff[10] Blessing of the Nine
      /varset trickybuff[11] Steeloak Skin
      /varset trickybuff[12] Blessing of Steeloak
      /varset trickybuff[13] Symbol of Kazad
      /varset trickybuff[14] Kazad`s Mark
      /varset trickybuff[15] Symbol of Balikor
      /varset trickybuff[16] Balikor's Mark
      /varset trickybuff[17] Brell's Stalwart Shield
      /varset trickybuff[18] Brell's Brawny Bulwark
      /varset trickybuff[19] Spiritual Vigor
      /varset trickybuff[20] Spiritual Vitality
   }
|-------------------End TrickyDA Config---------------------|



|------------------------END EDITING------------------------ |

   /declare healpct int outer 60
   /declare tankname string outer ${Target}
   /declare tanknameid int outer
   /declare tankclass string outer
   /declare minorhurt int outer 0
   /declare majorhurt int outer 0
   /declare worsthurt string outer NULL
   /declare worsthurtid int outer
   /declare worsthp int outer 100
   /declare worstclass string outer NULL
   /declare gmember int outer
   /declare nohotforua string outer NULL
   /declare nohotforub string outer NULL
   /declare nohotforuc string outer NULL
   /declare nohotforud string outer NULL
   /declare rodwait int outer 0
   /declare following int outer 0
   /declare follname string outer NULL
   /declare pallycount int outer 0
   /declare stophealpoint int outer ${defaultstophealpoint}
   /declare buffbeg int outer 1
   /declare oomspam int outer 1
   /declare lomspam int outer 1
   /declare duckspam int outer 1
   /declare duckfdspam int outer 1
   /declare duckselfspam int outer 1
   /declare nomtspam int outer 1
   /declare ghealhurtcount int outer 0
   /declare divarboor int outer 0
   /declare aetime int outer 0
   /declare manastonecycle int outer 0
   /declare olditem string outer
   /declare oldprimary string outer

   /if (${useircchat}==0) /join ${mychannel}
   /if (${useircchat}==1) {
      /iconnect 192.168.0.1 6667 #${mychannel} ${Me}
      /i nick ${Me}
      /timed 50 /i join #${mychannel}
   }

   /if (${FindItem[=Stone of Tainted Health].ID}) /call EquipItem "Stone of Tainted Health"

   /if (!${Target.ID}) {
      /echo Target the Tank when you run this macro to designate him as MT
      /end
   } else {
      /varset tanknameid ${Target.ID}
      /varset tankclass ${Target.Class.Name}
   }

   /if (${Defined[Param0]}) {  
      /varset healpct ${Param0}
   } else /echo No Heal% specified, defaulting to 60%
   
   /if (!${Defined[Param1]}) {  
      /echo Usage: /mac AFCleric % healspell
      /echo Example: /mac AFCleric 40 Complete Heal
      /echo Defaulting to ${healspell} at ${healpct}%
   } else {  
      /if (!${Defined[Param2]}) {
         /varset healspell ${Param1}
      } else /if (!${Defined[Param3]}) {
         /varset healspell ${Param1} ${Param2}
      } else /if (!${Defined[Param4]}) {
         /varset healspell ${Param1} ${Param2} ${Param3}
      } else {
         /varset healspell ${Param1} ${Param2} ${Param3} ${Param4}
      }
   }

   /echo AFCleric Active, running in Autohealmode ${autohealmode}
   /echo Casting ${healspell} on ${tankname} at ${healpct}% HP
   /if (${autohealmode}==0) /echo ONLY ${tankname} will be healed
   /if (${autohealmode}==1) /echo ONLY ${tankname} and myself will be healed
   /if (${autohealmode}==2) /echo ${tankname}, myself and my group will be healed
   /if (${autohealmode}==3) /echo ${tankname} and myself will be healed before the rest of the group
   
   :tankwatchloop
   /if (${Spawn[${tanknameid}].Name.NotEqual[${tankname}]}) /varset tanknameid 0
   /if (!${Spawn[${tanknameid}].ID}) /if (${Spawn[${tankname}].ID}) {
      /if (${SpawnCount[${tankname} ${tankclass}]}==1) {
         /varset tanknameid ${Spawn[${tankname} ${tankclass}].ID}
         /echo ${Spawn[${tankname} ${tankclass}].Name} is the designated MT and has ID# ${tanknameid}
      }
      /if (${SpawnCount[${tankname} ${tankclass}]}>1) {
         /if (${SpawnCount[pc ${tankname} ${tankclass}]}==1) {
            /beep
            /varset tanknameid ${Spawn[pc ${tankname} ${tankclass}].ID}
            /echo Defaulting to PC ${Spawn[pc ${tankname} ${tankclass}].Name} as MT. If incorrect, please restart macro
         } else {
            /beep
            /echo Need to restart macro to correctly identify the MT
         }
      }
   }
   /if (${Spawn[${tanknameid}].ID}) /if (${Spawn[${tanknameid}].Type.Equal[Corpse]}) {
      /if (${SpawnCount[pc ${tankname} ${tankclass}]}==1) {
         /varset tanknameid ${Spawn[pc ${tankname ${tankclass}}].ID}
         /echo ${Spawn[pc ${tankname} ${tankclass}].Name} is MT and has ID# ${tanknameid}. If incorrect, please restart macro
      }
   }
   /if ((!${Target.ID}) || (${Target.ID}!=${tanknameid})) {
      /if (${Spawn[${tanknameid}].ID}) /if (${Spawn[${tanknameid}].Type.NotEqual[Corpse]}) {
         /target id ${tanknameid}
         /delay 6 ${Target.ID}==${tanknameid}
      }
   }
   /if (!${Spawn[${tanknameid}].ID}) {
      /if (${nomtspam}==1) {
         /e Warning No Designated MT is available
         /timed 300 /varset nomtspam 1
         /varset nomtspam 0
      }
   }
   /if ((${Me.PctMana}<=20) && (${announce}==1) && (${lomspam}==1)) {
      /g ${Me.PctMana}m
      /varset lomspam 0
      /timed 300 /varset lomspam 1
   }
   /if ((${Me.PctMana}<=7) && (${announce}==1) && (${oomspam}==1)) {
      /g oom
      /varset oomspam 0
      /timed 300 /varset oomspam 1
      /call MedTime
   }
   /if (${GameState.Equal[CHARSELECT]}) /end
   /if (${Target.ID}==${tanknameid}) {
      /varset stophealpoint ${Math.Calc[${healpct}*1.1]}
      /if ((${Target.Distance}<=${patchhealrange}) && (${Target.PctHPs}<=${Math.Calc[0.7*${healpct}]}) && (${Target.PctHPs}>=1)) {
         /if (${announce}==1) /g Casting ${patchheal} on %T
         /call Cast "${patchheal}" gem2 1s CheckHP
         /delay 15 ${Me.SpellReady[${patchheal}]}
      }
      /if ((${Target.Distance}<=${healspellrange}) && (${Target.PctHPs}<=${healpct}) && (${Target.PctHPs}>=${Math.Calc[0.7*${healpct}]})) {
         /if (${announce}==1) /g Casting ${healspell} on %T
         /call Cast "${healspell}" gem1 1s CheckHP
         /delay 15 ${Me.SpellReady[${healspell}]}
      }
      /varset stophealpoint ${defaultstophealpoint}
      /call CheckEvents
   }
   /if ((${autosit}>=1) && (${Bool[${Me.Sitting}]}) && (!${Window[SpellBookWnd].Open})) {
      /if ((${Me.PctMana}>98) || (${Me.PctHPs}<=90)) /stand
   }
   /if ((${autosit}==1) && (${Bool[${Me.Sitting}]}) && (!${Window[SpellBookWnd].Open})) {
      /if (${NearestSpawn[NPC].Distance}<=${Math.Calc[${NearestSpawn[NPC].MaxRange}+${Math.Calc[${distancetosit}/3]}]}) /stand
   }
   /if (${autohealmode}==0) {
      /call CheckEvents
      /goto :tankwatchloop
   }
   /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
/return
   

Sub Healself
   /if (${Me.PctHPs}<=${healpotpoint}) /call HealPotUse
   /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}]}
         }
      }
      /if ((${Me.PctHPs}<=${dacastpoint}) && (${Me.SpellReady[${daspell}]})) {
         /if (${announce}==1) /g Casting DA!! <<WARNING>> DA!! No Heals for 18 SECONDS
         :retryda
         /call Cast "${daspell}"
         /delay 1
         /if ((!${Me.Buff[${daspell}].ID}) && (${Me.SpellReady[${daspell}]})) /goto :retryda
         /if ((${trickyda}==1) && (${Me.Buff[${daspell}].ID})) /call TrickyDA
         :dawait
         /if (${Me.Buff[${daspell}].ID}) {
            /delay 1s !${Me.Buff[${daspell}].ID}
            /varset stophealpoint ${defaultstophealpoint}
            /call CheckEvents
            /goto :dawait
         }
      }          
   }
   /if (${Me.PctHPs}<=${Math.Calc[${selfhealpoint}*0.7]}) {
      /target myself
      /delay 6 ${Target.Name.Equal[${Me}]}
      /if (${Target.Name.Equal[${Me}]}) {
         /if (${announce}==1) /g Casting ${patchheal} on %T
         /varset stophealpoint ${Math.Calc[${selfhealpoint}+5]}
         /call Cast "${patchheal}" gem2 1s CheckHP
         /delay 15 ${Me.SpellReady[${patchheal}]}
      }
   }
   /varset stophealpoint ${defaultstophealpoint}
/return


Sub Healgroup
   :healgroup
   /varset worsthurt NULL
   /varset worsthp 100
   /varset worstclass NULL
   /varset minorhurt 0
   /varset majorhurt 0
   /varset ghealhurtcount 0
   /for gmember 0 to ${Group}
      /if (${onlyhealfd}==0) {
         /if (${Group.Member[${gmember}].Distance}<=${patchhealrange}) {
            /if (${Group.Member[${gmember}].PctHPs}<=${worsthp}) {
               /varset worsthurt ${Group.Member[${gmember}].Name}
               /varset worsthurtid ${Group.Member[${gmember}].ID}
               /varset worsthp ${Group.Member[${gmember}].PctHPs}
               /varset worstclass ${Group.Member[${gmember}].Class.Name}
            }
         }
      }
      /if (${onlyhealfd}==1) {
         /if (${Group.Member[${gmember}].Distance}<=${patchhealrange}) {
            /if ((${Group.Member[${gmember}].Class.Name.NotEqual[Monk]}) && (${Group.Member[${gmember}].Class.Name.NotEqual[Necromancer]}) && (${Group.Member[${gmember}].PctHPs}<=${worsthp})) {
               /varset worsthurt ${Group.Member[${gmember}].Name}
               /varset worsthurtid ${Group.Member[${gmember}].ID}
               /varset worsthp ${Group.Member[${gmember}].PctHPs}
               /varset worstclass ${Group.Member[${gmember}].Class.Name}
            }
            /if ((${Group.Member[${gmember}].Class.Name.Equal[Monk]}) || (${Group.Member[${gmember}].Class.Name.Equal[Necromancer]})) {
               /if ((${Group.Member[${gmember}].State.Equal[feign]}) && (${Group.Member[${gmember}].PctHPs}<=${worsthp})) {
                  /varset worsthurt ${Group.Member[${gmember}].Name}
                  /varset worsthurtid ${Group.Member[${gmember}].ID}
                  /varset worsthp ${Group.Member[${gmember}].PctHPs}
                  /varset worstclass ${Group.Member[${gmember}].Class.Name}
               }
            }
         }
      }
      /if ((${Group.Member[${gmember}].Distance}<=${grouphealrange}) && (${Group.Member[${gmember}].PctHPs}<=85)) /varcalc ghealhurtcount ${ghealhurtcount}+1
      /if ((${Group.Member[${gmember}].PctHPs}<=85) && (${Group.Member[${gmember}].PctHPs}>=60)) /varcalc minorhurt ${minorhurt}+1
      /if ((${Group.Member[${gmember}].PctHPs}<=60) && (${Group.Member[${gmember}].PctHPs}>=1)) /varcalc majorhurt ${majorhurt}+1
   /next gmember
   /if (${autohealmode}==3) {
      /if ((!${Target.ID}) || (${Target.Name.NotEqual[${tankname}]})) /if (${Spawn[${tanknameid}].ID}) {
         /target id ${tanknameid}
         /delay 6 ${Target.ID}==${tanknameid}
         /delay 1
         /if ((${Target.ID}==${tanknameid}) && (${Target.PctHPs}<=${healpct}) && (${Target.Distance}<=${healspellrange})) /return
      }
      /if (${Me.PctHPs}<=${selfhealpoint}) /return
   }
   /if ((${majorhurt}==0) && (${minorhurt}==0)) {
      /if (${Spawn[${tanknameid}].ID}) {
         /target id ${tanknameid}
         /delay 6 ${Target.ID}==${tanknameid}
         /delay 1
      }
      /if (((${Target.ID}==${tanknameid}) && (${Target.PctHPs}>${healpct})) || (!${Spawn[${tanknameid}].ID}) || (${Spawn[${tanknameid}].Type.Equal[corpse]})) {
         /if ((${healpetmode}>0) && (${Me.PctMana}>=${manatohealpet})) /call HealPet
|         /if (${mokaddon}==1) /if (${Target.ID}==${tanknameid}) /call AutoMOK
         /if (${Me.PctMana}<=98) /call MedTime
      }
      /call CheckEvents
      /return
   }
   /if ((${usedivarb}==1) && (${worsthp}<=${divarbpoint}) && (${Me.AltAbilityReady[divine arbitration]})) /call Divarbcast
   /if ((${Math.Calc[${majorhurt}+${minorhurt}]}>=3) && (${usegroupheal}==1)) {
      /if (${announce}==1) /g Inc Grp Heal, get close
      /call Cast "${groupheal}" gem4 1s
      /delay 15 ${Me.SpellReady[${groupheal}]}
      /call CheckEvents
      /return
   }
   /if (${worsthurtid}==${tanknameid}) /return
   /if (${worsthurtid}==${Me.ID}) {
      /call Healself
      /call CheckEvents
      /return
   }
   /if ((${worstclass.Equal[Warrior]}) || (${worstclass.Equal[Paladin]}) || (${worstclass.Equal[Shadow Knight]}) ||(${worstclass.Equal[Monk]})  ) {
      /if ((${worsthp}<=${tankhealpoint}) && (${worsthp}>=${Math.Calc[0.7*${tankhealpoint}]}) && (${majorhurt}<=1) && (${minorhurt}<=1)) {
         /target id ${worsthurtid}
    /delay 5 ${Target.ID}==${worsthurtid}
         /if (!${Target.ID}) /return
         /if (${Target.ID}!=${worsthurtid}) /return
         /varset stophealpoint ${Math.Calc[${tankhealpoint}+5]}
         /if (${announce}==1) /g Casting ${healspell} on %T
         /call Cast "${healspell}" gem1 1s CheckHP
         /delay 15 ${Me.SpellReady[${healspell}]}
         /varset stophealpoint ${defaultstophealpoint}
         /call CheckEvents
         /return
      }
      /if (${worsthp}<=${tankhealpoint}) {
         /target id ${worsthurtid}
    /delay 5 ${Target.ID}==${worsthurtid}
         /if (!${Target.ID}) /return
         /if (${Target.ID}!=${worsthurtid}) /return
         /varset stophealpoint ${Math.Calc[${tankhealpoint}+5]}
         /if (${announce}==1) /g Casting ${patchheal} on %T
         /call Cast "${patchheal}" gem2 1s CheckHP
         /delay 15 ${Me.SpellReady[${patchheal}]}
         /varset stophealpoint ${defaultstophealpoint}
         /call CheckEvents
         /return
      }
   } else /if ((${worstclass.Equal[Magician]}) || (${worstclass.Equal[Wizard]}) || (${worstclass.Equal[Enchanter]}) || (${worstclass.Equal[Druid]})) {
      /if ((${worsthp}<=${casterhotpoint}) && (${worsthp}>${casterpatchpoint})) {
         /if ((${worsthurt.Equal[${nohotforua}]}) || (${worsthurt.Equal[${nohotforub}]}) || (${worsthurt.Equal[${nohotforuc}]}) || (${worsthurt.Equal[${nohotforud}]})) /return
         /if (${nohotforua.Equal[NULL]}) {
            /target id ${worsthurtid}
       /delay 5 ${Target.ID}==${worsthurtid}
       /if (!${Target.ID}) /return
            /if (${Target.ID}!=${worsthurtid}) /return
            /varset nohotforua ${Target.Name}
            /if (${announce}==1) /g Casting ${hotspell} on %T
            /varset stophealpoint ${Math.Calc[${casterhotpoint}+5]}
            /call Cast "${hotspell}" gem3 1s CheckHP
            /timed 200 /varset nohotforua NULL
            /delay 15 ${Me.SpellReady[${hotspell}]}
         } else /if (${nohotforub.Equal[NULL]}) {
            /target id ${worsthurtid}
       /delay 5 ${Target.ID}==${worsthurtid}
       /if (!${Target.ID}) /return
            /if (${Target.ID}!=${worsthurtid}) /return
       /varset nohotforub ${Target.Name}
            /if (${announce}==1) /g Casting ${hotspell} on %T
            /varset stophealpoint ${Math.Calc[${casterhotpoint}+5]}
            /call Cast "${hotspell}" gem3 1s CheckHP
            /timed 200 /varset nohotforub NULL
            /delay 15 ${Me.SpellReady[${hotspell}]}
         } else /if (${nohotforuc.Equal[NULL]}) {
            /target id${worsthurtid}
       /delay 5 ${Target.ID}==${worsthurtid}
       /if (!${Target.ID}) /return
            /if (${Target.ID}!=${worsthurtid}) /return
       /varset nohotforuc ${Target.Name}
            /if (${announce}==1) /g Casting ${hotspell} on %T
            /varset stophealpoint ${Math.Calc[${casterhotpoint}+5]}
            /call Cast "${hotspell}" gem3 1s CheckHP
            /timed 200 /varset nohotforuc NULL
            /delay 15 ${Me.SpellReady[${hotspell}]}
         } else /if (${nohotforud.Equal[NULL]}) {
            /target id ${worsthurtid}
       /delay 5 ${Target.ID}==${worsthurtid}
       /if (!${Target.ID}) /return
            /if (${Target.ID}!=${worsthurtid}) /return
       /varset nohotforud ${Target.Name}
            /if (${announce}==1) /g Casting ${hotspell} on %T
            /varset stophealpoint ${Math.Calc[${casterhotpoint}+5]}
            /call Cast "${hotspell}" gem3 1s CheckHP
            /timed 200 /varset nohotforud NULL
            /delay 15 ${Me.SpellReady[${hotspell}]}
         }
         /varset stophealpoint ${defaultstophealpoint}
         /call CheckEvents
         /return
      }
      /if ((${worsthp}<=${casterpatchpoint}) && (${worsthp}>=1)) {
         /target id ${worsthurtid}
    /delay 5 ${Target.ID}==${worsthurtid}
    /if (!${Target.ID}) /return
         /if (${Target.ID}!=${worsthurtid}) /return
         /if (${announce}==1) /g Casting ${patchheal} on %T
         /call Cast "${patchheal}" gem2 1s CheckHP
         /varset stophealpoint ${defaultstophealpoint}
         /call CheckEvents
         /delay 15 ${Me.SpellReady[${patchheal}]}
         /return
      }
      /varset stophealpoint ${defaultstophealpoint}
   } else /if ((${worstclass.Equal[Necromancer]}) || (${worstclass.Equal[Shaman]})) {
      /if ((${worsthp}<=${necshmpatchpoint}) && (${worsthp}>=1)) {
         /target id ${worsthurtid}
    /delay 5 ${Target.ID}==${worsthurtid}
    /if (!${Target.ID}) /return
         /if (${Target.ID}!=${worsthurtid}) /return
         /varset stophealpoint ${Math.Calc[${necshmpatchpoint}+5]}
         /if (${announce}==1) /g Casting ${patchheal} on %T
    /call Cast "${patchheal}" gem2 1s CheckHP
    /varset stophealpoint ${defaultstophealpoint}
    /call CheckEvents
    /delay 15 ${Me.SpellReady[${patchheal}]}
    /return
      }
   } else /if ((${worsthp}<=${defaultpatchpoint}) && (${worsthp}>=1)) {
      /target id ${worsthurtid}
      /delay 5 ${Target.ID}==${worsthurtid}
      /if (!${Target.ID}) /return
      /if (${Target.ID}!=${worsthurtid}) /return
      /if (${announce}==1) /g Casting ${patchheal} on %T
      /varset stophealpoint ${Math.Calc[${defaultpatchpoint}+5]}
      /call Cast "${patchheal}" gem2 1s CheckHP
      /varset stophealpoint ${defaultstophealpoint}
      /call CheckEvents
      /delay 15 ${Me.SpellReady[${patchheal}]}
      /return
   }
   /varset stophealpoint ${defaultstophealpoint}
   /if ((${healpetmode}==2) && (${Me.PctMana}>${manatohealpet})) /call HealPet
|   /if (${mokaddon}==1) /if (${Target.ID}==${tanknameid}) /call AutoMOK
/return


Sub Divarbcast
   /varset divarboor 0
   /for gmember 0 to ${Group}
      /if (${Group.Member[${gmember}].Distance}>200) /varcalc divarboor ${divarboor}+1
   /next gmember
   /if (${Math.Calc[${Group}-${divarboor}]}>=2) {
      /if (${announce}==1) /g Inc Divine Arbitration
      /call Cast "Divine Arbitration" alt 2s
      /if ((${healafterdivarb}==1) && (${Me.PctMana}>40)) {
         /if (${announce}==1) /g Inc Grp Heal, get close
         /call Cast "${groupheal}" gem4 2s
         /delay 15 ${Me.SpellReady[${groupheal}]}
      }
   }
/return


Sub HealPet
   /varset worsthurt NULL
   /varset worsthp 100
   /for gmember 0 to ${Group}
      /if (${Group.Member[${gmember}].Pet.ID}) {
         /if (${Group.Member[${gmember}].Pet.Distance}<=${pethealspellrange}) {
            /if ((${Group.Member[${gmember}].Pet.PctHPs}<=${worsthp}) && (${Group.Member[${gmember}].Pet.PctHPs}<=${pethealpoint})) {
               /varset worsthurt ${Group.Member[${gmember}].Pet.Name}
               /varset worsthurtid ${Group.Member[${gmember}].Pet.ID}
               /varset worsthp ${Group.Member[${gmember}].Pet.PctHPs}
            }
         }
      }
   /next gmember
   /if (${worsthurt.NotEqual[NULL]}) {
      /target id ${worsthurtid}
      /delay 5 ${Target.ID}==${worsthurtid}
      /if (!${Target.ID}) /return
      /if (${Target.ID}!=${worsthurtid}) /return
      /delay 3
      /if (${Target.PctHPs}<=${pethealpoint}) {
         /if (${announce}==1) /g Casting ${pethealspell} on %T
         /varset stophealpoint ${Math.Calc[${pethealpoint}+5]}
         /call Cast "${pethealspell}" spell 1s CheckHP
         /varset stophealpoint ${defaultstophealpoint}
         /delay 15 ${Me.SpellReady[${pethealspell}]}
      }
   }
/return


Sub CheckEvents
   /delay 1
   /doevents IRCchat
   /doevents Chat
   /doevents tell
/return


Sub MedTime
   :oomwait
   /call CheckEvents
   /if ((!${Me.Buff[Voice of Quellious].ID}) && (!${Me.Buff[Tranquility].ID}) && (!${Me.Buff[Koadic's Endless Intellect].ID}) && (!${Me.Buff[Clairvoyance].ID}) && (!${Me.Buff[Voice of Clairvoyance].ID})) {
      /if ((!${Spawn[PC enchanter].ID}) || (${NearestSpawn[PC enchanter].Distance}>200)) {
         /call ClarPotUse
      }
   }
   /If ((${FindItem["Rod of Mystical Transvergance"].InvSlot}) && (${Me.PctMana}<=70) && (${Me.PctHPs}>=98) && (${rodwait}==0)) {
      /call Cast "Rod of Mystical Transvergance" item
      /varset rodwait 1
      /timed 3000 /varset rodwait 0
   }
   /if ((${autosit}==1) && (${Me.PctMana}<=98) && (!${Me.Casting.ID})) {
      /if ((${Bool[${Me.Standing}]}) && (${NearestSpawn[NPC].Distance}>=${Math.Calc[${NearestSpawn[NPC].MaxRange}+${distancetosit}]}) && (${Me.PctHPs}>90)) /sit
      /if ((${Bool[${Me.Sitting}]}) && (!${Window[SpellBookWnd].Open}) && (${NearestSpawn[NPC].Distance}<=${Math.Calc[${NearestSpawn[NPC].MaxRange}+${Math.Calc[${distancetosit}/3]}]})) /stand
   }
   /if ((${Bool[${Me.Standing}]}) && (${autosit}==2) && (${Me.PctMana}<=98) && (${Me.PctHPs}>90) && (!${Me.Casting.ID})) /sit
   /if ((${Bool[${Me.Sitting}]}) && (${autosit}>=1) && (${Me.PctMana}>98) && (!${Window[SpellBookWnd].Open})) /stand
   /if ((${Bool[${Me.Standing}]}) && (!${Me.Mount.ID}) && (${Me.SpellReady[${yaulpspell}]}) && (!${Me.Buff[${yaulpspell}].ID})) {
      /if ((!${Me.Buff[Vallon].ID}) && (!${Me.Buff[Spiritual Vigor].ID}) && (!${Me.Buff[Strength of Tunare].ID})) /call Cast "${yaulpspell}"
   }
   /if (${buffbeg}==1) /call Buffbeg
   /if (${Me.PctHPs}<=${selfhealpoint}) /return
   /if (${Me.PctMana}<=8) /goto :oomwait
/return


Sub CheckHP
|  ${castEndTime} is variable to express time remaining, in deciseconds, from spell_routines.inc
   /if (!${Window[CastingWindow].Open}) /return
   /if ((${interrupt2healself}==1) && (${Target.ID}==${tanknameid})) /if ((${Me.PctHPs}>=90) && (${castEndTime}>=12)) /return
   /if ((${interrupt2healself}==0) && (${Target.ID}==${tanknameid})) /if (${castEndTime}>=12) /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
      }
      /call Interrupt
      /return
   }
   /if ((${interrupt2healself}==1) && (${Target.Name.NotEqual[${Me}]}) && (${Me.PctHPs}<${interrupt2healselfhp})) {
      /if ((${usedivarb}==1) && (${Me.PctHPs}<=${divarbpoint}) && (${Me.AltAbilityReady[Divine Arbitration]})) {
         /call Interrupt
         /call Divarbcast
         /return
      }
      /if ((${announce}==1) && (${duckselfspam}==1)) {
         /g Ducking heal on %T so I can heal my (ChickenShit) self
         /e Ducking heal on ${Target} so I can heal myself
         /varset duckselfspam 0
         /timed 60 /varset duckselfspam 1
      }
      /call Interrupt
      /return
   }
   /if (${onlyhealfd}==1) {
      /if ((${Target.Class.Name.Equal[Necromancer]}) || (${Target.Class.Name.Equal[Monk]})) {
         /if (${Target.State.NotEqual[feign]}) {
            /if ((${announce}==1) && (${duckfdspam}==1)) {
               /g Ducking heal on %T because he isn't staying FD
               /e Ducking heal on ${Target.Name} because he isn't staying FD
               /varset duckfdspam 0
               /timed 40 /varset duckfdspam 1
            }
            /call Interrupt
            /return
         }
      }
   }
   /if ((${usedivarb}==1) && (${Target.PctHPs}<=${divarbpoint}) && (${Target.Distance}<=200) && (${Me.AltAbilityReady[Divine Arbitration]}) && (${castEndTime}>=${interrupt2divarb})) {
      /for gmember 0 to ${Group}
         /if (${Target.ID}==${Group.Member[${gmember}].ID}) {
            /call Interrupt
            /call Divarbcast
            /return
         }
      /next gmember
   }
/return


Sub TrickyDA
   /for intcount 1 to 20
      /if ((${Me.PctHPs}<40) && (${Me.Buff[${trickybuff[${intcount}]}].ID})) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${trickybuff[${intcount}]}].ID}-1].Int} leftmouseup
   /next intcount
   /if (${Me.Buff[${daspell}].ID}) {
      :waitalittle
      /delay 1s ${Me.Buff[${daspell}].Duration}<2
      /if (${Me.Buff[${daspell}].Duration}>=2) /goto :waitalittle
   }
   /varset buffbeg 1
   /call Buffbeg
/return


Sub Buffbeg
   /if (${buffbeg}==0) /return
   /echo Begging for buffs now
   /if ((!${Me.Buff[Voice of Quellious].ID}) && (!${Me.Buff[Tranquility].ID}) && (!${Me.Buff[Koadic's Endless Intellect].ID}) && (!${Me.Buff[Clairvoyance].ID}) && (!${Me.Buff[Voice of Clairvoyance].ID})) {
      /if (${Spawn[pc guild enchanter].ID}) /if (${NearestSpawn[PC guild enchanter].Distance}<=100) {
         /tell ${NearestSpawn[PC guild enchanter]} need C plz
         /delay 20
         /if (${Me.Buff[${daspell}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${daspell}].ID}-1].Int} leftmouseup
      } else /e No guild Enchanter available for C5
   }
   /if ((!${Me.Buff[Protection of the Nine].ID}) && (!${Me.Buff[Blessing of the Nine].ID}) && (!${Me.Buff[Steeloak Skin].ID}) && (!${Me.Buff[Blessing of Steeloak].ID}) && (!${Me.Buff[Virtue].ID}) && (!${Me.Buff[Hand of Virtue].ID}) && (!${Me.Buff[Conviction].ID}) && (!${Me.Buff[Hand of Conviction].ID})) {
      /if (${Spawn[pc guild druid].ID}) /if (${NearestSpawn[PC guild druid].Distance}<=100) {
         /tell ${NearestSpawn[PC guild druid]} need dru crack plz
         /delay 20
         /if (${Me.Buff[${daspell}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${daspell}].ID}-1].Int} leftmouseup
      } else /e No guild Druid available for DRU crack
   }
   /if ((!${Me.Buff[Spiritual Dominion].ID}) && (!${Me.Buff[Spiritual Ascendance].ID})) {
      /if (${Spawn[pc guild beastlord].ID}) /if (${NearestSpawn[PC guild beastlord].Distance}<=100) {
         /tell ${NearestSpawn[PC guild beastlord]} need bst crack plz
         /delay 20
         /if (${Me.Buff[${daspell}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${daspell}].ID}-1].Int} leftmouseup
      } else /e No guild Beastlord available for BST crack
   }
   /if ((!${Me.Buff[Kazad`s Mark].ID}) && (!${Me.Buff[Symbol of Kazad].ID}) && (!${Me.Buff[Symbol of Balikor].ID}) && (!${Me.Buff[Balikor's Mark].ID}) && (!${Me.Buff[Virtue].ID}) && (!${Me.Buff[Hand of Virtue].ID}) && (!${Me.Buff[Conviction].ID}) && (!${Me.Buff[Hand of Conviction].ID})) {
      /if (${Spawn[pc guild cleric].ID}) /if (${NearestSpawn[PC guild cleric].Distance}<=100) {
         /tell ${NearestSpawn[PC guild cleric]} need sym plz
         /delay 20
         /if (${Me.Buff[${daspell}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${daspell}].ID}-1].Int} leftmouseup
      } else /e No guild Cleric available for Symbol
   }
   /if ((!${Me.Buff[Brell's Stalwart Shield].ID}) && (!${Me.Buff[Brell's Brawny Bulwark].ID}) && (!${Me.Buff[Spiritual Vigor].ID}) && (!${Me.Buff[Spiritual Vitality].ID})) {
      /if (${Spawn[pc guild paladin].ID}) /if (${NearestSpawn[PC guild paladin].Distance}<=100) {
         /tell ${NearestSpawn[PC guild paladin]} need BSS plz
         /delay 20
         /if (${Me.Buff[${daspell}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${daspell}].ID}-1].Int} leftmouseup
      } else /e No guild Paladin available for BSS
   }    
   /if ((!${Me.Buff[Shield of Maelin].ID}) && (!${Me.Buff[Focus of the Seventh].ID}) && (!${Me.Buff[Focus of Soul].ID}) && (!${Me.Buff[Wunshi's Focusing].ID}) && (!${Me.Buff[Talisman of Wunshi].ID})) {
      /if (${Spawn[pc guild shaman].ID}) /if (${NearestSpawn[PC guild shaman].Distance}<=100) {
         /tell ${NearestSpawn[PC guild shaman]} need focus plz
         /delay 20
         /if (${Me.Buff[${daspell}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${daspell}].ID}-1].Int} leftmouseup
      } else /e No guild Shaman available for Focus
   }
   /varset buffbeg 0
/return


Sub FindExactPC(string name)
   /declare nameid int local
   /declare counter int local 1
   :FindNext
   /if (!${NearestSpawn[${counter}, pc ${name}].ID}) /return NOT_FOUND
   /varset nameid ${NearestSpawn[${counter}, pc ${name}].ID}
   /if (${Spawn[${nameid}].CleanName.Equal[${name}]}) {
      /target id ${nameid}
      /delay 1s ${Target.ID}==${nameid}
      /if (${Target.ID}==${nameid}) /return TARGET_SUCCESS
   }
   /varcalc counter ${counter}+1
   /if (${NearestSpawn[${counter}, pc ${name}].ID}) /goto :FindNext
/return NOT_FOUND


Sub HealPotUse
|**  Call from a frequent subroutine. Use a variable to trigger it at a specific health
Example of a call for this routine, for use at 15% health as a backup for normal heals:
   /if (!${Defined[healpotpoint]}) /declare healpotpoint int outer 15
   /if (${Me.PctHPs}<=${healpotpoint}) /call HealPotUse
**|

   /if (!${Defined[healpottimer]}) /declare healpottimer int outer 1
   /if (!${Defined[healpotname]}) /declare healpotname string outer NULL
   /if (${healpottimer}==0) /return
   /if (!${FindItem[Healing Potion].ID}) {
      /varset healpotname NULL
      /return
   }
   /if (!${FindItem[=${healpotname}].ID}) /varset healpotname NULL
   /if (${FindItem[=Healing Potion X].ID}) {
      /if (${announce}==1) /g WHEW -----> Healing Potion Used
      /varset healpotname Healing Potion X
      /goto :casthealpot
   }
   /if (${healpotname.Equal[NULL]}) /if (${FindItem[=Healing Potion IX].ID}) /varset healpotname Healing Potion IX
   /if (${healpotname.Equal[NULL]}) /if (${FindItem[=Healing Potion VIII].ID}) /varset healpotname Healing Potion VIII
   /if (${healpotname.Equal[NULL]}) /if (${FindItem[=Healing Potion VII].ID}) /varset healpotname Healing Potion VII
   /if (${healpotname.Equal[NULL]}) /if (${FindItem[=Healing Potion VI].ID}) /varset healpotname Healing Potion VI
   /if (${healpotname.Equal[NULL]}) /if (${FindItem[=Healing Potion V].ID}) /varset healpotname Healing Potion V
   /if (${healpotname.Equal[NULL]}) /if (${FindItem[=Healing Potion IV].ID}) /varset healpotname Healing Potion IV
   /if (${healpotname.Equal[NULL]}) /if (${FindItem[=Healing Potion III].ID}) /varset healpotname Healing Potion III
   /if (${healpotname.Equal[NULL]}) /if (${FindItem[=Healing Potion II].ID}) /varset healpotname Healing Potion II
   /if (${healpotname.Equal[NULL]}) /if (${FindItem[=Healing Potion I].ID}) /varset healpotname Healing Potion I
   :casthealpot
   /call Cast "${healpotname}" item
   /varset healpottimer 0
   /timed 1200 /varset healpottimer 1
/return


Sub ClarPotUse
|**  Call from the rebuff or buffbeg subroutine if no enc clarity effects are available
Example of a call for this routine:
   /if ((!${Me.Buff[Voice of Quellious].ID}) && (!${Me.Buff[Tranquility].ID}) && (!${Me.Buff[Koadic's Endless Intellect].ID}) && (!${Me.Buff[Clairvoyance].ID}) && (!${Me.Buff[Voice of Clairvoyance].ID})) {
      /if ((!${Spawn[PC enchanter].ID}) || (${NearestSpawn[PC enchanter].Distance}>200)) {
         /call ClarPotUse
      }
   }
**|

   /if (!${Defined[clarpottimer]}) /declare clarpottimer int outer 1
   /if (!${Defined[clarpotname]}) /declare clarpotname string outer NULL
   /if (${clarpottimer}==0) /return
   /if (!${FindItem[Elixir of Clarity].ID}) {
      /varset clarpotname NULL
      /return
   }
   /if (!${FindItem[=${clarpotname}].ID}) /varset clarpotname NULL
   /if (${FindItem[=Elixir of Clarity X].ID}) /varset clarpotname Elixir of Clarity X
   /if (${clarpotname.Equal[NULL]}) /if (${FindItem[=Elixir of Clarity IX].ID}) /varset clarpotname Elixir of Clarity IX
   /if (${clarpotname.Equal[NULL]}) /if (${FindItem[=Elixir of Clarity VIII].ID}) /varset clarpotname Elixir of Clarity VIII
   /if (${clarpotname.Equal[NULL]}) /if (${FindItem[=Elixir of Clarity VII].ID}) /varset clarpotname Elixir of Clarity VII
   /if (${clarpotname.Equal[NULL]}) /if (${FindItem[=Elixir of Clarity VI].ID}) /varset clarpotname Elixir of Clarity VI
   /if (${clarpotname.Equal[NULL]}) /if (${FindItem[=Elixir of Clarity V].ID}) /varset clarpotname Elixir of Clarity V
   /if (${clarpotname.Equal[NULL]}) /if (${FindItem[=Elixir of Clarity IV].ID}) /varset clarpotname Elixir of Clarity IV
   /if (${clarpotname.Equal[NULL]}) /if (${FindItem[=Elixir of Clarity III].ID}) /varset clarpotname Elixir of Clarity III
   /if (${clarpotname.Equal[NULL]}) /if (${FindItem[=Elixir of Clarity II].ID}) /varset clarpotname Elixir of Clarity II
   /if (${clarpotname.Equal[NULL]}) /if (${FindItem[=Elixir of Clarity I].ID}) /varset clarpotname Elixir of Clarity I
   /if ((!${Me.Buff[Elixir of Clarity X].ID}) && (!${Me.Buff[Elixir of Clarity IX].ID}) && (!${Me.Buff[Elixir of Clarity VIII].ID}) && (!${Me.Buff[Elixir of Clarity VII].ID}) && (!${Me.Buff[Elixir of Clarity VI].ID}) && (!${Me.Buff[Elixir of Clarity V].ID}) && (!${Me.Buff[Elixir of Clarity IV].ID}) && (!${Me.Buff[Elixir of Clarity III].ID}) && (!${Me.Buff[Elixir of Clarity II].ID}) && (!${Me.Buff[Elixir of Clarity I].ID})) {
      /call Cast "${clarpotname}" item
      /varset clarpottimer 0
      /timed 26700 /varset clarpottimer 1
   }
/return


Sub Event_Chat(string ChatType,string Sender,string ChatText)
   /if ((!${ChatType.Equal[${mychannel}]}) && (!${ChatType.Equal[TELL]}) && (!${ChatType.Equal[group]})) /return
   /if (${usegroupchat}==0) /if (${ChatType.Equal[group]}) /return
   /call ChatParse ${ChatType} ${Sender} "${ChatText}"
/return


Sub Event_IRCchat(string Line,string Sender,string ChatText)
   /call ChatParse IRC ${Sender} "${ChatText}"
/return







And here is the ChatParse.inc

Macro
More +

|  ChatParse.inc for AFCleric by Fantum409

Sub ChatParse(string ChatType,string Sender2,string ChatText)
   /echo ChatType<${ChatType}>, Sender2<${Sender2}>, ChatText<${ChatText}>
   /if (${ChatText.Equal[rezzme]}) {
      /keypress back
      /target ${Sender2}'s Corpse
      /delay 3
      /if (${Target.Type.Equal[corpse]}) {
         /corpse
         /delay 3
         /corpse
         /call Cast "Water Sprinkler of Nem Ankh" item
      }
   }
   /if (${Sender2.Equal[${Me}]}) /return
  | /if (!${Spawn[${Sender2}].ID}) {
   |   /e ${Sender2} is not in the zone
    |  /return
   }
   /if ((${ChatText.Equal[Follow me]}) && (${Sender2.NotEqual[${Me}]})) {
      /delay 5
      /if (!${Spawn[${Sender2}].ID}) {
         /e ${Sender2} is not in zone for me to follow!
         /return
      }
      /varset follname ${Sender2}
      /varset following 1
      :targetfoll
      /target pc ${follname}
      /delay 1s ${Target.Name.Equal[${follname}]}
      /if (${Target.Name.Equal[${follname}]}) {
         /goto :Loop
      } else /goto :targetfoll
      :Loop
      /face fast
      /if (${Target.Distance}>10) /keypress forward hold
      /if (${Target.Distance}<9) /keypress back
      /if (!${Target.ID}) /varset following 0
      /call CheckEvents
      /if ((${Target.Name.Equal[${follname}]}) && (${following}>0)) {
         /goto :Loop
      } else {
         /keypress forward
         /keypress back
      }
   }
   /if (${ChatText.Equal[End follow]}) {
      /varset following 0
      /keypress forward
      /keypress back
      /timed 50 /face pc ${follname}
   }
   /if (${ChatText.Equal[Gbuff now!]}) {
      /if (${edbuffItem.Name.NotEqual[NULL]}) /call EquipItem "${edbuffitem}"
      /if (${edbuffItem.Name.NotEqual[NULL]}) /varset olditem ${Macro.Return}
      /varset pallycount 0
      /target myself
      /if (${groupspellhastebuff.NotEqual[NULL]}) /call Cast "${groupspellhastebuff}" gem8 5s
      /call Cast "${acbuff}" gem6 7s
      /if (${groupspellhastebuff.Equal[NULL]}) {
         /if (${FindItem[Breastplate of Vengeful Fury].ID}) /call Cast "Breastplate of Vengeful Fury" item
         /if (!${FindItem[Breastplate of Vengeful Fury].ID}) /call Cast "${spellhastebuff}" gem8 5s
      }
      /for gmember 1 to ${Group}
         /target id ${Group.Member[${gmember}].ID}
         /delay 1s ${Target.ID}==${Group.Member[${gmember}].ID}
         /if (${Target.ID}==${Group.Member[${gmember}].ID}) {
            /if (${Target.Class.Name.NotEqual[Paladin]}) /call Cast "${acbuff}" gem5 7s
            /if (${Target.Class.Name.Equal[Paladin]}) {
               /call Cast "${longhpbuff}" gem5 10s
               /varcalc pallycount ${pallycount}+1
            }
            /if (${groupspellhastebuff.Equal[NULL]}) /if ((${Target.Class.Name.NotEqual[Warrior]}) && (${Target.Class.Name.NotEqual[Monk]}) &&(${Target.Class.Name.NotEqual[Rogue]})&& (${Target.Class.Name.NotEqual[Berserker]}) && (${Target.Class.Name.NotEqual[Bard]})) {
               /if (${FindItem[Breastplate of Vengeful Fury].ID}) /call Cast "Breastplate of Vengeful Fury" item
               /if (!${FindItem[Breastplate of Vengeful Fury].ID}) /call Cast "${spellhastebuff}" gem8 5s
            }
         }
      /next gmember
      /if ((${Math.Calc[${Group}-${pallycount}]}>=2) && (${groupsymbuff.NotEqual[NULL]})) /call Cast "${groupsymbuff}" gem5 10s
      /if ((${Math.Calc[${Group}-${pallycount}]}<2) || (${groupsymbuff.Equal[NULL]})) {
         /for gmember 0 to ${Group}
            /target id ${Group.Member[${gmember}].ID}
            /delay 1s ${Target.ID}==${Group.Member[${gmember}].ID}
            /if (${Target.Class.Name.NotEqual[Paladin]}) /call Cast "${singlesymbuff}" gem5 7s
         /next gmember
      }
      /if (${edbuffItem.Name.NotEqual[NULL]}) /call EquipItem ${olditem}
   }  
   /if (${ChatText.Equal[BoR now!]}) {
      /if (${edbuffItem.Name.NotEqual[NULL]}) /call EquipItem "${edbuffitem}"
      /if (${edbuffItem.Name.NotEqual[NULL]}) /varset olditem ${Macro.Return}
      /target myself
      /delay 5 ${Target.Name.Equal[${Me}]}
      /if (${groupspellhastebuff.Equal[NULL]}) {
         /if (${FindItem[Breastplate of Vengeful Fury].ID}) /call Cast "Breastplate of Vengeful Fury" item
         /if (!${FindItem[Breastplate of Vengeful Fury].ID}) /call Cast "${spellhastebuff}" gem8 5s
         /for gmember 1 to ${Group}
            /target id ${Group.Member[${gmember}].ID}
            /delay 1s ${Target.ID}==${Group.Member[${gmember}].ID}
            /if (${Target.ID}==${Group.Member[${gmember}].ID}) {
               /if ((${Target.Class.Name.NotEqual[Warrior]}) && (${Target.Class.Name.NotEqual[Monk]}) && (${Target.Class.Name.NotEqual[Rogue]}) && (${Target.Class.Name.NotEqual[Berserker]}) && (${Target.Class.Name.NotEqual[Bard]})) {
                  /if (${FindItem[Breastplate of Vengeful Fury].ID}) /call Cast "Breastplate of Vengeful Fury" item
                  /if (!${FindItem[Breastplate of Vengeful Fury].ID}) /call Cast "${spellhastebuff}" gem8 5s
               }
            }
         /next gmember
      }
      /if (${groupspellhastebuff.NotEqual[NULL]}) /call Cast "${groupspellhastebuff}" gem8 5s
      /if (${edbuffItem.Name.NotEqual[NULL]}) /call EquipItem ${olditem}
   }  
   /if (${ChatText.Equal[nuke]}) {
      /if (${Me.PctMana}<30) {
         /if (${usegroupchat}==0) /i say Cleric Mana ${Me.PctMana}%, holding on nukes!
         /if (${usegroupchat}==1) /g Cleric Mana ${Me.PctMana}%, holding on nukes!
      } else {
         /assist ${Sender2}
         /delay 5
         /if (${Target.Type.NotEqual[NPC]}) {
            /assist ${Sender2}
            /delay 5 ${Target.Type.Equal[NPC]}
         }
         /if ((${Target.Type.Equal[NPC]}) && (${Target.PctHPs}<=90)) {
            /if (${Me.SpellReady[${nukeone}]}) {
               /if (${announce}==1) /g Casting ${nukeone} on %T
               /call Cast "${nukeone}" spell 3s
            } else /if (${Me.SpellReady[${nuketwo}]}) {
               /if (${announce}==1) /g Casting ${nuketwo} on %T
               /call Cast "${nuketwo}" spell 3s
            } else {
               /if (${usegroupchat}==0) /i say nukes not ready
               /if (${usegroupchat}==1) /g nukes not ready
            }
            /if (${Me.PctMana}<=60) {
               /if (${usegroupchat}==0) /i say FYI Cleric Mana ${Me.PctMana}%
               /if (${usegroupchat}==1) /g FYI Cleric Mana ${Me.PctMana}%
            }
         } else {
            /if (${usegroupchat}==0) /i say wrong target (${Target.Type} at ${Target.PctHPs}% HP)
            /if (${usegroupchat}==1) /g wrong target (${Target.Type} at ${Target.PctHPs}% HP)
         }
      }
   }
   /if (${ChatText.Equal[stun]}) {
      /assist ${Sender2}
      /delay 5
      /if (${Target.Type.NotEqual[NPC]}) {
         /assist ${Sender2}
         /delay 5 ${Target.Type.Equal[NPC]}
      }
      /if ((${Target.Type.Equal[NPC]}) && (${Target.PctHPs}<=90)) {
         /if (${Me.SpellReady[${stunone}]}) {
            /if (${announce}==1) /g Casting ${stunone} on %T
            /call Cast "${stunone}" spell 3s
         } else /if (${Me.SpellReady[${stuntwo}]}) {
            /if (${announce}==1) /g Casting ${stuntwo} on %T
            /call Cast "${stuntwo}" spell 3s
         } else {
            /if (${usegroupchat}==0) /i say stuns not ready
            /if (${usegroupchat}==1) /g stuns not ready
         }
      } else {
         /if (${usegroupchat}==0) /i say wrong target (${Target.Type} at ${Target.PctHPs}% HP)
         /if (${usegroupchat}==1) /g wrong target (${Target.Type} at ${Target.PctHPs}% HP)
      }
   }
   /if (${ChatText.Equal[buffme]}) {
      /call FindExactPC ${Sender2}
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /if (${edbuffItem.Name.NotEqual[NULL]}) /call EquipItem "${edbuffitem}"
      /if (${edbuffItem.Name.NotEqual[NULL]}) /varset olditem ${Macro.Return}
      /if (${Target.Class.Name.Equal[Paladin]}) {
         /call Cast "${longhpbuff}" gem5 10s
         /if (${FindItem[Breastplate of Vengeful Fury].ID}) /call Cast "Breastplate of Vengeful Fury" item
         /if (!${FindItem[Breastplate of Vengeful Fury].ID}) /call Cast "${spellhastebuff}" gem8 5s
         /return
      }
      /if ((${Target.Class.Name.NotEqual[Warrior]}) && (${Target.Class.Name.NotEqual[Monk]}) && (${Target.Class.Name.NotEqual[Rogue]}) && (${Target.Class.Name.NotEqual[Berserker]}) && (${Target.Class.Name.NotEqual[Bard]})) {
         /if (${FindItem[Breastplate of Vengeful Fury].ID}) /call Cast "Breastplate of Vengeful Fury" item
         /if (!${FindItem[Breastplate of Vengeful Fury].ID}) /call Cast "${spellhastebuff}" gem8 5s
      }
      /call Cast "${acbuff}" gem6 7s
      /call Cast "${singlesymbuff}" gem5 7s
      /if (${edbuffItem.Name.NotEqual[NULL]}) /call EquipItem ${olditem}
   }
   /if (${ChatText.Equal[sym]}) {
      /call FindExactPC ${Sender2}
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /if (${edbuffItem.Name.NotEqual[NULL]}) /call EquipItem "${edbuffitem}"
      /if (${edbuffItem.Name.NotEqual[NULL]}) /varset olditem ${Macro.Return}
      /call Cast "${singlesymbuff}" gem5 7s
      /if (${edbuffItem.Name.NotEqual[NULL]}) /call EquipItem ${olditem}
   }
   /if (${ChatText.Equal[stigwilf]}) {
      /call FindExactPC ${Sender2}
      /gu tito la grosse tapette
   }
   /if (${ChatText.Equal[wog]}) {
      /call FindExactPC ${Sender2}
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /if (${edbuffItem.Name.NotEqual[NULL]}) /call EquipItem "${edbuffitem}"
      /if (${edbuffItem.Name.NotEqual[NULL]}) /varset olditem ${Macro.Return}
      /call Cast "${acbuff}" gem6 7s
      /if (${edbuffItem.Name.NotEqual[NULL]}) /call EquipItem ${olditem}
   }
   /if ((${ChatText.Equal[V]}) || (${ChatText.Equal[conv]})) {
      /call FindExactPC ${Sender2}
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /if (${edbuffItem.Name.NotEqual[NULL]}) /call EquipItem "${edbuffitem}"
      /if (${edbuffItem.Name.NotEqual[NULL]}) /varset olditem ${Macro.Return}
      /call Cast "${longhpbuff}" gem5 10s
      /if (${edbuffItem.Name.NotEqual[NULL]}) /call EquipItem ${olditem}
   }
   /if (${ChatText.Equal[bor]}) {
      /call FindExactPC ${Sender2}
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /if (${edbuffItem.Name.NotEqual[NULL]}) /call EquipItem "${edbuffitem}"
      /if (${edbuffItem.Name.NotEqual[NULL]}) /varset olditem ${Macro.Return}
      /if (${FindItem[Breastplate of Vengeful Fury].ID}) /call Cast "Breastplate of Vengeful Fury" item
      /if (!${FindItem[Breastplate of Vengeful Fury].ID}) /call Cast "${spellhastebuff}" gem8 5s
      /if (${edbuffItem.Name.NotEqual[NULL]}) /call EquipItem ${olditem}
   }
   /if (${ChatText.Equal[rgc]}) {
      /call FindExactPC ${Sender2}
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /if (${FindItem[Blackflame Sphere].ID}) {
         /call Cast "Blackflame Sphere" item
      } else /if (${FindItem[Wand of Casual Blessings].ID}) {
         /call Cast "Wand of Casual Blessings" item
      } else /call Cast "${rgcspell}" gem8 5s
   }
   /if (${ChatText.Equal[di]}) {
      /call FindExactPC ${Sender2}
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /if (${edbuffItem.Name.NotEqual[NULL]}) /call EquipItem "${edbuffitem}"
      /if (${edbuffItem.Name.NotEqual[NULL]}) /varset olditem ${Macro.Return}
      /call Cast "Divine Intervention" gem8 3s
      /if (${edbuffItem.Name.NotEqual[NULL]}) /call EquipItem ${olditem}
   }
   /if (${ChatText.Equal[vie]}) {
      /call FindExactPC ${Sender2}
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /if (${edbuffItem.Name.NotEqual[NULL]}) /call EquipItem "${edbuffitem}"
      /if (${edbuffItem.Name.NotEqual[NULL]}) /varset olditem ${Macro.Return}
      /call Cast "Panoply of Vie" gem6 5s
      /if (${edbuffItem.Name.NotEqual[NULL]}) /call EquipItem ${olditem}
   }
   /if (${ChatText.Equal[pb]}) {
      /call FindExactPC ${Sender2}
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /call Cast "Pure Blood" gem6 10s
   }
   /if (${ChatText.Equal[hot me]}) {
      /call FindExactPC ${Sender2}
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /if (${Target.Distance}<=${hotspellrange}) {
         /if (${edbuffItem.Name.NotEqual[NULL]}) /call EquipItem "${edbuffitem}"
         /if (${edbuffItem.Name.NotEqual[NULL]}) /varset olditem ${Macro.Return}
         /if (${announce}==1) /g Casting ${hotspell} on %T
         /call Cast "${hotspell}" gem2 2s
         /if (${edbuffItem.Name.NotEqual[NULL]}) /call EquipItem ${olditem}
         /delay 15 ${Me.
                 
                 
                 
                 SpellReady[${hotspell}]}
      } else /tell ${Sender2} your OOR
   }
   /if (${ChatText.Equal[ch me]}) {
      /call FindExactPC ${Sender2}
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /if (${Target.Distance}<=100) {
         /if (${announce}==1) /g Casting Complete Healing on %T
         /call Cast "Complete Healing" gem2 5s
         /delay 15 ${Me.SpellReady[${hotspell}]}
      } else /tell ${Sender2} your OOR
   }
   /if ((${ChatText.Equal[patch me]}) || (${ChatText.Equal[heal]}) || (${ChatText.Equal[heal me]}) || (${ChatText.Equal[heal plz]}) || (${ChatText.Equal[heal me plz]}) || (${ChatText.Equal[need heal]})) {
      /call FindExactPC ${Sender2}
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /if (${Target.Distance}<=${patchhealrange}) {
         /if (${announce}==1) /g Casting ${patchheal} on %T
         /call Cast "${patchheal}" gem2 2s
         /delay 15 ${Me.SpellReady[${patchheal}]}
      } else /tell ${Sender2} your OOR
   }
   /if (${ChatText.Equal[buff pet]}) {
      /if (${edbuffItem.Name.NotEqual[NULL]}) /call EquipItem "${edbuffitem}"
      /if (${edbuffItem.Name.NotEqual[NULL]}) /varset olditem ${Macro.Return}
      /target ${Spawn[pc ${Sender2}].Pet}
      /delay 8
      /target ${Spawn[pc ${Sender2}].Pet}
      /call Cast "${acbuff}" gem6 7s
      /call Cast "${singlesymbuff}" gem5 7s
      /if (${edbuffItem.Name.NotEqual[NULL]}) /call EquipItem ${olditem}
   }
   /if (${ChatText.Equal[da pet]}) {
      /target ${Spawn[pc ${Sender2}].Pet}
      /delay 6
      /target ${Spawn[pc ${Sender2}].Pet}
      /if (${Me.AltAbilityReady[39]}) /if (${Target.Name.Equal[${Spawn[pc ${Sender2}].Pet.Name}]}) {
         /call Cast "39" alt
      } else {
         /if (${usegroupchat}==0) /i say Bestow Divine Aura is not ready, or Target (%T) OOR or wrong target
         /if (${usegroupchat}==1) /g Bestow Divine Aura is not ready, or Target (%T) OOR or wrong target
      }
   }
   /if (${ChatText.Equal[hot pet]}) {
      /target ${Spawn[pc ${Sender2}].Pet}
      /delay 6
      /target ${Spawn[pc ${Sender2}].Pet}
      /if (${Target.Name.Equal[${Spawn[pc ${Sender2}].Pet.Name}]}) {
         /if (${Target.Distance}<=${hotspellrange}) {
       /if (${edbuffItem.Name.NotEqual[NULL]}) /call EquipItem "${edbuffitem}"
       /if (${edbuffItem.Name.NotEqual[NULL]}) /varset olditem ${Macro.Return}
       /if (${announce}==1) /g Casting ${hotspell} on %T
       /call Cast "${hotspell}" gem2 2s
       /if (${edbuffItem.Name.NotEqual[NULL]}) /call EquipItem ${olditem}
       /delay 15 ${Me.SpellReady[${hotspell}]}
         } else /tell ${Sender2} your pet is OOR
      }
   }
   /if (${ChatText.Equal[mana check]}) {
      /if (${usegroupchat}==0) /i say Cleric Mana ${Me.PctMana}%
      /if (${usegroupchat}==1) /g Cleric Mana ${Me.PctMana}%
   }
   /if (${ChatText.Equal[manapoll]}) {
      /if (${usegroupchat}==0) /i say ${Me.PctMana}%
      /if (${usegroupchat}==1) /g ${Me.PctMana}%
   }
   /if (${ChatText.Equal[slowcamp]}) {
      /if (${Me.Standing}) /sit
      /delay 5m ${Me.PctMana}>=98
      /camp
      /end
   }
   /if (${ChatText.Equal[AE-time]}) {
      /varset aetime 1
      /if (${usegroupchat}==0) /i say AE activated!
      /if (${usegroupchat}==1) /g AE activated!
      :aeloop
      /if (${NearestSpawn[4, npc].Distance}<35) {
         /if (${Me.SpellReady[Catastrophe]}) /call Cast "Catastrophe" spell 3s
         /if (${Me.SpellReady[Upheaval]}) /call Cast "Upheaval" spell 3s
         /if (${Me.SpellReady[The Unspoken Word]}) /call Cast "The Unspoken Word" spell 3s
      }
      /call CheckEvents
      /if (${Me.PctHPs}<60) {
         /varset aetime 0
         /if (${usegroupchat}==0) /i say Stopping AE due to low HP
         /if (${usegroupchat}==1) /g Stopping AE due to low HP
      }
      /if (${NearestSpawn[4, npc].Distance}>100) {
         /varset aetime 0
         /if (${usegroupchat}==0) /i say Stopping AE since not enough mobs in range
         /if (${usegroupchat}==1) /g Stopping AE since not enough mobs in range
      }
      /if (${aetime}==1) /goto :aeloop
   }
   /if (${ChatText.Equal[stop AE]}) {
      /varset aetime 0
      /if (${usegroupchat}==0) /i say AE DE-activated
      /if (${usegroupchat}==1) /g AE DE-activated
   }
   /if (${ChatText.Equal[manastone time]}) {
      /varset manastonecycle 1
      /call EquipItem "Manastone|mainhand"
      /varset oldprimary ${Macro.Return}
      :manastoneuse
      /if ((${Me.PctHPs}>=50) && (${Me.PctMana}<=98) && (${manastonecycle}==1)) {
         /call Cast "Manastone" item
         /call Cast "Manastone" item
         /call Cast "Manastone" item
      }
      /delay 1
      /doevents
      /if (${manastonecycle}==1) /goto :manastoneuse
      /call EquipItem ${oldprimary}
   }
   /if (${ChatText.Equal[manastone stop]}) {
      /varset manastonecycle 0
      /return
   }
   /if (${ChatText.Equal[rc]}) {
      /if (${Me.AltAbilityReady[390]}) /call Cast "390" alt
   }
   /if (${ChatText.Equal[silence fewls]}) {
      /varset announce 0
   }
   /if (${ChatText.Equal[speak up]}) {
      /varset announce 1
   }
/return
Fri May 13, 2011 12:20 am
I have already posted a working version of this specific macro
_________________
Sorvani
Fri May 13, 2011 7:26 am
Senior Project Member
i'll try tonight with your version.

I'm just angry with this one because i can't figure what's not working, and i don't like to capitulate :p
Fri May 13, 2011 7:58 am
I have experienced variables NULL ing out in Event_Chat on UF as well. I don't have the exact code in front of me (sorry sorvani) but I think this would cause the failure on my setup.

Macro
More +
#Chat tell

Sub Main
   :Loop
   /doevents
   /goto :Loop
/return

Sub Event_Chat(string ChatType,string Sender,string ChatText)
   /echo /tell ${Sender} You said: ${ChatText}
   /tell ${Sender} You said: ${ChatText}
/return


The echo line would appear perfect but the tell would fail with "You told ,' is not online at this time.'"
Fri May 13, 2011 12:43 pm
Goto page 1, 2, 3  Next Public Macros Spawn & NearestSpwan issu
Reply