|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.Dictionary | +--java.util.Hashtable | +--modules.Script
A very simple scripting module. It takes pairs of pattern and text and sends the corresponding text when the pattern matches. Each pattern is only matched once per connected session.
<PARAM NAME=script VALUE="pattern|text|...">
Thus it is possible to program an autologin as follows:
"login:|leo|Password:|mypassword|leo@www|ls"Newlines will be added automatically to the string sent! At the moment the order of the pattern and text pairs is not relevant.
It is possible to prompt the user for input if a match occurs. If the corresponding text is a string enclosed in braces ([] or {}) a dialog window is opened with text as prompt. A special case is an empty prompt in which case the pattern will be shown as prompt. "[Your name:]" would open a dialog window with the text "Your name" as prompt. Curly braces have a special meaning; any user input will be shown as "*" which makes it possible to program password prompts. Example: "{Your password:}".
A special match like: "login:|[]" can be used to open a dialog and display "login:" as prompt. This works for "{}" as well.
Module
, Serialized FormConstructor Summary | |
Script()
|
Method Summary | |
void |
connect(java.lang.String host,
int port)
Configure the script module by reading the script PARAMeter. |
void |
disconnect()
Get notified of disconnection. |
java.lang.String |
receive(java.lang.String s)
This method is called when data is received. |
void |
setLoader(java.lang.Object o)
Set the applet as module loader |
Methods inherited from class java.util.Hashtable |
clear,
clone,
contains,
containsKey,
containsValue,
elements,
entrySet,
equals,
get,
hashCode,
isEmpty,
keys,
keySet,
put,
putAll,
rehash,
remove,
size,
toString,
values |
Methods inherited from class java.lang.Object |
finalize,
getClass,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public Script()
Method Detail |
public void setLoader(java.lang.Object o)
o
- the object that is the applet (must be an Applet)module.Module
,
Applet
public void connect(java.lang.String host, int port)
host
- remote hostaddress - not usedport
- remote port - not usedpublic void disconnect()
public java.lang.String receive(java.lang.String s)
s
- The string to test.peer.InputPeer
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |