• You've discovered RedGuides, an EverQuest multi-boxing and scripting community 🧙‍♀️⚙️. We want you to play several EQ characters at once, come join us and say hello! 👋

  • A TLP without truebox has thawed (Very Vanilla ready)
    Frostreaver

Nother ?

bror

New member
Joined
Oct 16, 2005
RedCents
How do I do the mq2 equivalent of variable++ or variable+=1? ATM I have the following:

Rich (BB code):
/declare randomvariable int outer


Sub Event_SomethingorOther
     /varcalc randomvariable ${randomevariable}+1
/return

This gives me an error everytime, not a fatal error, just that ${randomvariable} is not found or something like that.
 
Did you actually give randomvariable a value anywhere? try
Rich (BB code):
/declare randomvariable int outer 0
 
Here is how I'd do it.

Rich (BB code):
/declare randomvariable int outer 0

Sub Event_SomethingorOther
     /varset randomevariable ${Math.Calc[${randomevariable} + 1].Int}
/return
 
Last edited:
Cuz I didn't know that could be done.

Also, I found the problem. Turns out mq2 is not like c++. In c++, you can declare global variables outside a function/subroutine. In mq2, they have to be declared within a sub. I had to move them to sub Main and now it works.
 
Nother ?

Users who are viewing this thread

Back
Top
Cart