| Contents | Previous Page | Next Page |
' -- // auto ftp auto lf auto refresh bye call script char width char zoom clear log clear script clear triggers clear var clear vars connect copy copy selection dec decrement default log default script disconnect else elsif empty log endif error email attachments email authtype email body email close email connect email disconnect email end email files email finish email from email host email memo email message email open email password email port email quit email reply email send email signon email subject email text email to email userid exec execute exit font ftp abort ftp ascii ftp binary ftp connect ftp disconnect ftp get ftp host dir ftp host file ftp host name ftp local file ftp password ftp port ftp put ftp quit ftp receive ftp send ftp timeout ftp transmit ftp username ftp wait goto graphics hostname if inc increment line height line zoom list load log load script local echo log log append log commands log errors log line log name log screen lower lpad max message min msg oem charset pause port print file print list quit refresh screen rem return from script rows run save log screen height screen width script height script name script return script visible selection send set shell standard keys std keys stop system trigger trigger delete trim typing upper upper lock wait
FTP (copy) a file from one machine to another, setting up session on one line of script
|
AUTO FTP Hostname,Port,UserId,Password,LocalFile,RemoteFile,[BIN|ASC],[T|R] where Hostname is the same as executing command FTP HOST NAME hostname and Port is the same as executing command FTP PORT Port and UserId is the same as executing command FTP USERNAME UserId and Password is the same as executing command FTP PASSWORD Password and LocalFile is the same as
executing command FTP
LOCAL FILENAME LocalFile and RemoteFile is the same as executing command FTP HOST DIR/FILENAME RemoteFile Nb.RemoteFile
is split into directory / filename components automatically by ArcTel and using BIN is the same as executing
FTP BINARY and using ASC is the same as executing FTP ASCII and using T is the same as executing FTP TRANSFER to transfer file to host computer and using R is the same as executing FTP RECEIVE to retrieve file from host computer. |
This command incorporate many of the other FTP commands into one line of script. It is particularly useful if wishing to transfer a file using the EXEC statement of the command-line parameters (i.e. when executing ArcTel).
With this command, you set all the important information required to perform a file transfer, and then state which direction the file is going (Transferred to Remote machine or Received from Remote machine). The machines are then connected, and the transfer commenced. On completion, the transfer is closed
|
Arctel MIN EXEC AUTO FTP ftp.mydomain.co.uk,ftp,guest,letmein,c:\transmit\transmit.txt,recv/receive.txt,ASC,T |
|
AUTO LF {TRUE | ON | ENABLED | OTHER} Enable using one of TRUE, ON, or ENABLED. Disable using anything else – e.g. FALSE, OFF, or DISABLED. |
Some terminals require the emulator to add a line feed at the end of each line. If you terminal seems to be running lines one after the other, instead of putting them onto separate line, enable this option.
|
AUTO REFRESH {TRUE | ON | ENABLED
| OTHER} Enable using one of TRUE, ON, or ENABLED. Disable using anything else – e.g. FALSE, OFF, or DISABLED. |
Changing many of the terminal settings affects the way the terminal looks. If making a series of changes, you may wish the screen to remain unchanged until the last change has taken place, in order to cut down the time spent needlessly updating the screen. Turn this option off to achieve this, or ON to make sure any such change gets automatically updated on the screen.
|
CALL SCRIPT filename where filename is the name of the script file that you wish to execute. |
This Loads and executes a script from within the current script, but keeping details of the current script in memory.
When execution of the called script terminates with the SCRIPT RETURN or RETURN FROM SCRIPT command, the called script is removed from memory, and execution resumes with the next line of the calling script.
It is possible to run other scripts from within a script, and when finished with that script, return control to the original script. This is a little like procedure calling in many programming languages.
Calls to scripts may be nested – there is no fixed limit to the depth of nesting. Be careful that you do not accidentally call a calling script from a called script, unless you have a specific exit condition to prevent two scripts infinitely calling each other.
Any triggers, variables, etc. that are set up in the called script, will be retained in memory.
This makes a called script useful as standard script that can be reused in other scripts, for example to set up a session and commonly used variables.
In the below example, the standard script login_prod.asf is called to log into a terminal, and then a task is performed (writing the directory contents to a file) before closing the session.
Calling Script
|
CALL
SCRIPT
login_prod.txt |
Call
script to log in to terminal in production mode. |
|
SEND
ls –alrt >dir.txt#cr# |
Run
the ls-alrt >dir.txt command
within the host computer’s environment. In this example, this puts a
directory listing of the current directory into a file dir.txt in the same directory on this host computer. |
|
SEND
exit#13##10# |
Tell
the host computer to exit and therefore terminate the connection |
|
WAIT
3 |
Wait
for three seconds to make sure everything has terminated OK. |
Script: login_prod.asf
|
SET
cr=#13##10# |
Set
up a variable called #cr# to represent a carriage return. |
|
CLEAR
TRIGGERS |
Ensure
there are no outstanding triggers in memory |
|
HOSTNAME
123.456.789.0 |
Set
remote computer as having IP address of 123.456.789.0 |
|
TRIGGER
1,login,USER1#cr#,login |
When
the terminal displays login,
send the text USER1 followed by a carriage return, and start the script at
the line marked login: |
|
CONNECT |
Connect
to computer 123.456.789.0 |
|
STOP |
Terminate
the script. The script will be restarted at the line marked login:
when the terminal displays the text login |
|
login: |
Start
here when TRIGGER #1 (text login)
is activated |
|
TRIGGER
2,password:,#DECRYPT 3OQ*N&P#cr#,password |
Second
trigger: When the text password:
is encountered, output the password followed by a carriage return, and go
to line labelled password: in
script. |
|
CONNECT |
Connect
to computer 123.456.789.0 |
|
STOP |
Terminate
the script. The script will be restarted at the line marked login:
when the terminal displays the text login |
|
login: |
Start
here when TRIGGER #1 (text login)
is activated |
|
STOP |
Terminate
the script. The script will be restarted at the line marked password:
when the terminal displays the text password: |
|
password: |
Start
here when TRIGGER #2 (text password)
is activated. |
|
TRIGGER
3,Select Environment,p#cr#,production |
Third
trigger. When the text Select
Environment is encountered, send a p
for production followed by a carriage return, and then start the script at
the label production: |
|
STOP |
Terminate
the script. The script will be restarted at the line marked production:
when the terminal displays the text Select
Environment |
|
production: |
Start
here when TRIGGER #3 (text Salect
Environment) is activated. |
|
CLEAR
TRIGGERS |
Clear
triggers to make sure not triggered by accident at any other time. |
|
SCRIPT
RETURN |
Return
to calling script |
|
CHAR WIDTH char_width where char_width is the width of a character column on the terminal in pixels. |
If you increase the size of the font, it will also be necessary to increase the size of the character width, otherwise the font will be cut off in width.
You can also use this option to increase the spacing between character columns to make them more readable.
|
CHAR ZOOM zoom_amount[%] where zoom_amount is the amount to zoom the spacing by (where 1 is no zoom). To make this a percentage value, add a % symbol (no zoom then being 100%) |
If you find the characters are not wide enough, making the screen look narrow, then you may like to increase the character zoom – e.g. 2 or 200% (for 200%) would make the characters twice as wide, and 0.5 or 50% (for 50%) would make them twice as small. See also LINE ZOOM.
Define the number of character columns displayed on the terminal screen
|
COLUMNS num_cols where num_cols is the number of columns of text that may be displayed on the terminal. |
This is generally set at 80 characters wide. Only increase / decrease it if you seem to miss columns of data or have too many blank columns at the right of the screen. Maximum column width is 132.
|
CLEAR LOG where num_cols is the number of columns of text that may be displayed on the terminal. |
To clear the log so that any future telnet activity is
recorded from a ‘clean slate’, use either of the above commands, both of
which perform the same function.
|
LOG ERRORS ON |
Log any errors |
|
LOG
SCREEN ON |
Log
anything that is transmitted/received during the session |
|
LOG
COMMANDS OFF |
Do
not log commands that are run in the script |
|
LOG
NAME c:\windows\std_telnet_log.alf |
Log
will be saved to file c:\windows\std_telnet_log.alf |
|
DEFAULT
LOG |
Log
c:\windows\std_telnet_log.alf is
the default log, which will automatically be loaded when ArcTel starts up. |
|
CLEAR
LOG |
Clear
the log of its contents |
|
SAVE
LOG |
Save
the log to the filename c:\windows\std_telnet_log.alf |
|
LOG
ENABLED |
Turn
logging on |
|
CLEAR SCRIPT |
This will remove all lines from the script on the screen. This may be useful to put at the end of your default script, so that the script edit box is clear to do further work.
|
CLEAR TRIGGERS |
This will remove all triggers from memory, so that no text being displayed will cause an event to be triggered.
This is useful for clearing up after the end of a script that uses triggers, or as a ‘make sure’ to put in at the beginning of a script that is to use a brand new set of triggers.
Remove a specified variable from memory.
|
CLEAR VAR varname where varname is the name of
the variable to remove from memory. |
This will remove any reference to the variable from memory. Attempting to retrieve the variable when it has been removed from memory will generate an error and cause the script to halt.
|
CLEAR VARS |
|
CONNECT |
On connection, most telnet services will prompt the user for a user name and password. To automate the login for these, see the section on Logon Automation in the Common Tasks section of this manual.
|
COPY src_str,from_index,to_index TO dest_var Where src_str is the source text terminated with a comma, from_index is the starting character position of the text to copy from the source text, to_index is the number of characters to copy from the source text, and dest_var is the name of the variable to put the extracted string into. |
For example, if you apply the command COPY hello,2,3 TO dest this will start from the second character (e) and copy three characters (e, l, and l) and place this into the variable called dest, so that dest now contains ell.
|
SET abc=1 |
Set
variable abc to 1 |
|
MESSAGE #abc# |
Displays
1 in a dialog box. Click on OK
to continue. |
|
INC abc |
Adds
1 to variable abc so now it
contains 2 |
|
MESSAGE #abc# |
Displays
2 in a dialog box. Click on OK
to continue. |
|
LPAD abc,4,0 |
Pad
out abc to a length of 4
characters with prefixed 0s. |
|
MESSAGE #abc# |
Displays
0002 in a dialog box. Click on
OK to continue. |
|
COPY #abc#,2,3
TO def |
Copies
characters 2 to 4 from abc and
place in variable def |
|
MESSAGE
def=#def# |
Displays
def=002 in a dialog box. Click
on OK to continue. |
|
DEC var_name where var_name is the name of an existing variable which contains a numeric value. |
For some purposes, you may want to decrement a numeric value stored in a variable during a process, for example if you are emulating a loop. Use this command to achieve this purpose.
The example below shows a message box for numbers 5 through to 1 in a loop, then quits the loop.
|
SET loopvar=5 |
Set loop variable |
|
loopstart: |
Start of loop |
|
MESSAGE Loopvar is #loopvar# |
Display ‘Loopvar
is 1’, etc. |
|
DEC loopvar |
Decrement loopvar
– take 1 from its value |
|
IF “#loopvar#” NUM>“0” |
If loop variable is numerically greater than 0 … |
|
GOTO loopstart |
… then go back to loopstart for the next
iteration |
|
ENDIF |
End of If condition block |
|
MESSAGE end of loop |
Display End of loop in a message box. |
|
COPY SELECTION |
If you wish to copy specific text from a given selected rectangle on the terminal, use this command. The text enclosed in the selection rectangle will be copied to the clipboard. You can access the text contents of the clipboard using the #clipboard# macro substitution.
The selection is set either by the user dragging around some given text using the mouse, or programatically using the SELECTION command.
|
DEFAULT LOG |
Make the current script filename the default
|
DEFAULT SCRIPT |
This will make the current script filename (e.g. previously
loaded or previously set using SCRIPT NAME
command) the default to be loaded up automatically when ArcTel is opened.
Nb. if you want the script to be automatically loaded up each time, but do not
wish it to be automatically run, make sure the first line of the script is NORUN
Disconnect (log off) from the remote computer that you are currently connected to.
|
DISCONNECT |
It is always good practice to log off cleanly if possible. Most telnet environments have a disconnection option which allows the remote host to clean up before disconnection – common command-line keywords in the host environment include exit bye quit q system
Specify a file or list of files using their filenames, to be sent with the email as attachment(s).
|
EMAIL ATTACH file_list EMAIL ATTACHMENT file_list EMAIL ATTACHMENTS file_list EMAIL FILE file_list EMAIL FILES file_list where file_list is a semi-colon separated list of file-names of files to be attached |
The file names must all exist and be valid files on or accessible by your PC.
Note that you can use a single filename, or a list of filenames separated by semi-colons. It is also possible to add to, merge into, delete from, load and save this list using the standard list-building facilities of Arctel, explained here.
This defines the authorization type required in order to log into the server.
|
EMAIL AUTHTYPE logontype where logontype is the type of authorization required in order to log into the server. It can be one of PLAIN, LOGIN or CRAMMD5 |
If you do not need to login to your email server using a password (generally true for computers within an organization - i.e. on an Intranet) then use the PLAIN option.
If you need to login to an email using a password, you would generally use the LOGIN option (generally true for computers connected to an external server on the Internet - e.g. an Internet Service Provider).
If you do use the LOGIN option, you will also need to use the EMAIL USERID and EMAIL PASSWORD options.
Close a connection - i.e. log off - the SMTP (Email sending) server previously logged in to.
|
EMAIL CLOSE EMAIL FINISH EMAIL END EMAIL DISCONNECT EMAIL QUIT |
This will log you off the server previously logged onto using the EMAIL OPEN command, having sent all the emails you wish to using the EMAIL SEND command.
Specify the email address from which the message was sent, and to which a reply should be sent.
|
EMAIL FROM emailaddr where emailaddr is the email address of the person to which replies should be sent |
The email address must be in the correct format to be transmitted across the Internet - e.g. webmaster@simonhuggins.com - note that you can use any email address, so you should be extra careful to use an address that actually exists - i.e. check for spelling mistakes etc. Note if you wish replies to go to an alternative address, use the EMAIL REPLY [TO] command after using the EMAIL FROM command.
Define the email host name or IP address of the SMTP server from which you wish to send an email
|
EMAIL HOST hostname EMAIL HOST NAME hostname where hostname is the name or IP address of the SMTP server. |
You need to specify the host name prior to connecting to the server. See the EMAIL SEND command for an example of sending an email.
Open a connection - i.e. log on to - the SMTP (Email sending) server previously specified.
|
EMAIL OPEN EMAIL CONNECT |
This will log you on to the server specified in the EMAIL HOST command using the EMAIL PORT port, authenticating the login using the user id and password specified in the EMAIL USERID and EMAIL PASSWORD commands (if the EMAIL AUTHTYPE LOGIN command was used). You can then send as many emails as you required before loggin off the server again using the EMAIL CLOSE command.
Specify the Password that authenticates the User ID, required to log into the SMTP email server in order to send an email.
|
EMAIL PASSWORD acctpass where acctpass is the password for the account required to log in to the SMTP server |
Required if you use the EMAIL LOGIN command to specify that you need to log in to your email server with an ID and Password to authenticate your rights to use the server. You will also need to use the EMAIL USERID command to specify the login account name.
Define the port number to be used to connect to the SMTP server from which you wish to send an email
|
EMAIL PORT portnumber where portnumber is the port number to use to connect to the SMTP server. |
If you do not know the port number, use the default smtp - the majority of SMTP servers use this for connection.
Specify the email address to which any replies should be sent.
|
EMAIL REPLY emailaddr EMAIL REPLY TO emailaddr where emailaddr is the email address of the person to which replies should be sent |
The email address must be in the correct format to be transmitted across the Internet - e.g. webmaster@simonhuggins.com - note that you can use any email address, so you should be extra careful to use an address that actually exists - i.e. check for spelling mistakes etc. Note make sure you use this command after using the EMAIL FROM command.
Send an email having specified the various details about the email
|
EMAIL SEND |
You need to have opened a connection to the SMTP server prior to issuing this command using the EMAIL OPEN command. You can send several messages, but must then issue an EMAIL CLOSE command to show that the last email has been sent (even if it was only a single email).
The following is an example of sending an email to a server with authentication:-
|
EMAIL HOST
smtp.simonhuggins.com |
Specify SMTP server to send email from |
|
EMAIL PORT smtp |
Specify the
port to use to connect to the SMTP Server - use the standard port in this
case. |
|
EMAIL AUTHTYPE LOGIN |
This server needs an account id / password to log into it and send an email |
|
EMAIL USERID simonh |
Account name to log in to SMTP server is simonh |
|
EMAIL PASSWORD #DECRYPT w 04*+-Aa14t+|e`5# |
Specify
password to log into SMTP server. Note the password has been turned into a
CryptString to dissuade prying eyes. |
|
Specify the email address where returned emails and replies should be sent |
|
|
EMAIL TO huggins@bogoff.net;"blurb" <blurb@simonhuggins.com> |
Specify two email addresses of people that will receive the email |
|
EMAIL SUBJECT Test message |
Give a subject line for the email, as it will appear in the recipients' inboxes |
|
EMAIL ATTACH c:\scandisk.log;c:\temp\email_test.asf |
Specify two attachment files to send with the email |
|
EMAIL TEXT First line;Second Line;Third Line;Fourth line is not duplicated |
Put fourth lines of text in the body of the email |
|
EMAIL MSG MERGE Fourth line is not duplicated;Fifth Line;Sixth line is deleted |
Fourth line is not added as it is 'MERGEd', fifth and sixth lines are added. |
|
EMAIL MESSAGE REMOVE Sixth line is deleted;This line is ignored |
Sixth line is removed again as it matches, next line is ignored as it isn't in the email body |
|
EMAIL BODY ADD Add this line;Fifth Line;Last line was just a test - see it is kept |
Add another line, and Fifth Line again (to show it is not merged), and another comment line |
|
EMAIL MEMO ADD The following lines are opened from the script file; |
Add another line of text followed by a blank line |
|
EMAIL TEXT ADD OPEN c:\temp\email_test.asf |
Add the text
contained in the file c:\temp\email_test.asf |
|
EMAIL TEXT ADD -----;;End of email body |
Add a separator line, a blank line and an 'end of message' indicator line |
|
EMAIL OPEN |
Open a connection to the SMTP mail server - i.e. 'log on' to it. |
|
EMAIL SEND |
Send the email message |
|
MSG #EMAILRES# |
Show a dialog-box message to indicate the result of the SEND |
|
EMAIL QUIT |
Close the connection to the SMTP server - i.e. 'log out' of it. |
Define the sign-on string to be used for a server. You can use this to determine specific data about a server.
|
EMAIL SIGNON signonstring where signonstring is the command request string to send to the server when logging on |
You will not usually need to use this command when sending an email.
Specify the subject line text that will appear in the recipient's inbox.
|
EMAIL TO text where text is a single line of text indicating the subject of the email to the recipient |
This is a single line of text used by the recipient to identify in their inbox the subject matter of the email. It should be kept concise, and explain clearly the content of the email in order to allow the recipient to appropriately prioritise its importance.
Specify the main body of text to be used for the email message.
|
EMAIL TEXT body_list EMAIL MSG body_list EMAIL MESSAGE body_list EMAIL BODY body_list EMAIL MEMO body_list where body_list is a list of lines that comprise the body text of the email to be sent |
The body text is made up of several lines of text to relay the main detailed information of your email message.
Note that you can use a single line of text, or a number of lines separated by semi-colons. It is also possible to add to, merge into, delete from, load and save these lines using the standard list-building facilities of Arctel, explained here. Note also that a comprehensive example of using the list-building facility to build up the body of the email is included with the EMAIL SEND command.
Specify the email address(es) of the recipients for the email message. I.e. where the email is to be sent.
|
EMAIL TO email_list where email_list is a semi-colon separated list of email addresses of the people to which the email is to be sent. |
The email address(es) must be in the correct format to be transmitted across the Internet - e.g. webmaster@simonhuggins.com.
Note that you can use a single email address, or a list of addresses separated by semi-colons. It is also possible to add to, merge into, delete from, load and save this list using the standard list-building facilities of Arctel, explained here.
Specify the account name (User ID) required to log into the SMTP email server in order to send an email.
|
EMAIL USERID username where username is account name required to log in to the SMTP server |
Required if you use the EMAIL LOGIN command to specify that you need to log in to your email server with an ID and Password to authenticate your rights to use the server. You will also need to use the EMAIL PASSWORD command to specify the login password.
|
ERROR message_text where message_text is the error message text to be displayed / logged. |
Use this command to display a specific error message, log it (if error logging is turned on) and terminate execution of the script.
|
FONT [NAME font_name] [,SIZE font_size]
[,BOLD status] [,ITALIC status] where font_name is the name of the font to use for the terminal. Generally fixed style fonts such as Courier New work better with terminals. font_size is the point size of the font to use. Between 8 and 12 is reasonable. status is one of TRUE, ON, or ENABLED to turn the effect on, or anything else (e.g. FALSE, OFF, or DISABLED) to turn the effect off. |
Use this command to set the terminal font, size, and style.
|
FONT
NAME Courier New,SIZE 10,BOLD ENABLED,ITALIC DISABLED |
Set
the font of the Terminal to be Courier new, point size 10, emboldened, but
with not italicization. |
|
FTP ABORT |
Use this command only if you wish to terminate an FTP transfer, or the connection cannot be shut down otherwise using the FTP QUIT command.
|
FTP ASCII |
Any files FTPed after using this command will be transferred in ASCII MODE. Use this mode to transfer text files.
|
FTP BINARY |
Any files FTPed after using this command will be transferred in BINARY MODE, ie. the destination file will be an exact copy of the source file.
|
FTP CONNECT |
Use this command to establish a connection between the local computer and the remote computer.
When you wish to transfer a file using FTP, you will need to set the HOST, PORT, USERNAME, PASSWORD, and specify the files to ftp to / from. You can then execute the FTP CONNECT command, use FTP GET or FTP PUT to transfer the file, and FTP QUIT to disconnect from the FTP server.
Note that the TRANSMIT and RECEIVE commands will automatically open a connection, so there is usually no need to use this command. However, if you use the GET or PUT commands, this will be necessary. For multiple transfers, using CONNECT/GET or PUT/QUIT will speed up the transfer by eliminating the need to form a new connection for each transfer.
|
FTP GET |
Use this command to transmit the file on the remote FTP server defined by the FTP HOST DIR and FTP HOST FILE to a file on the local machine defined by the commands FTP