Macro Not Running Right, Take a Look?

BuffBot

Once You Go Hack, You Never Go Back
Joined
Oct 14, 2006
Messages
417
Reaction score
0
Points
16
Hey all, I had someone reply to me in PM about letting me use their macro for their shaman and it is not working correctly and he has not responded to the PM I sent him. I have very little knowledge in writing macros, and I just wanted to post this so that maybe you can tell me why it's not working correctly.

All it does when I turn it on (it recognizes the MT) then coninuously casts buffs. It will assist the MT and target the mob and sit there casting Talisman of Celerity on it and nothing else. Doesn't even slow or attempt to slow.

Basically, I wanted my macro to just Assist MT, Slow, Keep Buffs up, Canni. Don't really care about anything else.

Credit to memset for this macro.
Code:
#Event SetTank "#1# tells you, 'settank #2# #3#'"

|################################################
Sub Main
| Define your MainTank... this is changeable while the macro is running by having new main tank /tell you: secretphrase (see below)
/declare MainTank string outer Tank Name Here 
/declare SecretPhrase string outer Phrase Here  

| Define your Spells...
/declare Spell_LANGUOR string outer "Talisman of Fortitude"
/declare Spell_COUGAR string outer "Talisman of the Panther"
/declare Spell_CHAMPION string outer "Champion"
/declare Spell_HASTE string outer "Talisman of Celerity"
/declare Spell_GROWTH string outer "Dire Focusing"
/declare Spell_CANNI string outer "Ancestral Bargain"
/declare Spell_HOT string outer "Halcyon Whisper Rk. II"
/declare Spell_PATCH string outer "Ahnkaul's Mending Rk. II"
/declare Spell_SLOW string outer "Turger's Insects"
/declare AA_Malo string outer "Malosinete"
/declare ITEM_Epic string outer "Crafted Talisman of Fates"

| Define what % mana you feel you should canni.
/declare MinMana int outer 90

| Define if you want to HoT (heal over time) or not. Also define what % health you want to HoT the MT.
/declare DoHOT bool outer FALSE
/declare DoHOTPercent int outer 85

| Define if you want to PATCH heal or not. Also define what % health you want to heal the MT.
/declare DoPATCH bool outer FALSE
/declare DoPATCHPercent int outer 70

| Define if you want to auto-slow mobs or not. Also define what % health you want to slow the mob.
/declare DoSLOW bool outer TRUE
/declare DoSLOWPercent int outer 98

| Define if we want to malo mobs or not.
/declare DoAAMalo bool outer False

|
| Don't need to edit below this line!
|

| Lets see if a MT was passed as an argument to the macro.
/if (${Defined[Param0]}) {
| We have a MT passed, lets use that instead of our default!
/varset MainTank ${Param0}
}

/echo Loaded Short Duration Buffs v1.0 by memset
/echo MAIN TANK: ${MainTank}
/echo CANNI AT %: ${MinMana}% Mana

/if (${DoHOT}) {
/echo HOT AT %: ${DoHOTPercent}%
}

/if (${DoPATCH}) {
/echo PATCH AT %: ${DoPATCHPercent}%
}

| Check if MQ2Cast plugin is loaded, if it isn't... load it automatically. 
/if (!${Plugin[MQ2Cast].Name.Equal[mq2cast]}) /squelch /plugin MQ2Cast nocheck


|################################################
| START OF LOOP
:start
/doevents

/call GMCheck

|################################################
| Target our MT.
/target ${MainTank}
/delay 1s

|################################################
| Make sure we have a target before continuing.
/if (!${Target.ID}) {
/goto :start
}

|################################################
| Next, make sure we aren't invisible... if we ARE, don't cast anything.
/if (${Me.Invis}) {
/goto :start
}

|################################################
| Also, if we are MOVING... we don't need to cast anything. Will be pointless.
/if (${Me.Moving}) {
/goto :start
}

|################################################
| Finally, see if we're casting or not. This was added LATER... so it's slightly redundant below. Clean up later.
| /if (${Me.Casting.ID}) /goto :start

