modules.Script.html
dw_fluffos_v1/lib/www/external/java/telnet/Documentation/Source/modules.Script.html · 6.7 KB
From the archive dw_fluffos_v1.tar.gz
Download the archive « Back to the archive contents
<!--NewPage-->
<html>
<head>
<!-- Generated by javadoc on Mon Feb 23 10:46:39 CET 1998 -->
<a name="_top_"></a>
<title>
Class modules.Script
</title>
</head>
<body>
<pre>
<a href="packages.html">All Packages</a> <a href="tree.html">Class Hierarchy</a> <a href="Package-modules.html">This Package</a> <a href="modules.MudConnector.html#_top_">Previous</a> <a href="modules.TextLabel.html#_top_">Next</a> <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
Class modules.Script
</h1>
<pre>
<a href="java.lang.Object.html#_top_">java.lang.Object</a>
|
+----<a href="java.util.Dictionary.html#_top_">java.util.Dictionary</a>
|
+----<a href="java.util.Hashtable.html#_top_">java.util.Hashtable</a>
|
+----modules.Script
</pre>
<hr>
<dl>
<dt> public class <b>Script</b>
<dt> extends <a href="java.util.Hashtable.html#_top_">Hashtable</a>
<dt> implements <a href="modules.Module.html#_top_">Module</a>
</dl>
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.
<DL>
<DT><B>Scripts:</B>
<DD><PRE><PARAM NAME=script VALUE="<B><I>pattern</I></B>|<B><I>text</I></B>|<B><I>...</I></B>"></PRE>
<DD>A script contains of pairs of <I>pattern</I> and <I>text</I> strings.
If the pattern is matched against the output from the remote host,
the corresponding text will be sent. Each pattern will match only
<B>once</B> per session. A session is defined by connect and
disconnect.<P>
Thus it is possible to program an autologin as follows:<BR>
<PRE><B>"login:|leo|Password:|mypassword|leo@www|ls"</B></PRE>
Newlines will be added automatically to the string sent! At the
moment the order of the pattern and text pairs is <I>not</I> relevant.
<P>
It is possible to prompt the user for input if a match occurs. If the
corresponding <I>text</I> is a string enclosed in braces ([] or {}) a
dialog window is opened with <I>text</I> as prompt. A special case
is an empty prompt in which case the <I>pattern</I> 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:}".<P>
A special match like: "login:|[]" can be used to open a
dialog and display "login:" as prompt. This works for
"{}" as well.
</DL>
<dl>
<dt> <b>Version:</b>
<dd> $Id: Script.java,v 1.6 1997/11/03 10:25:57 leo Exp $
<dt> <b>Author:</b>
<dd> Matthias L. Jugel, Marcus Meißner
<dt> <b>See Also:</b>
<dd> <a href="modules.Module.html#_top_">Module</a>
</dl>
<hr>
<a name="index"></a>
<h2>
<img src="images/constructor-index.gif" width=275 height=38 alt="Constructor Index">
</h2>
<dl>
<dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#Script()"><b>Script</b></a>()
<dd>
</dl>
<h2>
<img src="images/method-index.gif" width=207 height=38 alt="Method Index">
</h2>
<dl>
<dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#connect(java.lang.String, int)"><b>connect</b></a>(String, int)
<dd> Configure the script module by reading the script PARAMeter.
<dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#disconnect()"><b>disconnect</b></a>()
<dd> Get notified of disconnection.
<dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#receive(java.lang.String)"><b>receive</b></a>(String)
<dd> This method is called when data is received.
<dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#setLoader(java.lang.Object)"><b>setLoader</b></a>(Object)
<dd> Set the applet as module loader
</dl>
<a name="constructors"></a>
<h2>
<img src="images/constructors.gif" width=231 height=38 alt="Constructors">
</h2>
<a name="Script"></a>
<a name="Script()"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>Script</b>
<pre>
public Script()
</pre>
<a name="methods"></a>
<h2>
<img src="images/methods.gif" width=151 height=38 alt="Methods">
</h2>
<a name="setLoader(java.lang.Object)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setLoader"><b>setLoader</b></a>
<pre>
public void setLoader(<a href="java.lang.Object.html#_top_">Object</a> o)
</pre>
<dl>
<dd> Set the applet as module loader
<dl>
<dt> <b>Parameters:</b>
<dd> o - the object that is the applet (must be an Applet)
<dt> <b>See Also:</b>
<dd> <a href="module.Module.html#_top_">Module</a>, <a href="java.applet.Applet.html#_top_">Applet</a>
</dl>
</dl>
<a name="connect(java.lang.String, int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="connect"><b>connect</b></a>
<pre>
public void connect(<a href="java.lang.String.html#_top_">String</a> host,
int port)
</pre>
<dl>
<dd> Configure the script module by reading the script PARAMeter.
<dl>
<dt> <b>Parameters:</b>
<dd> host - remote hostaddress - not used
<dd> port - remote port - not used
</dl>
</dl>
<a name="disconnect()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="disconnect"><b>disconnect</b></a>
<pre>
public void disconnect()
</pre>
<dl>
<dd> Get notified of disconnection. Do nothing.
</dl>
<a name="receive(java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="receive"><b>receive</b></a>
<pre>
public <a href="java.lang.String.html#_top_">String</a> receive(<a href="java.lang.String.html#_top_">String</a> s)
</pre>
<dl>
<dd> This method is called when data is received. It tries to match the
input to the list of patterns and sends corresponding text on success.
If the response is [] or {} the user will be prompted with the matching
text. You can modify the prompt string by entering it inside of the
brackets or curly braces (e.g. [Enter your id:]). In case of curly
braces the input area will not show the typed in text (for passwords)!
<dl>
<dt> <b>Parameters:</b>
<dd> s - The string to test.
<dt> <b>See Also:</b>
<dd> <a href="peer.InputPeer.html#_top_">InputPeer</a>
</dl>
</dl>
<hr>
<pre>
<a href="packages.html">All Packages</a> <a href="tree.html">Class Hierarchy</a> <a href="Package-modules.html">This Package</a> <a href="modules.MudConnector.html#_top_">Previous</a> <a href="modules.TextLabel.html#_top_">Next</a> <a href="AllNames.html">Index</a></pre>
</body>
</html>