org.alicebot.server.core.util
Class Shell

java.lang.Object
  extended by org.alicebot.server.core.util.Shell

public class Shell
extends java.lang.Object

Provides a simple shell for interacting with the bot at a command line (was originally in Graphmaster).

Author:
Jon Baer, Noel Bush

Field Summary
static java.lang.String PROMPT
          The string to use for an interactive console.
static java.lang.String SHELL
          Flag for a line in an interactive shell.
 
Constructor Summary
Shell()
          A Shell with default input and output streams (System.in and System.out).
Shell(java.io.InputStream in, java.io.PrintStream display, java.io.PrintStream prompt)
          A Shell with custom input and output streams.
 
Method Summary
 java.lang.String getCurrentBotID()
           
 void help()
          Prints help text.
 void listBotFiles()
          Prints a list of files loaded by the current bot.
 void load(java.lang.String line, java.lang.String botid)
          Loads a given file for a given bot.
 void rollChatLog(java.lang.String botid)
          Rolls over the chat log file.
 void rollTargets()
          Rolls over the targets data file.
 void run()
          Runs the shell.
 void showBotList()
          Shows a list of active bots.
 void switchToBot(java.lang.String newBotID)
          Switches to a bot, given an id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROMPT

public static final java.lang.String PROMPT
The string to use for an interactive console.

See Also:
Constant Field Values

SHELL

public static final java.lang.String SHELL
Flag for a line in an interactive shell.

Constructor Detail

Shell

public Shell()
A Shell with default input and output streams (System.in and System.out).


Shell

public Shell(java.io.InputStream in,
             java.io.PrintStream display,
             java.io.PrintStream prompt)
A Shell with custom input and output streams.

Parameters:
in - the input stream
display - the display output stream
prompt - the prompt output stream
Method Detail

run

public void run()
Runs the shell.


getCurrentBotID

public java.lang.String getCurrentBotID()

help

public void help()
Prints help text.


load

public void load(java.lang.String line,
                 java.lang.String botid)
Loads a given file for a given bot.


showBotList

public void showBotList()
Shows a list of active bots.


switchToBot

public void switchToBot(java.lang.String newBotID)
Switches to a bot, given an id.

Parameters:
newBotID -

listBotFiles

public void listBotFiles()
Prints a list of files loaded by the current bot.


rollChatLog

public void rollChatLog(java.lang.String botid)
Rolls over the chat log file.


rollTargets

public void rollTargets()
Rolls over the targets data file.