• You've discovered RedGuides 📕 an EverQuest multi-boxing community 🛡️🧙🗡️. We want you to play several EQ characters at once, come join us and say hello! 👋
  • IS THIS SITE UGLY? Change the look. To dismiss this notice, click the X --->

Macro - buff check then cast (1 Viewer)

mipstien

Member
Joined
Apr 23, 2012
RedCents
20¢
I have been getting back into eq and mq2. I am just playing on a personal eqemu server with some friends and trying to 3 box. Currently I am trying to create a macro that checks for clarity and the amount of time left and if it fits in that window or they don't have the spell it should cast.
I have been putting off asking this for days as i know there are other plugins that can probably do exactly this but I don't have access to them or can't get them working. Besides I think if I can figure this stuff out it just helps with my knowledge of creating macro's. What I have sorta works but still throws errors. Also my mq2casttimer is wrong and I think it gives buffs with extended AA's added to the time so that is another separate issue. I am not a coder so this may be the wrong way to do this entirely.

INI:
Sub Main

    /declare x int local
    /for x 0 to 5

    /target ${Group.Member[${x}]}
    
   /if (${Target.Buff[clarity].ID}) && (${Target.BuffDuration[clarity]} < 1000)  /casting clarity -maxtries|5
    
    /delay 10s ${Cast.Ready[Clarity]}

    /next x
/return
 
We'll start with some obvious questions.
Are you using Redguides EMU version which is MQ and not MQ2? It's important to know if you're using an old outdated build of Macroquest or not.

So one issue I'm noticing immediately is that you are targeting a group member and immediately checking the target for a buff. Sadly buffs are polled from the server and needs a variable amount of time for the buffs to populate. So consider adding a delay in there. I believe there is a Target.BuffsPopulated or something to that effect where you can

/delay 2s ${Target.BuffsPopulated}

I believe it's also possible for buffs to remain momentarily after targeting someone when switching from one target to another. Perhaps consider clearing your target, then targeting who you want and waiting for the buffs to populate.

When using a delay in this fashion you're saying you want to wait until the condition is true. In this case the condition is to know if the target has their buffs populated or not. So if they do it will stop delaying early.

I'm not familiar with MQ2CastTimer plugin nor do I see where you're using any information from the plugin.
If you're talking about BuffDuration, honestly I've never had a major need to make sure I overwrite the buff. But aside from that you're code is saying if the target already has the buff and the timer is less than 1k then cast it. But that means you won't cast it if they don't have the buff.

perhaps try this.
/if (${Target.Buff[clarity].ID}) && (${Target.BuffDuration[clarity]} < 1000 || !${Target.Buff[clarity].ID})

This is going to loop through group members once, then the macro will end. If you're intending this to be an always on thing perhaps wrap it in something like

Less:
sub main
/declare x int local 0
/while (1) {
  /for x 0 to 5
  ......
  .....
  ....
  ....
  /next x
  /delay 5
}
/echo The macro is ending.
/return
 
Thank you for the reply! I feel a bit dumb asking this since I am sure it's simple issues so thank you for being kind in your reply.
Since I have never really made macro's i just got mqemulator's basic version of mq2 for rof2 client to test some macro creations. I have used redguides and kiss before but i wanted to learn how this works this time around.
My first version of this was way more complicated and had an else in there to say if it doesn't have the buff also cast clarity but I couldn't get past what the macro currently does smoothly.
Can you tell me what || does and what !$ also does in this case?
 
Thank you for the reply! I feel a bit dumb asking this since I am sure it's simple issues so thank you for being kind in your reply.
Since I have never really made macro's i just got mqemulator's basic version of mq2 for rof2 client to test some macro creations. I have used redguides and kiss before but i wanted to learn how this works this time around.
My first version of this was way more complicated and had an else in there to say if it doesn't have the buff also cast clarity but I couldn't get past what the macro currently does smoothly.
Can you tell me what || does and what !$ also does in this case?
legacy MQ2 isn't supported and is strongly recommended against.

MQ has literal thousands of changes, updates, fixes, and enhancements.

Don't flagellate yourself for no reason.

