Indigo supports a scripting feature where you can automate commands sent to the connected terminal session and/or monitor and manipulate received data.
In this example, we will provide an example script that sends the "date" command to the connected terminal session every 10 seconds.
Please see the following help topic for information on how to setup Indigo to use a post-processing script file.
>> Scripting
The Indigo Session Properties must be configured to enable the Post Processing Script feature and configured for the correct script file and function.
This AutoSender.vbs script file is attached to this post/article. Please see the bottom of the page to download this script file.
This script works by queuing a command to be transmitted in 10 seconds when a connection is first established. The script then watches for the command to be transmitted and when the command is detected, the script queues the next command with another 10 second delay.
'///////////////////////////////////////////////////////////
'///////////////////////////////////////////////////////////
'//
'// Indigo Terminal Emulator
'// Timed Command Automation Script
'// Version 1.0
'//
'// shadeBlue Software
'// http://www.shadeblue.com
'//
'///////////////////////////////////////////////////////////
'///////////////////////////////////////////////////////////'// declare program constants
Const MY_COMMAND = "date"
'//------------------------------------
'// Host connection established
'//------------------------------------
Sub Host_Connected()'// say hello
Host.Post vbCrLf
Host.Post "--------------------------------------------------------------------" & vbCrLf
Host.Post "SCRIPT STARTED" & vbCrLf
Host.Post "--------------------------------------------------------------------" & vbCrLf
'// enqueue first command
EnqueueCommandEnd Sub
'//------------------------------------
'// Host connection disconnected
'//------------------------------------
Sub Host_Disconnected()'// clear host command queue
Host.Queue.Clear'// say goodbye
Host.Post vbCrLf
Host.Post "--------------------------------------------------------------------" & vbCrLf
Host.Post "SCRIPT SUSPENDED" & vbCrLf
Host.Post "--------------------------------------------------------------------" & vbCrLfEnd Sub
'//------------------------------------
'// Host attempting to send data command
'// (Return the command to process)
'//------------------------------------
Function Host_Send(Byval command)'// if we see out command issued, then we can enqueue the next cycle
if (command = MY_COMMAND) thenHost.Post "--------------------------------------------------------------------" & vbCrLf
Host.Post "SCRIPT QUEUEING NEXT COMMAND" & vbCrLf
Host.Post "--------------------------------------------------------------------" & vbCrLfEnqueueCommand
end if
'// transmit unmodified command
Host_Send = commandEnd Function
'//-----------------------------------------------------------
'// This function queues the next command
'//-----------------------------------------------------------
Function EnqueueCommand()'// clear host command queue
Host.Queue.Clear
'// wait 10 seconds before sending command
Host.Queue.Add MY_COMMAND, 10000
'// begin processing the queued instructions
Host.Queue.SendEnd Function
'//-----------------------------------------------------------
'// This function is needed to configure the Indigo session
'// scripting options. This is effectivaly a NO-OP function
'//-----------------------------------------------------------
Function ReceiveData(ByVal sData)'// don't do anythere here
'// just return the data received
ReceiveData = sDataEnd Function
0 Comments