Misinformation on /if in manual

General announcements relating to the modularized MacroQuest2 system.

Moderator: MacroQuest Developers

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Misinformation on /if in manual

Post by Lax » Thu Jul 21, 2005 1:28 pm

I wasnt aware that the information on /if was so outdated, until just now.

Here's the incorrect information:
/if (conditions) { command(s) } Runs command(s) if conditions evaluates to TRUE.

conditions are ONLY numeric compares. You must use MQ2Data string comparison to turn string compares into numeric compares.

conditions gets evaluated down to a single term from however many terms there are (You may use && and || freely.)
This information implies that you can only use comparison operators and && and || in /if conditions. THIS IS NOT THE CASE and incorrectly caused macro developers to use Math.Calc in /if conditions!

The correct information should read more like this:
/if (formula) { command(s) } Runs command(s) if formula evaluates to something other than 0.

formulas are ONLY numeric operations. You must use MQ2Data string comparison to turn string comparisons into numeric operations.
&& || < > <= >= are mathematical operators, and can be used in anything that uses a formula, including Math.Calc, Math.Abs, etc.

Additionally, the Math.Calc description says this "Performs one mathematical calculation ^ \ % + / - * != < <= == >= > && & || |" which is also incorrect. The correct information would say "Evaluates a mathematical formula".

Code: Select all

/if (${Math.Calc[1 && 2 && 3 && 4 < 5 && 12 > 100]}) {
is ONE HUNDRED PERCENT the same as

Code: Select all

/if (1 && 2 && 3 && 4 < 5 && 12 > 100) {
except it goes through the math processor twice! (the second time it's just a number, but this is still unnecessary)

Bottom line:
REMOVE MATH.CALC USAGE FROM /IF STATEMENTS!
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0