Returning users check out - MacroQuest Release Party: https://www.redguides.com/community/threads/macroquest-release-party.80628/ for information about changes from the legacy MQ2 to the new and awesome MQ
 
I guess i have to look into this stuff. I really just don't understand why this has changed.
Is this what is called MQ Next?
 
I did.
is it ok to ask a yes or no question to get confirmation or did i break some rule that i missed in the rule book? if it's not ok then i am sorry to bother you.

just to be clear it looks like what you linked is for live and test and not for a random emu server that i am on. but again if i did something wrong to you i am sorry .
I might just be too dumb.
 
Thank you for the reply! I feel a bit dumb asking this since I am sure it's simple issues so thank you for being kind in your reply.
Since I have never really made macro's i just got mqemulator's basic version of mq2 for rof2 client to test some macro creations. I have used redguides and kiss before but i wanted to learn how this works this time around.
My first version of this was way more complicated and had an else in there to say if it doesn't have the buff also cast clarity but I couldn't get past what the macro currently does smoothly.
Can you tell me what || does and what !$ also does in this case?
Here, you will want to check out this guide to help you get started on conditions and the options available to you. It's a simple guide all things considered but should help you better understand the basics of the macroquest scripting language.

The new "MQ" is the one commonly referred to as "Next" but that was never technically an official name for it and it's developers want it to just be called "MacroQuest" and leave adding version numbers to under the hood stuff as opposed to a public facing value. Though if it were given a value it would come after MQ2, making more like MQ3 or something along those lines.

EMU was more recently converted to the new MacroQuest and offers all the features available to the information available in the link Sic provided. This includes things such as the ability to write "Lua", the new console, a bunch of fancy inspection windows built into MacroQuest as well as many many more features.
 
I did.
is it ok to ask a yes or no question to get confirmation or did i break some rule that i missed in the rule book? if it's not ok then i am sorry to bother you.

just to be clear it looks like what you linked is for live and test and not for a random emu server that i am on. but again if i did something wrong to you i am sorry .
I might just be too dumb.
You certainly can. But you asked a question that seems to be answered in the first part, and it didn't sound like you asked for clarification, it sounded like you didn't click, which is why I asked :p

Mq is mq is mq - legacy mq2 is no longer a thing, it isn't actively developed or supported.

Mq has literal thousands of updates, fixes, and enhancements as I mentioned. It is just the "next major version" of macroquest
 
Here, you will want to check out this guide to help you get started on conditions and the options available to you. It's a simple guide all things considered but should help you better understand the basics of the macroquest scripting language.

The new "MQ" is the one commonly referred to as "Next" but that was never technically an official name for it and it's developers want it to just be called "MacroQuest" and leave adding version numbers to under the hood stuff as opposed to a public facing value. Though if it were given a value it would come after MQ2, making more like MQ3 or something along those lines.

EMU was more recently converted to the new MacroQuest and offers all the features available to the information available in the link Sic provided. This includes things such as the ability to write "Lua", the new console, a bunch of fancy inspection windows built into MacroQuest as well as many many more features.
I think this will help me on my journey.

forgive me for asking this but i attempted to use an mqnext/mq and it just crashes my rof2 client. I obviously didn't want to spend money just to find out that it doesn't work with my client. what clients does it work with?
 
I think this will help me on my journey.

forgive me for asking this but i attempted to use an mqnext/mq and it just crashes my rof2 client. I obviously didn't want to spend money just to find out that it doesn't work with my client. what clients does it work with?
MQ supports rof2 and that is the build that RG supports with MQ as well
 
but i attempted to use an mqnext/mq and it just crashes my rof2 client.
You don't appear to be level 2, did you build it yourself? I recommend trying redguides version of it. It comes pre-built and packed with a ton of plugins/macros. Spending a few dollars to check it out isn't the end of the world but I understand if you opt not to give it a go. But it's hard to try and assist with supporting a version of macroquest that has been out of support for a year or more. Most everyone here will be trying to give advice based on the current version of MacroQuest which will limit our ability to assist you.
 