|################################################
| Lets first make sure we don't need to heal the MT.
| Do we need to PATCH heal the MT?
/if (${Target.PctHPs} <= ${DoPATCHPercent} && ${DoPATCH}) {
| It seems so. Better heal! Is the spell ready? Make sure we're not casting already...
/if (!${Me.Casting.ID} && ${Me.SpellReady[${Spell_PATCH}]} && ${Target.Distance} < 100) {
/echo Healing ${MainTank} with ${Spell_PATCH}!
/casting ${Spell_PATCH}
/delay 2.5
}
}

| Do we need to HoT the MT?
/if (${Target.PctHPs} <= ${DoHOTPercent} && ${DoHOT}) {
| It seems so. Better heal! Is the spell ready? Make sure we're not casting already...
/if (!${Me.Casting.ID} && ${Me.SpellReady[${Spell_HOT}]} && ${Target.Distance} < 100 && !${Target.Buff[${Spell_HOT}].Duration}) {
/echo Healing ${MainTank} with ${Spell_HOT}!
/casting ${Spell_HOT}
/delay 2.5
}
}

| There's a possibility that the shaman running this macro could be in need of a heal from canni... check now!
/if (${Me.PctHPs} <= 80) {
/target ${Me.CleanName}
/delay 1s
/casting ${Spell_PATCH}
/delay 2.5
/target ${MainTank}
/delay 1s
}

|################################################
| Lets see if the mob is malo'd... if not, and we're supposed to, then malo it.
/if (${DoAAMalo} && ${Me.AltAbilityReady[${AA_Malo}]}) {
| Yes... see if mob is malo'd already.
/assist ${MainTank}
/delay 1s
/if (${Target.Buff[${AA_Malo}].Duration.Ticks} < 1 && ${Target.Type.Equal[NPC]} && ${Target.Distance} < 100 && ${Target.PctHPs} <= ${DoSLOWPercent}) {
| Ok... malo the mob!
/echo Malo'ing ${Target.CleanName} with ${AA_Malo}
/aa act Malosinete
/delay 4s
}
}

|################################################
| Now lets check if we need to slow a mob!
/if (${DoSLOW}) {
| Ok, we need to slow....maybe. Assist MT, check if it has been slowed already with our spell. Also verify it's an NPC.
/assist ${MainTank}
/delay 1s
/if (${Target.Type.Equal[NPC]}) {
| Verified this IS an NPC.
| Check HP's... and if we've slowed already or not.
/if (${Target.PctHPs} <= ${DoSLOWPercent} && !${Target.BuffDuration[${Spell_SLOW}]} && !${Me.Casting.ID} && ${Target.Distance} < 100 && ${Me.SpellReady[${Spell_SLOW}]}) {
| HP's match and the mob isn't slow and I'm not casting... AND it's within range. lets slow this mob.
/echo Slowing ${Target.CleanName} with ${Spell_SLOW}!
/casting ${Spell_SLOW}
/delay 1.5s
/target pc ${MainTank}
/delay 1s
}
}
/target ${MainTank}
/delay 1s
}

|################################################
| Check if we need to rebuff LANGUOR:
/if (${Target.BuffDuration[${Spell_LANGUOR}]} < 15 && ${Target.Distance}<100) {
| Am I currently casting a spell? And is the spell ready?
/if (!${Me.Casting.ID} && ${Me.SpellReady[${Spell_LANGUOR}]}) {
| Good to go! Cast!
| /casting uses plugin mq2cast.
/echo Casting ${Spell_LANGUOR} on ${Target.CleanName}!
/casting ${Spell_LANGUOR}
/delay 2s
}
}

|################################################
| Check if we need to rebuff CHAMPION:
/if (${Target.BuffDuration[${Spell_CHAMPION}]} < 15 && ${Target.Distance}<100) {
| Am I currently casting a spell? And is the spell ready?
/if (!${Me.Casting.ID} && ${Me.SpellReady[${Spell_CHAMPION}]}) {
| Good to go! Cast!
| /casting uses plugin mq2cast.
/echo Casting ${Spell_CHAMPION} on ${Target.CleanName}!
/casting ${Spell_CHAMPION}
/delay 2s
}
}

|################################################
| Check if we need to rebuff COUGAR:
/if (!${Target.BuffDuration[${Spell_COUGAR}]} && ${Target.Distance} < 50) {
| Am I currently casting a spell? And is the spell ready?
/if (!${Me.Casting.ID} && ${Me.SpellReady[${Spell_COUGAR}]}) {
| Before we cast, lets make it so it only casts if MT has a mob targeted and the mob is closeby..
/assist ${MainTank}
/delay 1s

/if (${Target.Distance} < 100 && ${Target.CleanName.NotEqual[${MainTank}]}) {
| Good to go! Cast!
/target ${MainTank}
/delay 1s
/echo Casting ${Spell_COUGAR} on ${Target.CleanName}!
/casting ${Spell_COUGAR}
/delay 4s
}
}
}

|################################################
| Check if we need to CLICK EPIC:
/if (${FindItem[${ITEM_Epic}].Timer} == 0) {
| Epic clicky is ready... do we need to click it?
/assist ${MainTank}
/delay 8
/if (${Target.Distance} < 100 && ${Target.Type.Equal[NPC]}) {
| Yep. Lets click it!
/casting ${ITEM_Epic}
/delay 1s
}
}

|################################################
| Check if we need to rebuff HASTE:
/if (!${Target.BuffDuration[${Spell_HASTE}]} && ${Target.Distance}<100) {
| Am I currently casting a spell? And is the spell ready?
/if (!${Me.Casting.ID} && ${Me.SpellReady[${Spell_HASTE}]}) {
| Good to go! Cast!
| /casting uses plugin mq2cast.
/echo Casting ${Spell_HASTE} on ${Target.CleanName}!
/casting ${Spell_HASTE}
/delay 4s
}
}

|################################################
| Check if we need to rebuff GROWTH:
/if (${Target.BuffDuration[${Spell_GROWTH}]} <= 15 && ${Target.Distance}<100) {
| Am I currently casting a spell? And is the spell ready?
/if (!${Me.Casting.ID} && ${Me.SpellReady[${Spell_GROWTH}]}) {
| Good to go! Cast!
| /casting uses plugin mq2cast.
/echo Casting ${Spell_GROWTH} on ${Target.CleanName}!
/casting ${Spell_GROWTH}
/delay 2s
}
}

|################################################
| Check if we need to cannibilize:
/if (${Me.PctMana} <= ${MinMana} && ${Me.SpellReady[${Spell_CANNI}]}) {
| Less than or equal to minimum percent of mana... lets canni.
/echo Casting ${Spell_CANNI}!
/casting ${Spell_CANNI}
/delay 1s
/if (${Me.AltAbilityReady[Cannibalization]} && ${Me.CurrentMana}<(${Me.MaxMana}-1200) && ${Me.MaxHPs}>2424) /casting "Cannibalization" alt 

}


/delay 1s
/goto :start
/return


|################################################
Sub Event_SetTank(line, sender, new_tank, secretphrase)
/if (${secretphrase.Equal[${SecretPhrase}]}) {
/echo ${sender} sent secret phrase, setting ${new_tank} as tank!
/varset MainTank ${new_tank}
/target ${MainTank}
/delay 1s
}
/return

|################################################
Sub GMCheck 
/if (${Spawn[gm].ID}) { 
/beep 
/beep 
/beep 
/echo GM has entered the zone! 
/echo FUCK HIM but ending the macro... 
/keypress forward 
/keypress back 
/quit 
/endmacro 
} 
/return
 
Last edited:
Because your macro says to chain cast haste if an NPC is on target. That is how it is written.

This is one of the many reasons to use individual subs in a mac.

This coding will only work right if you keep the main assist targeted at all times.

This is telling it that if its target does not have haste buff icon, to haste it. It never does a ${Target.Type.NotEqual[npc]} type of check, but it should really have a && ${Target.Name}==${MainTank} type of check. Hell, id scrap that and do ID anyway.

Add the line below and it should resolve that single issue:
Code:
|################################################
| Check if we need to rebuff HASTE:
/if (!${Target.BuffDuration[${Spell_HASTE}]} && ${Target.Distance}<100 [COLOR=red]&& ${Target.ID}==${Spawn[${MainTank}].ID}[/COLOR]) {
| Am I currently casting a spell? And is the spell ready?
/if (!${Me.Casting.ID} && ${Me.SpellReady[${Spell_HASTE}]}) {
| Good to go! Cast!
| /casting uses plugin mq2cast.
/echo Casting ${Spell_HASTE} on ${Target.CleanName}!
/casting ${Spell_HASTE}
/delay 4s
}
}
 
