Buff Macro troubles.

Third party software discussion goes here.
eggybob
Posts: 18

Buff Macro troubles.

Post#1 » Fri Aug 29, 2014 7:29 pm

Hi i have three things to ask advice on concerning the below code.

Code: Select all

|Buffs Macro

#include MQ2Cast_Spell_Routines.inc

Sub Main
:Main
/if (!${Me.PctMana}>95) /call Medding
/if (${Me.PctMana}>95)  /call Buffing

/return

Sub Buffing

/echo ~~~BUFFING~~~BUFFING~~~

/delay 2s
/if (${Me.Sitting}) /sit
/delay 2s

/bc prifz //target prifz
/delay 1s
/casting "Spirit of Bear|gem3" -maxtries|10
/delay 8s
/casting "Scale Skin|gem5" -maxtries|10
/delay 8s
/casting "Strengthen|gem6" -maxtries|10
/delay 5s
/casting "Dexterous Aura|gem7" -maxtries|10
/delay 6s

|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

   /bc prifz //target sritz
   /delay 2s
   /casting "Spirit of Bear|gem3" -maxtries|10
   /delay 8s
   /casting "Scale Skin|gem5" -maxtries|10
   /delay 8s
   /casting "Strengthen|gem6" -maxtries|10
   /delay 5s
   /casting "Dexterous Aura|gem7" -maxtries|10
   /delay 6s

|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

/bc prifz //target brop
/delay 2s
/casting "Spirit of Bear|gem3" -maxtries|10
/delay 8s
/casting "Scale Skin|gem5" -maxtries|10
/delay 8s
/casting "Strengthen|gem6" -maxtries|10
/delay 5s
/casting "Dexterous Aura|gem7" -maxtries|10
/delay 6s

|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

/casting "Talismen of the Beast|gem4" -maxtries|10

/return

Sub Medding

/if (!${Me.Sitting}) /sit
/goto :Main

/return


1.) My shaman goes through and buffs himself and my other 2 toons with the 4 buffs and the macro ends. the problem is he doesnt seem to cast the talismen of the beast at the end? im not sure why.

2.) After this process, i try to repeat runnung the macro (mainly to test the sit and med part. All i get at this stage is the text saying that the macro has ended again and again. this can only mean that ive done something wrong with the medding /sit and sub routine?? But im unsure what?

3.) Last thing is that i have to AltTab to my shamans window to run the macro in the first place. I'd prefer to run from my main toons window. Any advice on how i'd do this tried a hotkey with /bc <shamans name> //mac buffs and didnt seem to work.

thanks for any advice.

User avatar
Alulien
Posts: 283

Re: Buff Macro troubles.

Post#2 » Fri Aug 29, 2014 8:02 pm

In general I would recommend cleaning up your spells: "Spirit of Bear" gem3 -maxtries|10, and you could even indicate your target on this line by using a similar structure of -targetid|${Spawn[pc CHARACTERNAME].ID}. Your line ultimately becomes /casting "Spirit of Bear" gem3 -maxtries|10 -targetid|${Spawn[pc CHARACTERNAME].ID}

1) Spelling: it's TalismAn not TalismEn

2) Without doing some /echo's to debug I'm not totally sure. I would recommend instead of using (!${Me.PctMana}>95) that you use (${Me.PctMana}<95)

3) Possibly a syntax issue: it's not /bc but rather /bct SHAMANNAME //mac macroname - keep in mind the macroname is not what you call the routines but rather what you save it as ie. macroname.mac
Malistari (SHD) | Daggar (ROG) | Sarda (BST) | Gurneyman (BRD) | Glamd (SHM) | Wrunken (CLR)

<Muffins>

Letow (PAL) | Feydakin (MAG) | Corpselight (NEC) | Mallyal (ENC) | Thomel (BRD) | Araer (DRU)

eggybob
Posts: 18

Re: Buff Macro troubles.

Post#3 » Fri Aug 29, 2014 8:55 pm

Thanks. That has solved 1+3 but i still have an issue trying to get shaman to med if below 95% mana but once above 95% to start buffing again.

Code: Select all

|Buffs Macro

#include MQ2Cast_Spell_Routines.inc

Sub Main

/if (${Me.PctMana}<95) /call Medding
/if (${Me.PctMana}>95) /call Buffing

/return

Sub Buffing

/echo ~~~BUFFING~~~BUFFING~~~

/delay 2s
/if (${Spawn[pc prifz].Sitting}) /sit
/delay 2s

