
Need some help on a script not working right
I am working on a script, using an include, and it has really got me stumped. The include is executing correctly from the calling script. The include script is getting the variable I want, in this case "Command [TL". I did some testing, there are no leading or trailing blank spaces in the variable. It seems to be reporting the variable back to the calling script correctly, and when I did a test echo it echo's the variable correctly in the game. But the IF routine I am using to test the variable isn't recognizing it correctly.
I believe that the conditional I am using doesn't like checking against a text string, I believe this is the culprit :
Code:
IF ($check = "Command [TL")
I don't know if TWXProxy no longer likes a text string used in this way or what, and even though It's been a long time since I did much scripting and I'm a bit rusty, I could swear I have been able to use text strings for things like this in past scripts. Maybe I'm wrong? Is it something else? I'm throwing myself on the mercy of the LEET scripter's court on this one, be gentle with me :D
Here's the calling script code, as far as I've gotten with it :
Quote:
# the promptCheck code block, for using the 00PromptCheck.ts include script to check what prompt we are at
:promptCheck
goSub :00PromptCheck~PromptCheck // Uses 00PromptCheck.ts include to get the prompt from CURRENTANSILINE
setVar $check $00PromptCheck~check
echo "*" $check "*" // put this in for debugging purposes, no other use for it in this script
# now let's use this routine to check if we are at the Command prompt
IF ($check = "Command [TL")
echo "*" "You are at the Command prompt, executing" "*"
ELSE
echo "*" "You are not at the Command prompt, must run from Command prompt !!!" "*"
HALT
END
PAUSE // for testing
This is the code for the prompt check include :
Quote:
# This script will check to see what prompt you are at, and return it
# in the form of "$PromptCheck~check" variable for the calling
# script
:PromptCheck
setVar $promptLine CURRENTANSILINE
setVar $promptLine "BOL " & $promptLine & " EOL" // Puts something in for getting 1st/last word from line
getText $promptLine $check "BOL " "="
return
Here is the relevant screen cap from in the game, shows it seems to be getting the variable right :
Quote:
Command [TL=00:00:00]:[8954] (?=Help)? :
Loading and compiling script: C:\TWXProxy2_05\scripts\_working.ts
Command [TL=00:00:00]:[8954] (?=Help)? :
Command [TL
You are not at the Command prompt, must run from Command prompt !!!
Script terminated: C:\TWXProxy2_05\scripts\_working.ts
So what am I doing wrong/missing here?
Edit : used quotes on the code, so the code wouldn't look like it was spill-over, the inline comments ARE all on one line in the script file.