GTERM includes a Script Language that you may use to create Script Files to automate your Service Log Ons. Each Phone Book entry may have an associated script file. In addition, GTERM can be run automatically, from the Command Line, by passing the name of a Start Up script file to run. All commands and parameters are converted to Upper Case before being processed. Commands and their parameters must be separated by at least 1 space. The number of spaces is insignificant. Some commands are valid only in Start Up scripts. By convention, script files are named with an .SCR extension. However you are free to give them any name you wish. When a Start Up script issues the Dial command to dial an On-Line Service, the script file associated with the Phone Book entry (if any) will not be executed. In other words, the Start Up script takes precedence over a Phone Book script. The following commands are currently defined: ! - Start of Comment Line ClearBuf - Clear Receive Buffer ClearScreen - Clear the Screen Delay - Do Nothing Dial - Dial A Phone Number DialTimeOut - # of Dial Attempts Download - Download A File Exit - Exit Program HangUp - Disconnect RunProgram - Run an External Program Send - Send A String Silent - Run In Silent Mode TimeOut - Set Time Out Value for 'WaitFor' Upload - Upload A File WaitFor - Wait For A String When - When Receive String, Send String ! designates a line as a Comment Line. The line will be read but not processed (it will simply be skipped). ClearBuf will clear the Receive Buffer such that any characters received from the remote system, up until the time the ClearBuf command is received, will be discarded. ClearScreen will clear your screen. Delay will cause GTERM to "do nothing" for the number of clock tics that you specify. You must pass a parameter telling GTERM how many clock tics to delay. There are 18 clock tics in 1 second. To pause the program for 1 Second you would use the following command: Delay 18 Dial will dial the Service specified by the 1st parameter. You must type in the Service Name exactly as it appears in the Phone Book (case is not significant). Dial should be used only in a Start Up Script. It should not be used in a Phone Book Entry Script (it will be ignored if you try to do so). If GTERM cannot make a connection with the Service, the Script will be terminated and GTERM will Exit back to the operating system. The default number of Dial Attempts is 10. This can be changed by using the DialTimeOut Command at the start of your Script. If you press Esc or Click the Cancel Button while GTERM is attempting to Dial out, you will cancel the Dial attempt and the Script. DialTimeOut is the number of times that GTERM will attempt to Dial a Service if the Service is busy. The default is 10 attempts. To change this, issue the DialTimeOut command at the top of your Script. To tell GTERM to keep trying to connect to a Service 20 times, issue the following command: DialTimeOut 20 Page 2 Download tells GTERM to Download a file. The Download Command takes 2 parameters. The first parameter is the Protocol Letter for the Transfer Protocol to use. The second parameter is the name of the file to download (this name will be ignored if the protocol is a Batch protocol). If you specify a full path (either added to the filename or in place of a filename) the file will be placed in that directory. Otherwise the file will be placed in the download directory. To download a file using Zmodem into your Download Directory, you would issue the following command: Download Z C:\GTERM\DWNDIR Exit tells GTERM to Exit the program after the script is finished. HangUp causes GTERM to terminate a Connection and disconnect. RunProgram allows you to run an external program. It loads a secondary copy of your Shell (COMMAND.COM in most instances) so it should be used to run Batch Files. Its parameter is enclosed in quotes in case you need to provide space delimited parameters to the Batch File. Send will "send" the specified string to the COM Port. The string must be enclosed in quotes. The string may include the "^M" sequence to signify a Carriage Return. Page 3 Silent tells GTERM to run in unattended mode. Silent takes 1 parameter and may be either On or Off. If you plan to run your scripts from the Command Line, perhaps during an Event, you will need to use Silent On to tell GTERM not to display any screens that expect operator input. The Silent command should be used at the beginning of a script. Note: The Silent Command is ignored in GTERM since there are no unattended operations that GTERM can perform. TimeOut sets the time out value for WaitFor. It takes 1 parameter, which is the number of seconds WaitFor should wait for any specified strings. Upload tells GTERM to Upload a file. The Upload Command takes 2 parameters. The first parameter is the Protocol Letter for the Transfer Protocol to use. The second parameter is the full path and name of the file to upload. To upload a file using Zmodem where the file is located in your Upload Directory, you would issue the following command: Upload Z C:\GTERM\UPDIR\TEST.ZIP WaitFor will "wait" for the specified string to arrive at the Serial Port. The default TimeOut period is 30 seconds. If you wish to increase or decrease this time, use the TimeOut command (TimeOut X, where X is the number of seconds desired). If there is a TimeOut, the Script will abort. The string to "wait for" must be enclosed in quotes. Note that GTERM will look for an exact match. If the string you are looking for contains embedded ANSI sequences, you must include those sequences in the string. It is best (and faster) to look for short strings. Don't look for entire sentences. Page 4 When - A "When" Command is similar to the following sequence of Commands: WaitFor Send The biggest difference is that the "When" Command doesn't wait for any particular string to arrive. It simply stores the string that you want to watch for and when the string arrives, the "Send String" is sent. The syntax for this Command is as follows: When "String To Look For" "String To Send" You can queue up to 40 "When" strings and their associated "Send" strings. "When" strings are valid only during a "WaitFor" command. While "waiting" for a specific string to arrive at the serial port, if GTERM sees a queued up "When" string, it will send the associated "Send" string to the remote site, and continue waiting for the "When" string to arrive. Page 5 Consider the following Example from a Log On Script: When "Escape twice" "" When "/Help) [Enter] =" "Y Q NS O^M" When "First Name : " "KENNY GARDNER PASSWORD^M" When "To Continue " "^M" Waitfor "Command : " The 1st "When" anticipates a Fido Front End. If the prompt is recieved, it sends 2 Escape Characters (Alt-27's, or Esc's). The 2nd "When" anticipates an older version of GAPBBS that asks for Color Preference. The 3rd "When" will send your First and Last Name as well as your Password when GAP asks for a First Name. The 4th "When" takes care of all screens that have a Pause Prompt after them. Finally, the "WaitFor" Command puts everything into motion. While waiting for the Main Command Prompt, if any of the 4 "When" strings are received, they will be handled automatically. Page 6