www.ClassicTW.com http://classictw.com/ |
|
Issues with a script command http://classictw.com/viewtopic.php?f=15&t=35934 |
Page 1 of 1 |
Author: | SteveH_66 [ Sat Dec 02, 2023 12:21 pm ] |
Post subject: | Issues with a script command |
I am having trouble with a script command, the setAutoTrigger. I am trying to use it in a login Script. Here is the script code : Code: # First, we declare our Variables :variables loadVar $person loadVar $passWord # Now, we set our Triggers :triggers setAutoTrigger logInName1 "Please enter your name (ENTER" $person & "*" setAutoTrigger PASSWORD1 "Password?" $passWord & "*" setAutoTrigger PAUSES1 "[Pause]" "a " 0 setAutoTrigger MENU1 "Selection (? for menu)" GAME & "*" setAutoTrigger MENU2 "Enter your choice:" "T" & "*" setAutoTrigger todaysLOG "Show today's log? (Y/N)" "*" setAutoTrigger gameMESSAGES "Delete messages? (Y/N)" "Y" & "*" setTextTrigger textTrig1 "Command [TL=" :finish PAUSE :finish HALT Here is the documentation text from the TWX Scripting reference : Quote: Purpose: Creates a trigger that will activate when a text containing a specific value has been received from the remote server and respond to that trigger with the specified text. Syntax: setAutoTrigger {name} {value} {response} [repeat] {name}: The name of the trigger to create. This name is used for later references to the trigger. {value}: A value that is required to be in the block of incoming text for the trigger to activate. {response}: The response to send when the trigger is activated. [repeat]: Optionally set the number of times to repeat this trigger. Use 0 for infinite. The default value is 1. Notes: The auto trigger will automatically respond to an event instead of jumping to a label within the script. Note that no triggers will activate unless the script has been paused with a "pause", "waitFor" or "waitOn" command. Example: # Respond to pause prompts until trigger is killed. SetAutoTrigger PAUSE "[Pause]" "a " 0 # Respond with a system varable & <enter> to the login prompt. SetAutoTrigger LOGON "Please enter your" LOGINNAME & "*" # Send <enter> to a single prompt. SetAutoTrigger SHOWLOG "Show today's log?" "*" I can't see where I am not putting in all the parameters for the command. But, TWX Proxy returns this error code and kills the script : Code: Script compilation error: Too few parameters for command 'SETAUTOTRIGGER', line 10 (0_LOGIN.TS) Can anyone tell me where I am messing up, what parameter is missing for that command? Or does that command not work all that well and a scripter needs to use setTextTrigger or some other trigger or waitFor or waitON or whatever instead? |
Author: | Adept [ Thu Dec 07, 2023 11:08 pm ] |
Post subject: | Re: Issues with a script command |
Hmm...try moving this to the top of the order and see if the error reports at a lower line #. Perhaps, firstly, try running it without the 0 repeat; also, try it without the "a", just send a space: setAutoTrigger PAUSES1 "[Pause]" "a " 0 Otherwise comment out: "setAutoTrigger PASSWORD1 "Password?" $passWord & "*"" to see if the script runs without error, and just enter the PW manually. |
Page 1 of 1 | All times are UTC - 5 hours |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |