Previous Section
Previous Section: Script Debugging
Document HomeDocument Home
Next Section: Glossary
Next Section


Automated Script Execution

An extremely useful advanced feature of Wozterm is its automation capability. Using both Text and Time Events, Wozterm can react to changes in NE state or perform timed jobs as needed. This section demonstrates the use of both Text and Time events: manually via event manipulation using the Wozterm GUI, and programmatically via the execution of a Wozterm script.

Manual Event Manipulation

 
  1. Start a new instance of Wozterm. Before creating a Wozterm Text/Time event, we need a script to be run when the event is fired. Create a simple script by typing directly into the blank Script Editor. Firstly, give the Text/Time event an entry point with Line 1: "@label START". Secondly, output a message to show you the script has been executed with Line 2: "@comment(‘Script Executed’)".
  2. Save the script with File>Save Script File As "evtest.cmd". Debug any errors you may have made. Ignore the warning that the label "START" has not been referenced.
  3. Ensure the script works as intended by running it via Script>Run. Note that this will unload the script after it is executed. DO NOT reload the script: Wozterm must not have a script loaded for events to be fired.


    Figure 4.9 -Entire ‘evtest.cmd’ Script.

    evtest.cmd Script

  4. Create a new Time Event for the script that you have just created using Section 3.4.4 as a guide. Set the execution time for one minute in the future.
  5. Wait for the script to execute. If you have correctly set up the time event, you will see your comment "Script Executed" appear in the VT100 Terminal pane.

    Figure 4.10 - A new Time Event and the result of ‘evtest.cmd’ execution.

    Manually Triggering Time Event

  6. Create a new Text Event for the script that you have just created using Section 3.4.3 as a guide. Set the event to react to the Slogan ‘NOT ACCEPTED’. There is no need for a log file.
  7. Connect manually to a NE by first changing the NE connection mode in Mode>NEAS AXE (or the type you are connecting to) and then using Actions>Connect and entering your details.
  8. Now bring focus to the VT100 Terminal pane by clicking on it and type in some A-Z gibberish followed by the <ENTER> key. The connected NE will return NOT ACCEPTED in its response, your Text Event will fire, and you should see your comment appear on the screen.

Figure 4.11 - Manually triggering Text Event "NOT ACCEPTED"

Manually triggering Text Event 'NOT ACCEPTED'

Item

Description

  1. Gibberish entered.

This text is the result of the user typing directly into the VT100 Terminal pane when connected to a NE. Any non-recognised NE command will work.

  1. NE response.

This text is the response of the NE to a user entering an unknown command.

  1. Script evtest.cmd created in Steps 1, 2.

The two lines shown here are the entire Wozterm script required to utilise Time and Text Events manually. If you wish to stop the Wozterm compiler reporting a warning for label START not being referenced, simply add the line immediately before it ‘@goto START’.

  1. Evtest.cmd executed

The blue text ‘Script Executed’ in the VT100 Terminal pane shows that the Text Event has fired the ‘evtext.cmd’ script.

  1. NOT ACCEPTED Text Event

This is the Text Event set prior to connecting to the NE.

 

   



Programmatic Event Manipulation

 
  1. Select the events.cmd script for execution by browsing to it via File>Open, or prepare a new events.cmd script for use by Copy/Pasting it into Wozterm from Section 6.1.4 or by typing it in manually.
  2. Script>Run. You can now view the progress of the script setting a Time Event to call its self, and then setting a Text Event to trigger itself. The only input required by the user is the connection details to a NE.

    Figure 4.12 - Running Text/Time Event example script "events.cmd"

    Running Text/Time Event example script 'events.cmd'

  3. Run the ‘events.cmd’ script a second time, this time taking notice of the Time Event and Text Event tabs as events are added and removed. In addition, watch as the script’s progress is shown in the Script Editor pane, and note the Wozterm commands used to create and delete events programmatically.

 



Previous Section
Previous Section: Script Debugging
Document HomeDocument Home
Next Section: Glossary
Next Section


This publication has been prepared and written by Telstra Corporation Limited (ACN 051 775 556), and is copyright. Other than for the purposes of and subject to the conditions prescribed under the Copyright Act, no part of it may in any form or by any means (electronic, mechanical, microcopying, photocopying, recording or otherwise) be reproduced, stored in a retrieval system or transmitted without prior written permission from the document controller. Product or company names are trademarks or registered trademarks of their respective holders.

Note for non-Telstra readers: The contents of this publication are subject to change without notice. All efforts have been made to ensure the accuracy of this publication. Notwithstanding, Telstra Corporation Limited does not assume responsibility for any errors nor for any consequences arising from any errors in this publication.