-
Notifications
You must be signed in to change notification settings - Fork 8
getConsoleInput
MicroBlaster edited this page Nov 10, 2019
·
2 revisions
Purpose: Get input from a connected terminal without sending it to the remote server.
Syntax: getConsoleInput var [singleKey?]
var: A variable to hold the retreived input.
[singleKey?]: If this is specified, the command will only expect single key input as opposed to an entire line of text.
Notes: This command will pause the script until text is received from one of the connected telnet terminals. It is a useful way of getting script parameters when a script is first started, and can also be used to create menus.
Execution of the script will be paused while this command is active. Closing of the menu created by the command will terminate the script.
Example:
# Get a product type using a menu
:GetProduct
echo "*" ANSI_15 "Select Product:" "**"
echo ANSI_11 "1 " ANSI_3 " - Fuel Ore*"
echo ANSI_11 "2 " ANSI_3 " - Organics*"
echo ANSI_11 "3 " ANSI_3 " - Equipment*"
getConsoleInput $Product SINGLEKEY
if ($Product <> 1) and ($Product <> 2) and ($Product <> 3)
goto :GetProduct
end
.