home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / c / comlink / Manual / Script_Man / 2_Scripts < prev    next >
Encoding:
Text File  |  1993-11-22  |  6.6 KB  |  147 lines

  1.  
  2. SCRIPT FILES
  3. ============
  4.  
  5. What is a script file? Well it's like a program, ComLink looks at each line
  6. in the script sequentially and does what you tell it. Take a look at the
  7. file SCRIPT within the !ComLink application. (To do this hold down SHIFT and
  8. double click on the !Comlink icon). Load !Edit as normal, drag the file
  9. SCRIPT file to the Edit icon on the bar. Most of the lines start with a
  10. command word followed by a colon, some are further followed by some text. I
  11. have tried to make the commands self explanatory as best I can. Further
  12. information is provided on each command later in this document, but before
  13. you are overwhelmed with the apparent complexity of the program, look at the
  14. TYPE: command. All this does is send the text after the command to the
  15. serial port. Just as though it had been typed at the keyboard. Simple eh?
  16.  
  17. To handle text sent back from the TNC there is a command WAITFOR:, which
  18. simply causes characters to be taken from the TNC until exactly the text
  19. given after the command has been seen.
  20.  
  21. When a script program is running, any terminal programs (other than the one
  22. incorporated into ComLink) must be disabled or closed down (quit), since
  23. otherwise they may steal characters from the serial port and affect the
  24. operation of ComLink.
  25.  
  26. Creating a script
  27. -----------------
  28.  
  29. Scripts can be created using the !Edit wordprocessor, or an old one can be
  30. loaded into !Edit, saved under another name and modified. Script files have
  31. their own "type", so normal text files must have their filetype changed
  32. before ComLink will run them.
  33.  
  34. There are several ways of changing the file type, use the *command
  35. (*Settype), use the 'Set type' option in many of the text editors, or use
  36. the application provided called !Convert. To use !Convert, load it by double
  37. clicking it's icon. Drag the text file to the Convert icon on the bar, hey
  38. presto the file type changes. !Convert will also change script files back to
  39. text files by the same method.
  40.  
  41. Script files have been given the filetype 56E (hex.)
  42.  
  43.  
  44. SCRIPT COMMANDS
  45. ===============
  46.  
  47. The following script commands may be used:-
  48.  
  49. APPEND:<text>      Adds text to the end of each upload file.
  50. BREAK:<comment>    Sends a "Break" to TNC, gets it out of transparent mode.
  51. CHAIN:<script>     Runs another script.
  52. DAYTIME:<10/12>    Sets TNC clock.
  53. DELAY:<number>     Sets the delay to timeout in seconds.
  54. DIRDOWN:<path>     Sets the "download" directory.
  55. DIRUP:<path>       Sets the "upload" directory.
  56. FILESCAN:<filepath>Scan a file for marked messages to be read/killed.
  57. FINISHED:<comment> Stops the script.
  58. FLUSH:<ON/OFF>     Switches on/off input buffer flushing.
  59. ICON:<colour>      Changes the background colour of the ComLink icon.
  60. KILL:<text>        Sends message kill commands to PMS/BBS.
  61. LOOPIF:<text1>     Loop start point. Loop from UNTIL: if <text1> is seen.
  62. MONITOR:<text>     Allows incoming text to be seen in the status window.
  63. MORE:<text>        Generates automatic "Y" to BBS requests for "More Y/N"
  64. MYPROMPT:<text>    Your prompt, optional wildcards and prompt length.
  65. ONERROR:<comment>  Where execution continues after a timeout.
  66. OSCLI:<text>       Executes * commands.
  67. READ:<text>        Reads messages from FILESCAN/SCANLIST, text is optional.
  68. REPORT:<ON/OFF>    Pops up or closes the ComLink status window.
  69. SAVELIST:<comment> Ensures that ComLink saves the message list.
  70. SCANLIST:<text1:..:text9> Extracts message numbers when text1 etc is seen.
  71. START:<time>       Continues script execution at the specified time eg 23:30
  72. TRYAFTER:<number>  Sets the retry time in a loop.
  73. TYPE:<text>        Sends the text to the serial port.
  74. UNTIL:<text2>      Continues if <text2> seen, loops back if <text1> is seen.
  75. UPLOAD:<comment>   Sends files to the serial port.
  76. WAITFOR:<text>     Takes characters from serial port until <text> is seen.
  77. WKEY:n:<text>      Programs WimpKey 'n' to text.
  78.  
  79.  
  80. The following restrictions apply to the use of commands:-
  81.  
  82. 1) Commands must be in capital letters.
  83. 2) Commands may be abbreviated to 4 letters.
  84. 3) Commands must end with a colon before the <text> etc begins.
  85. 4) Only one command per line is allowed.
  86. 5) Commands must start the line.
  87.  
  88. If these rules are ignored, or if the command is not a valid one the line
  89. will be treated as a comment (eg like a BASIC REM statement).
  90.  
  91. Text received by the serial port is assumed to have a line end marker of
  92. "carriage return" ie a control code of value 13 (decimal). (Nb version 1.00
  93. assumed lines ended with a line feed)
  94.  
  95. All outgoing text lines are ended automatically by ComLink with a "carraige
  96. return" code.
  97.  
  98. Where no text etc is required by a command (eg UPLOAD:), then a comment may
  99. be put on the rest of that line, this will be ignored by the program.
  100.  
  101. Script files can only be 150 lines maximum, including comments. This should be
  102. enough for most applications. Lines can only be 100 characters long maximum.
  103.  
  104. When text files are created by a ComLink script and they are being written
  105. to, a special file type is allocated to the file (type &56C), this is the
  106. same as the normal text type icon except the "pen" in the icon is red. The
  107. icon will be switched back to the normal text icon when the file is closed.
  108.  
  109. The commands are all described in detail in the text file "3_Commands".
  110.  
  111.  
  112.  
  113. !ComMail for setting the upload and download directory paths.
  114. ------------------------------------------------------------
  115.  
  116. !ComMail provides an easy way of setting your upload and download paths.
  117.  
  118. A !ComMail directory has been added which allows the path of upload and
  119. download to be set easily. Simply put the !ComMail directory where you like
  120. on floppy, in RAM drive etc. Double click on the !ComMail directory to be
  121. used for upload and download. A system variable ComMail$Dir will be set to
  122. point to the selected directory. This can be used in your scripts, eg :-
  123.  
  124. DIRDOWN:{ComMail$Dir}.From_BBS
  125. DIRUP:{ComMail$Dir}.To_BBS
  126. OSCLI:Filer_OpenDir {ComMail$Dir}.From_BBS
  127.  
  128. You can create your own directories within !ComMail, put them in the
  129. !ComMail.Mail directory. Double clicking on the !ComMail icon automatically
  130. opens this directory for you.
  131.  
  132.  
  133. PROBLEMS?
  134. =========
  135.  
  136. I hope you have the time to write a script file or to adapt one I have
  137. provided in the directory "Script_Ex". The time you save by not having to
  138. sit at the keyboard to get messages from the BBS is time you can use more
  139. usefully. (If you are married perhaps your wife will see more of you!)
  140.  
  141. The programs supplied are not guaranteed to be free of bugs. The usual
  142. disclaimers apply, don't blame me if use of the programs causes loss of any
  143. data or any other type of damage!
  144.  
  145. Do contact me via packet if you have any problems or have any suggestions
  146. regarding possible improvements. I'll try to help. (G7ALN @ GB7IMB)
  147.