• Hail, we're RedGuides. We want you to play six (yes, 6!) EverQuest characters at once. We have scripts and a friendly community to help, please join our playstyle and say hello! 👋
  • We've added LLM sections to our Terms & Rules and Resource Rules, for everyone's sanity & in-game safety.
    Read more
    a. Do not replace your voice with an LLM. This goes for your posts and your scripts. Drafting and editing with a tool is fine, but don't take you out of what you share.
    b. Do not replace your EQ character's voice with an LLM. We don't want scripts that speak over /ooc, /shout or other public channels. This has been an unwritten rule that's kept casino scripts off the site for decades, but we're now compelled to make it clear: keep automated communication private.

    Why Does RG Review Scripts?
    Nearly every LLM-written Lua script we see is making your character do impossible things, and rarely in a way that's beneficial to you. We've seen heavy server hammering, /target over impossible distances when /nav spawn would passively accomplish the same thing, a spawn search that fires 20+ times per second, and other pointless actions that are likely annoying GMs.

    You are welcome to use LLMs as a tool to structure, draft, and edit your work, but please read critically before hitting /lua run

Question - Is this Possible...

TheMobeater

New member
Please excuse the writing of the code, I am no programmer by any means, am just trying to get my feet wet with this "simple" macro.

I Just want to be able to echo that my level is more, less, or equal to the mob, and then echo what that difference in levels is, but all I get is errors :(

Rich (BB code):
Sub Main
/declare diff

/if (${Me.Level}<${Target.Level}){
 /varset diff ${Math.Calc[${Target.Level}-${Me.Level}]}
 /echo My level is less
 
 } else { /if (${Me.Level}>${Target.Level})
 /varset diff ${Math.Calc[${Me.Level}-${Target.Level}]}
 /echo My level is more 
 
} else { /echo My level is equal
}
/echo $diff	
/end
/return

Any advice would be appreciated, or if there is already a macro out there for this, a point in the right direction would be nice.

Thank You,
TheMobeater
 
im not sure what macro i have running that does it but when i click on the mob or get close enough the names turns the con color. it may be the headshot macro because i have a ranger.
 
I'm not running any macro for that. That's a base feature of MQ2 if I'm not mistaken.
@themobeater: Do a search for my HUD. I posted it on here. There are a few lines of code in it that will tell you the level of any mob or PC you click on. Also in that HUD are lines of code that will tell you if the mob can be Headshot or not.
 
Very Good Start. Most is just MQ2 syntax issues which you get used to as you write more macros. Always look at the error messages to debug your macros. Just do 1 at time.

My notes

/declare diff - if not defined variables default to text outer. You are doing math so you want an interger e.g. number
Rich (BB code):
/declare diff int outer
/varset diff ${Math.Calc[${Target.Level}-${Me.Level}]} - this works but to stream line it you can use the /varcalc function and drop the Math.Calc
Rich (BB code):
/varcalc diff ${Target.Level}-${Me.Level}
} else { /if (${Me.Level}>${Target.Level}) - your if statement is outside the { bracket causing a syntax error in your else-if statement
Rich (BB code):
 } else /if (${Me.Level}>${Target.Level}) {
/echo $diff - Missing brackets for the variable {} causing a syntax error
Rich (BB code):
/echo ${diff}
 
I'm not too good with MQ specific programming, but a couple things you could look at:
1. Calculating diff: I'm not sure if absolute value is available, but something like /varset diff ${Math.Abs[${Target.Level}-${Me.Level}]} should work in all cases.
2. You may be getting errors due to your elses. Typically, you can say:
Rich (BB code):
/if (true) {
    //do this
} else if (true) {
    //do this
} else {
    //do this
}
. Two elses would not work. Again, I'm not sure on MQ2 syntax, but this is the case in all programming languages I know.

Edit: Listen to Maskoi, didn't see his post when I hit respond.
 
Question - Is this Possible...

Users who are viewing this thread

Back
Top
Cart