JTA - Telnet/SSH for the JAVA(tm) platform: Script Plugin

© 1996-2000 Matthias L. Jugel and Marcus Meißner

Version 2.0 / Java 2 and 1.1.x
Available under GNU General Public License

Homepage Applet Test Download Documentation Users / Opinions

Script Plugin

To automate certain processes like login into guest accounts or BBS' the script plugin enables you to write simple scripts of pattern and answer pairs to be sent to the remote host if the pattern was found in the data that came from the remote host.

To use the script simply put it into the plugin list as described in the configuration of the Application or Applet. The script language itself is very basic:

pattern|text|pattern_1|text_1
Any number of pattern and text pairs can be given and they will be processed in the order they appear in the script. That means if pattern is not matched pattern_1 will not be processed! For example the following script would login into some computer:
login:|leo|password:|mypass
It first waits for the pattern "login:" and sends the text "leo\n" (\n is a newline). Then it waits for the pattern "password:" and if that appears it sends "mypass\n". Next you could add some pattern that looks like your command prompt and issue a shell command.

If the first pattern is emtpy, its answer string will be sent on connect. For instance:
 

|connect foo|login:|leo|password:|mypass
will send 'connect foo' upon connect.
 

You can configure the plugin using the following properties:

Property Documentation
Script.script This property contains the script that is used by the plugin.

NOTE:
The Script plugin MUST be BETWEEN the Telnet or SSH Plugin and the Terminal plugin.
The order of plugins in the plugins line is important!

 Example: plugins=Status,Socket,Telnet,Script,Terminal

Additional Programmer Documentation is available:
 
de.mud.jta.plugin.Script
This is the programmer documentation for the plugin. Use it as an example if you want to write your own back end plugins.
de.mud.jta.event
This plugins uses some of the events and listeners described here.
Copyright 1996-2000 Matthias L. Jugel, Marcus Meißner
$Id: Script.html,v 1.9 2001/05/22 06:35:37 marcus Exp $