Couldn't find a comparison operator in '1.32=1.32'

Help section from before the user variable changes that broke all macros

Moderator: MacroQuest Developers

motd2k
a ghoul
a ghoul
Posts: 141
Joined: Fri Oct 25, 2002 9:46 am

Couldn't find a comparison operator in '1.32=1.32'

Post by motd2k » Fri Jun 27, 2003 5:02 pm

Is there something wrong with this code?

Code: Select all

/if n $target(speed)!=1.32 /goto :startrun

MOTD

Valerian
a grimling bloodguard
a grimling bloodguard
Posts: 709
Joined: Sun Jul 28, 2002 3:29 am

Post by Valerian » Fri Jun 27, 2003 5:26 pm

looks good to me... but looks like the parser is somehow losing a character (!)... check the $target(speed) and see if it's adding the proper number to j (or i? don't have code open to check which) after parsing into/out of it... try something like

Code: Select all

/if n $target(speed)!!=1.32 /goto :startrun 
and see if that works for ya... if so, then it's definately a parser bug.

NOTE: I just tested this, and it is indeed the case. Add a space after $target(speed) (or any character after $target(speed)) and it works fine. Small bug in the parser apparently.

Code: Select all

/echo $target(speed)test
outputs 0.00est (if speed is 0, of course) it's eating a character. adding 1 too many is my guess. *grin*

Anyway, tracked it down, and here's the fix. in EQLib_MacroParser.cpp, line 944-947, change

Code: Select all

						// $target(speed)
						} else if (!strncmp("target(speed)",szVar,14)) {
							CHAR szTemp[MAX_STRING] = {0};
							i+=13;
to

Code: Select all

						// $target(speed)
						} else if (!strncmp("target(speed)",szVar,13)) {
							CHAR szTemp[MAX_STRING] = {0};
							i+=12;

User avatar
dont_know_at_all
Developer
Developer
Posts: 5450
Joined: Sun Dec 01, 2002 4:15 am
Location: Florida, USA
Contact:

Post by dont_know_at_all » Fri Jun 27, 2003 7:23 pm

Fixed in CVS and the on the downloads page.

motd2k
a ghoul
a ghoul
Posts: 141
Joined: Fri Oct 25, 2002 9:46 am

Post by motd2k » Mon Jun 30, 2003 3:34 am

Excellent, thanks Val.



MOTD