"couldn't parse" errors

Need help running MacroQuest 1? Too bad! Use MQ2.

Moderator: MacroQuest Developers

zyxxyz
decaying skeleton
decaying skeleton
Posts: 2
Joined: Sun Jun 15, 2003 2:09 pm

"couldn't parse" errors

Post by zyxxyz » Sat Jul 05, 2003 9:32 pm

I downloaded and compiled MQ (with VS 6.0) this afternoon. First time running it in a really long time, so it's all new again.

I know I've got to be missing something simple, but the scripts I'm copying from here are all resulting in a long string of "Couldn't parse" errors. It looks like the errors are for every instruction in the script.

Mostly I'm looking at different tradeskill macros, specifically pottery. I'm pretty sure I'm getting the arguments right (and positive I'm not screwing up ALL of them). The macros that come with MQ don't seem to have this problem. I'm copying and pasting into UltraEdit. Any ideas what I might be doing wrong?

As an example, running this script:

http://macroquest2.com/phpBB2/viewtopic.php?t=2559

With this command:

Code: Select all

/macro ts "destroy" pottery "water flask" "block of clay" "medium jar sketch"
Results in this:

Code: Select all

[Sat Jul 05 21:23:46 2003] Couldn't parse '   /cleanup'
[Sat Jul 05 21:23:46 2003] Couldn't parse '   /varset v4 2            | SET DELAY BETWEEN MOUSE CLICKS HERE'
[Sat Jul 05 21:23:46 2003] Couldn't parse '   /varset v5   "FALSE"   | ABORT ON RECIEVING A TELL, SET TO "TRUE" or "FALSE"'
[Sat Jul 05 21:23:46 2003] Couldn't parse '   /call ClearCursor $p0'
[Sat Jul 05 21:23:46 2003] Couldn't parse '   /if "$p2"=="" {'
[Sat Jul 05 21:23:46 2003] Couldn't parse '      /echo Syntax: /macro ts <Keep|Destroy> <CombinerName> <Component> [Component]...'
[Sat Jul 05 21:23:47 2003] Couldn't parse '      /endmacro'
[Sat Jul 05 21:23:47 2003] Couldn't parse '   }'
[Sat Jul 05 21:23:47 2003] Couldn't parse '   /call CombFind "$p1"'
[Sat Jul 05 21:23:47 2003] Couldn't parse '   /if $v2<=7 /call OpenInv'
[Sat Jul 05 21:23:47 2003] Couldn't parse '   /if $v2==8 {'
[Sat Jul 05 21:23:47 2003] Couldn't parse '      /call OpenEnv'
[Sat Jul 05 21:23:47 2003] Couldn't parse '      /delay $v4'
[Sat Jul 05 21:23:47 2003] Couldn't parse '   }'
[Sat Jul 05 21:23:47 2003] Couldn't parse '   /if $v2>=98 {'
[Sat Jul 05 21:23:47 2003] Couldn't parse '      /if n $v2==99 /echo Cannot find container << $p1 >>'
[Sat Jul 05 21:23:47 2003] Couldn't parse '      /if n $v2==98 /echo Too far away from << $p1 >>'
[Sat Jul 05 21:23:47 2003] Couldn't parse '      /endmacro'
[Sat Jul 05 21:23:48 2003] Couldn't parse '   }'
[Sat Jul 05 21:23:48 2003] Couldn't parse '   /call HandlePacks open'
[Sat Jul 05 21:23:48 2003] Couldn't parse '   /varset v3 0'
[Sat Jul 05 21:23:48 2003] Couldn't parse '   :CountComponents'
[Sat Jul 05 21:23:48 2003] Couldn't parse '      /call ClearCursor $p0'
[Sat Jul 05 21:23:48 2003] Couldn't parse '      /varset a(1,$v3) "$p$int($calc($v3+2))"'
[Sat Jul 05 21:23:48 2003] Couldn't parse '      /varadd v3 1'
[Sat Jul 05 21:23:48 2003] Couldn't parse '      /if n $int($v3)>10 {'
[Sat Jul 05 21:23:48 2003] Couldn't parse '         /echo Syntax: /macro ts <Keep|Destroy> <CombinerName> <Component> [Component]...'
[Sat Jul 05 21:23:48 2003] Couldn't parse '         /echo You can only add up to a total of 10 components.'
[Sat Jul 05 21:23:48 2003] Couldn't parse '         /endmacro'
[Sat Jul 05 21:23:48 2003] Couldn't parse '      }'
[Sat Jul 05 21:23:49 2003] Couldn't parse '      /echo Component $int($v3): $p$int($calc($v3+1))'
[Sat Jul 05 21:23:49 2003] Couldn't parse '      /if "$p$int($calc($v3+2))"=="" {'
[Sat Jul 05 21:23:49 2003] Couldn't parse '         /goto :Begin'
[Sat Jul 05 21:23:49 2003] Couldn't parse '      } else {'
[Sat Jul 05 21:23:49 2003] Couldn't parse '         /goto :CountComponents'
[Sat Jul 05 21:23:49 2003] Couldn't parse '      }'
[Sat Jul 05 21:23:49 2003] Couldn't parse '   :Begin'
[Sat Jul 05 21:23:49 2003] Couldn't parse '      /for l0 0 to $int($calc($v3-1))'
[Sat Jul 05 21:23:49 2003] Couldn't parse '         /call AddComp "$a(1,$l0)" $l0'
[Sat Jul 05 21:23:49 2003] Couldn't parse '      /next l0'
[Sat Jul 05 21:23:49 2003] Couldn't parse '   :Combine'
[Sat Jul 05 21:23:50 2003] Couldn't parse '      /call DoCombine'
[Sat Jul 05 21:23:50 2003] Couldn't parse '   :ClearCursor'
[Sat Jul 05 21:23:50 2003] Couldn't parse '      /call ClearCursor $p0'
[Sat Jul 05 21:23:50 2003] Couldn't parse '   /goto :Begin'
Thanks..