Last edited:
Thanks, I will give that a try and let you know how it goes!
 
Okay that took care of it thanks.

However, now that I am fighting mobs. My new issue is that the shaman does not hold the target of the mob once it assists. It will continually switch back and forth between the mob and then the main tank without ever casting slow. Any advice on how to get the shaman to cast slow until it lands and THEN switch back to main tank?
 
Okay, so basically it's back to doing the same thing. Just continues to cast haste. Doesn't slow at all. Frustrating.
 
I would change
Code:
/if (!${Target.BuffDuration[${Spell_HASTE}]} && ${Target.Distance}<100) {
to
Code:
/if (!${Target.Buff[${Spell_HASTE}.ID]} && ${Target.Distance}<100) {
and
Code:
/if (${Target.PctHPs} <= ${DoSLOWPercent} && !${Target.BuffDuration[${Spell_SLOW}]} && !${Me.Casting.ID} && ${Target.Distance} < 100 && ${Me.SpellReady[${Spell_SLOW}]}) {

to

Code:
/if (${Target.PctHPs} <= ${DoSLOWPercent} && !${Target.Buff[${Spell_SLOW}].ID} && !${Me.Casting.ID} && ${Target.Distance} < 100 && ${Me.SpellReady[${Spell_SLOW}]}) {
 
Last edited:
Frankly I would scrap the macro and use a different one for what you want. That's not to say the author didn't make a good mac, it just doesn't fit your situation.

The KISS mac isn't really designed for what you are talking about. and without subs you can't really set the variables you need to set.

Nils' sham mac on the VIP boards does everything and has an .ini for easy use. The downside to his mac is that if you have the shaman outside the group, it doesn't heal the tank well at all. It only targets the tank when a rebuff is due, thus never seeing his health the way its written.

Nils: http://www.macroquest2.com/phpBB2/viewtopic.php?t=14510

I had started writing some macs and snippets for healers and other classes, but i haven't really gotten around to testing/posting them. Maybe I'll get around to those this month.

It gets very complicated to check for pets, tank, second tank, self, etc and even more so to do that from outside a group. Then you want to do all that without making it flash between targets nonstop, but still monitor the health. And then if you want to have different types of tanks (pet, merc, pc, npc charmed pet) or tanks that have swarm pets named like: PeteSampras's pet it screws with the /target process that much more.

A good set of heal routines is probably longer than your entire mac.
 
Thanks, I have looked at Nihls shaman mac and looking at it confuses the crap out of me. I really don't even know where to begin. Normally, I can look at a mac and understand what to edit, how to run it etc...but on his I have no clue where to even begin.
 
The beauty of nils is that you just change your .ini settings to the right thing and it works. You never touch the macro itself. No recoding needed. Unity is a special case buff that youll need to hardcode via the ID number, but that is listed on the threads somewhere.
 
buffbot. what buff do u want to cast on ur group and what aa u want to use .?
u post here. i will edit a mac for u .
gem 1 = what buff
gem 2 = what buff
gem 3 = .......etc...............
 
Basically, I wanted my macro to just Assist MT, Slow, Keep Buffs up, Canni. Don't really care about anything else.

My tweak of Dev's magebot will assist MT for debuffs, nukes, dots, keeps buffs on group and self (including clickies) but wont canni or patch heal so should work just fine for you... course if all your doing is slowing (AA available at 78-79) then you wont use shit for mana so canni is unimportant and if your merc cant keep your hp up then your prolly fighting something you shouldnt anyway!!! Besides not hard to tab over to burn canni AA every couple of pulls if you do find yourself running lom if you decide to cast something more than slows.

http://www.mmobugs.com/forums/everq...w-offensive-shm-mac-with-automatic-buffs.html **First post lacks 3 things needed to run so scroll down for them. If you have problems I tend to check boards frequently on a daily basis so just let me know.