• 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 --->
  • Unfortunately, yes, there is a suspension wave happening around the new tlp launch. :'( Please keep regular discussion to Suspension MegaThread and please consider submitting a Suspension report to RG.

Nother ? (1 Viewer)

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.
 
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