/casting "Spirit of Bear" gem3 -maxtries|10 -targetid|${Spawn[pc prifz].ID}
/delay 8s
/casting "Scale Skin|gem5" -maxtries|10 -targetid|${Spawn[pc prifz].ID}
/delay 8s
/casting "Strengthen|gem6" -maxtries|10 -targetid|${Spawn[pc prifz].ID}
/delay 5s
/casting "Dexterous Aura|gem7" -maxtries|10 -targetid|${Spawn[pc prifz].ID}
/delay 6s

|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

   
   /casting "Spirit of Bear|gem3" -maxtries|10 -targetid|${Spawn[pc sritz].ID}
   /delay 8s
   /casting "Scale Skin|gem5" -maxtries|10 -targetid|${Spawn[pc sritz].ID}
   /delay 8s
   /casting "Strengthen|gem6" -maxtries|10 -targetid|${Spawn[pc sritz].ID}
   /delay 5s
   /casting "Dexterous Aura|gem7" -maxtries|10 -targetid|${Spawn[pc sritz].ID}
   /delay 6s

|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||


/casting "Spirit of Bear|gem3" -maxtries|10 -targetid|${Spawn[pc brop].ID}
/delay 8s
/casting "Scale Skin|gem5" -maxtries|10 -targetid|${Spawn[pc brop].ID}
/delay 8s
/casting "Strengthen|gem6" -maxtries|10 -targetid|${Spawn[pc brop].ID}
/delay 5s
/casting "Dexterous Aura|gem7" -maxtries|10 -targetid|${Spawn[pc brop].ID}
/delay 6s

/return

Sub Medding

/if (!${Spawn[pc prifz].Sitting}) /sit

/return


Shaman will /sit when below 95% mana but the macro will end.

User avatar
Alulien
Posts: 283

Re: Buff Macro troubles.

Post#4 » Fri Aug 29, 2014 11:20 pm

The macro isn't currently set to loop which is why you're seeing it end. Starting on line 3:

Sub Main
:mainloop
/if (${Me.PctMana}<95) /call Medding
/if (${Me.PctMana}>95) /call Buffing
/goto :mainloop
/return

Try adding the italicized lines: this tells your macro that once it's called (or skipped if the /if conditionals aren't met) the Medding and Buffing routines it needs to return to the :anchor via the /goto :anchor command. Above I used :mainloop as you can use multiple anchors in your routines for more finite control - just be aware that you want to make each :anchor a unique name or else the macro might jump to the wrong one.
Malistari (SHD) | Daggar (ROG) | Sarda (BST) | Gurneyman (BRD) | Glamd (SHM) | Wrunken (CLR)

<Muffins>

Letow (PAL) | Feydakin (MAG) | Corpselight (NEC) | Mallyal (ENC) | Thomel (BRD) | Araer (DRU)

eggybob
Posts: 18

Re: Buff Macro troubles.

Post#5 » Sat Aug 30, 2014 1:18 pm

Alulien wrote:The macro isn't currently set to loop which is why you're seeing it end. Starting on line 3:

Sub Main
:mainloop
/if (${Me.PctMana}<95) /call Medding
/if (${Me.PctMana}>95) /call Buffing
/goto :mainloop
/return

Try adding the italicized lines: this tells your macro that once it's called (or skipped if the /if conditionals aren't met) the Medding and Buffing routines it needs to return to the :anchor via the /goto :anchor command. Above I used :mainloop as you can use multiple anchors in your routines for more finite control - just be aware that you want to make each :anchor a unique name or else the macro might jump to the wrong one.


Thanks this seems to have fixed the macro he now casts all buffs on all three toons and then sits. Trouble now is i need to put in some check for if the toons already have those buffs as when he has medded up to >95% he stands and repeats regardless of weather they have the buffs already.

any advice on how to go about this wi=ould be great in the meantime i shall look into it myself.

thanks for all the kind help.

User avatar
Alulien
Posts: 283

Re: Buff Macro troubles.

Post#6 » Sat Aug 30, 2014 5:53 pm

This is much more advanced in terms of what you want your macro to do. Currently you've got a few if conditionals and a lot of commands. I use the following:

/declare VerifyMali string outer
This is in my variable declarations before my :mainloop - Malistari is one of my toons. This tells the macro the following: I am declaring that a string (of characters) called VerifyMali shall exist throughout all subroutines in the macro.

A /call in my :mainloop to my buffcheck routine

/varset VerifyMali "${NetBots[Malistari].Buff}"
This is within my buff subroutine before any /if conditionals or other action commands. When the macro comes to this sub it "attaches" the string of characters (remember the /declare above) that are returned from ${NetBots[Malistari].Buff} to the VerifyMali variable. At this point in the macro, if you were to look at what VerifyMali shows it would be something like 7986 4932 2134 7249 - we're looking at the spell id of the buffs on Malistari.

