Scripting Guide
NAURTECH WEB BROWSER AND TERMINAL EMULATION FOR WINDOWS CE AND WINDOWS MOBILE
CETerm Scripting Guide Page 93
4.11 THE ONSESSIONCONNECT EVENT
The OnSessionConnect event is fired when a session initially connects to the
specified host. The handler can be used to initiate an automated login using the
“expect” script and “ExpectMonitor” class.
Syntax
function OnSessionConnect ( session )
session – index of session which connected.
Example
An example using OnSessionConnect to start the automated login was shown
above in Section 2.6 and is repeated below. Please refer to Section 2.6 for
details. The “expect” script is discussed in Section 5.1.
/* OnSessionConnect */
function OnSessionConnect ( session )
{
// Set login information
var myusername = "joeuser";
var mypassword = "secret";
var waittime = 8000; // Milliseconds waiting for each text
// Only login session 1
if (session == 1)
{
// Look for "login" then "password"
expect( session, waittime, "Login", myusername + "\r",
"Password", mypassword + "\r" );
}
}
4.12 THE ONSESSIONDISCONNECT EVENT
The OnSessionDisconnect event is fired when a session is disconnected by a
user action. The handler can be used to switch to another session, exit, or
perform other cleanup tasks.