Mckorr
Developer
Developer
Posts: 2326
Joined: Fri Oct 18, 2002 1:16 pm
Location: Texas

Post by Mckorr » Mon Jul 07, 2003 8:06 am

That's part of the quantum strangeness of MQ. I've had the same script give me "could not parse" errors... then the next time I run it it works fine.

Things to check:

1) Make sure you are not getting strange "invisible" characters in your scripts. I noticed a while back if I used the Opera web browser to cut and paste scripts or source code over I'd get errors, but when using IE things would work. It has to do with the different way that Microsoft treats text from the rest of the world.

2) Strip all leading and trailing whitespace from the lines of the script. You can add the spaces back in front to make things more readable, but delete it all out first. Sometimes those "spaces" are actually some other character that's not being displayed, and you get errors.

3) Check the first few lines, make sure all comments have the appropriate | in front of them, etc. Since your first parse error occurs at /cleanup, check the lines BEFORE that and make sure there aren't any errors there.
MQ2: Think of it as Evolution in action.

zyxxyz
decaying skeleton
decaying skeleton
Posts: 2
Joined: Sun Jun 15, 2003 2:09 pm

Post by zyxxyz » Mon Jul 07, 2003 9:46 am

Thank you greatly, Mckorr. Looks like it was the leading spaces tripping things up. I'm using Opera as well, probably seeing the same things you did.

Mckorr
Developer
Developer
Posts: 2326
Joined: Fri Oct 18, 2002 1:16 pm
Location: Texas

Post by Mckorr » Mon Jul 07, 2003 11:39 pm

Yep, that's it then. I actually noticed the problem when I was cutting and pasting code back and forth for the mouse functions. Ended up copying the thread address from Opera over to IE, then copying the code from IE to Visual Studio.

As near as I can tell Opera uses Unix style text and IE actually converts in some way to DOS style. Since Win native programs (Notepad, etc.) use DOS formatting things mess up when you paste in Unix text from Opera. Hence the screwey leading whitespace.

I use Metapad as my text editor. It has a function to strip leading whitespace from a block of text, in this case the entire copied script. Much easier than going line by line and removing the offending invisible characters. Highly recommended if you don't need the syntax highlighting of Textpad or Ultraedit, etc (most of my macros are too small for me to need the highlighting.)
MQ2: Think of it as Evolution in action.