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. |
|