/if ( !${VerifyMali.Find[SPELLID]} && ${Spawn[pc Malistari].Distance} <= MAXRANGEOFBUFF && !${Spawn[pc Malistari].Distance} == NULL && !${NetBots[Malistari].CurrentHPs} == 0 ) /casting "BUFF" gemX -maxtries|2 -targetid|${Spawn[pc Malistari].ID}
!${VerifyMali.Find[SPELLID]} checks if Malistari has the buff, the Distance checks ensure that he's in range/isn't in another zone, and the CurrentHPs makes sure he isn't dead. If all of the above are fulfilled then my Shaman casts the buff in question. If one of the above is not fulfilled (he already has the buff, is out of range/in another zone/dead) then the macro continues on.

This should work perfectly for identifying if you have the buff and acting accordingly. I hope the additional explanation helps you see how the logic is set up and then checked. As you get a feel for more complex logic structures you'll find your macros doing some really awesome things!

Remember to reference TLOs on the MQ2 wiki - this is a list of all the commands and things you can do. This is the closest thing you've got to a manual. Also keep in mind that if a line in a macro doesn't seem to be working you can do /echo /if (... and it will return the response in the EQBC window - this is essentially a debugging tool to identify if some variables are breaking the macro by returning NULL when they should return a string or TRUE/FALSE instead
Malistari (SHD) | Daggar (ROG) | Sarda (BST) | Gurneyman (BRD) | Glamd (SHM) | Wrunken (CLR)

<Muffins>

Letow (PAL) | Feydakin (MAG) | Corpselight (NEC) | Mallyal (ENC) | Thomel (BRD) | Araer (DRU)

eggybob
Posts: 18

Re: Buff Macro troubles.

Post#7 » Sat Aug 30, 2014 8:07 pm

Great help thanks for your time and effort

Xorp
Posts: 103

Re: Buff Macro troubles.

Post#8 » Wed Oct 01, 2014 5:30 pm

Malistari.. THANK YOU for your last post in this thread..

I had just spent a good hour or so searching the net for how to use that darn string of spell ID's that netbots returns to check for buffs, and had no idea I could use something like --> ${Mystring.Find[SPELLID]} .. Didn't even know that .Find worked that way :D

You have helped to make my buffing sequences incredibly more efficient and clean. The way I was doing it before was a trainwreck.

*high five*
~ Xorp MNK ~ Rekk SHD ~ Lixt WAR ~ Slit ROG ~ Lans BER ~ Ripd BST ~
~ Furu BRD ~ Bzgy RNG ~ Fure WIZ ~ Uopo ENC ~ Drel MAG ~ Lour NEC ~
~ Beys CLR ~ Lorr CLR ~ Tinu CLR ~ Yamb SHM ~ Osgy DRU ~ Syyn PAL ~

User avatar
Alulien
Posts: 283

Re: Buff Macro troubles.

Post#9 » Thu Oct 02, 2014 4:00 am

Glad to hear it! My buff routines were also a mess when I stumbled on that .Find bit - I think I was actually looking for something totally unrelated when I found it!
Malistari (SHD) | Daggar (ROG) | Sarda (BST) | Gurneyman (BRD) | Glamd (SHM) | Wrunken (CLR)

<Muffins>

Letow (PAL) | Feydakin (MAG) | Corpselight (NEC) | Mallyal (ENC) | Thomel (BRD) | Araer (DRU)

Xorp
Posts: 103

Re: Buff Macro troubles.

Post#10 » Sat Oct 04, 2014 3:59 am

I have it down to where I don't worry about buffs at all anymore. I am always fully buffed automatically at all times, including when a toon pops back into zone after being rezzed. This has made my playtime far less stressful and enjoyable knowing im utilizing all my toons potential without all of the hassle of micromanaging spells / buffs that I was suffering through before :D :D :D
~ Xorp MNK ~ Rekk SHD ~ Lixt WAR ~ Slit ROG ~ Lans BER ~ Ripd BST ~
~ Furu BRD ~ Bzgy RNG ~ Fure WIZ ~ Uopo ENC ~ Drel MAG ~ Lour NEC ~
~ Beys CLR ~ Lorr CLR ~ Tinu CLR ~ Yamb SHM ~ Osgy DRU ~ Syyn PAL ~

Return to “Third party software”

Who is online

Users browsing this forum: No registered users and 1 guest

cron