You don't appear to be level 2, did you build it yourself? I recommend trying redguides version of it. It comes pre-built and packed with a ton of plugins/macros. Spending a few dollars to check it out isn't the end of the world but I understand if you opt not to give it a go. But it's hard to try and assist with supporting a version of macroquest that has been out of support for a year or more. Most everyone here will be trying to give advice based on the current version of MacroQuest which will limit our ability to assist you.
It was the end of my world. My boring EQ world where there was no color! Best few bucks spent ever..... 🙌 🍻
 
No, I am not level 2.
I have managed to compile the openvanilla and got some stuff setup. I just managed to get my macros going and decided to call it a night. But I should be all up to date now on mq.
I will be trying your suggestions tomorrow, ChatWithThisName
We'll start with some obvious questions.
Are you using Redguides EMU version which is MQ and not MQ2? It's important to know if you're using an old outdated build of Macroquest or not.

So one issue I'm noticing immediately is that you are targeting a group member and immediately checking the target for a buff. Sadly buffs are polled from the server and needs a variable amount of time for the buffs to populate. So consider adding a delay in there. I believe there is a Target.BuffsPopulated or something to that effect where you can

/delay 2s ${Target.BuffsPopulated}

I believe it's also possible for buffs to remain momentarily after targeting someone when switching from one target to another. Perhaps consider clearing your target, then targeting who you want and waiting for the buffs to populate.

When using a delay in this fashion you're saying you want to wait until the condition is true. In this case the condition is to know if the target has their buffs populated or not. So if they do it will stop delaying early.

I'm not familiar with MQ2CastTimer plugin nor do I see where you're using any information from the plugin.
If you're talking about BuffDuration, honestly I've never had a major need to make sure I overwrite the buff. But aside from that you're code is saying if the target already has the buff and the timer is less than 1k then cast it. But that means you won't cast it if they don't have the buff.

perhaps try this.
/if (${Target.Buff[clarity].ID}) && (${Target.BuffDuration[clarity]} < 1000 || !${Target.Buff[clarity].ID})

This is going to loop through group members once, then the macro will end. If you're intending this to be an always on thing perhaps wrap it in something like

Less:
sub main
/declare x int local 0
/while (1) {
  /for x 0 to 5
  ......
  .....
  ....
  ....
  /next x
  /delay 5
}
/echo The macro is ending.
/return
 
The macro appears to do the check correctly and cast when within the parameters. Now it doesn't seem to end.
I don't understand what "/while (1)" does?

clarity:
Sub Main
/declare x int local
/while (1) {
    
    /for x 0 to 5

    /target ${Group.Member[${x}]}
    
    /delay 2s ${Target.BuffsPopulated}
    
    /if (${Target.Buff[clarity].ID} && ${Target.BuffDuration[clarity]} < 1474018 || !${Target.Buff[clarity].ID}) {
    
    /casting clarity|gem5 -maxtries|5
    
    /delay 10s ${Cast.Ready[Clarity]}
    }
    /next x
    /delay 5
}

/return
 
The macro appears to do the check correctly and cast when within the parameters. Now it doesn't seem to end.
I don't understand what "/while (1)" does?

clarity:
Sub Main
/declare x int local
/while (1) {
 
    /for x 0 to 5

    /target ${Group.Member[${x}]}
 
    /delay 2s ${Target.BuffsPopulated}
 
    /if (${Target.Buff[clarity].ID} && ${Target.BuffDuration[clarity]} < 1474018 || !${Target.Buff[clarity].ID}) {
 
    /casting clarity|gem5 -maxtries|5
 
    /delay 10s ${Cast.Ready[Clarity]}
    }
    /next x
    /delay 5
}

/return
/while (1) is literally "keep doing this if "1" is not 0/false/null, since 1 isn't going to change, it is going to continue to do that loop until it is intentionally stopped (or crashed internally)


you could have something like this which uses a boolean "bKeepWhileAlive" to continue in your loop until is complete
Less:
bool bKeepWhileAlive = true;

/while (1) {
    // do cool stuff
    if (stuff is completed) {
        bKeepWhileAlive = false;
    }

}

this does a similar thing without a boolean, it would just break out of the while look when it is completed
Less:
/while (1) {
    // do cool stuff
    if (stuff is completed) {
       break;
    }

}
 
Macro - buff check then cast

Users who are viewing this thread

Back
Top