com.levelonelabs.aimbot
Class AIMBot

java.lang.Object
  extended bycom.levelonelabs.aim.AIMAdapter
      extended bycom.levelonelabs.aimbot.AIMBot
All Implemented Interfaces:
AIMListener

public class AIMBot
extends AIMAdapter

The main Aimbot that uses the aim package to communicate with AIM and provides services via AIM through various bot modules that perform action when clients make specific queries to the screename registered by this bot.

Author:
Scott Oster (ostersc@alumn.rpi.edu)

Field Summary
protected  AIMSender aim
          A handle to the outgoing AIM connection
static java.lang.String ROLE_ADMINISTRATOR
           
static java.lang.String ROLE_ENEMY
           
static java.lang.String ROLE_USER
           
 
Constructor Summary
AIMBot()
          Constructor for the AIMBot object
 
Method Summary
 void addGroup(AIMGroup group)
          Adds a Group
protected static org.w3c.dom.Document createDomDocument()
          createDomDocument - creates an empty document
 AIMGroup getGroup(java.lang.String groupName)
          Gets the specified group
 java.util.Enumeration getGroups()
          Gets an enum of the groups of the AIMBot
 java.lang.String getUsername()
          Returns the AIM username of the bot.
 void handleError(java.lang.String error, java.lang.String message)
          Called when AIM encounters an error
 void handleMessage(AIMBuddy buddy, java.lang.String request)
          Will call the appropriate bot module to service the request.
 void handleWarning(AIMBuddy enemy, int amount)
          Handle being warned from others.
 void init(java.lang.String propertiesFileName)
          Read in the properties file and configure the bot from it.
static void main(java.lang.String[] args)
          Start up the bot.
protected  void registerModule(BotModule mod)
          All bot modules will call this and pass a reference to themselves and an ArrayList containing the keywords they want to listen for
 void removeGroup(AIMGroup group)
          Removes the specified group
 
Methods inherited from class com.levelonelabs.aim.AIMAdapter
handleBuddyAvailable, handleBuddySignOff, handleBuddySignOn, handleBuddyUnavailable, handleConnected, handleDisconnected
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ROLE_USER

public static final java.lang.String ROLE_USER
See Also:
Constant Field Values

ROLE_ENEMY

public static final java.lang.String ROLE_ENEMY
See Also:
Constant Field Values

ROLE_ADMINISTRATOR

public static final java.lang.String ROLE_ADMINISTRATOR
See Also:
Constant Field Values

aim

protected AIMSender aim
A handle to the outgoing AIM connection

Constructor Detail

AIMBot

public AIMBot()
Constructor for the AIMBot object

Method Detail

main

public static void main(java.lang.String[] args)
Start up the bot.

Parameters:
args - The command line arguments

init

public void init(java.lang.String propertiesFileName)
Read in the properties file and configure the bot from it.

Parameters:
propertiesFileName - the name of the properties file to look for with the classloader.

getUsername

public java.lang.String getUsername()
Returns the AIM username of the bot.

Returns:
the AIM username of the bot.

getGroup

public AIMGroup getGroup(java.lang.String groupName)
Gets the specified group

Parameters:
groupName -
Returns:
The group value

getGroups

public java.util.Enumeration getGroups()
Gets an enum of the groups of the AIMBot

Returns:
The groups enumeration

handleMessage

public void handleMessage(AIMBuddy buddy,
                          java.lang.String request)
Will call the appropriate bot module to service the request.

Specified by:
handleMessage in interface AIMListener
Overrides:
handleMessage in class AIMAdapter
Parameters:
buddy - the buddy making the request
request - the text of the request

handleError

public void handleError(java.lang.String error,
                        java.lang.String message)
Called when AIM encounters an error

Specified by:
handleError in interface AIMListener
Overrides:
handleError in class AIMAdapter
Parameters:
error - the error code
message - decsriptive text describing the error

handleWarning

public void handleWarning(AIMBuddy enemy,
                          int amount)
Handle being warned from others. Mark them with the Enemy role and warn them back after a witty response.

Specified by:
handleWarning in interface AIMListener
Overrides:
handleWarning in class AIMAdapter
Parameters:
enemy - the buddy that warned us
amount - the current warning level

addGroup

public void addGroup(AIMGroup group)
Adds a Group

Parameters:
group - The feature to be added to the Group attribute

removeGroup

public void removeGroup(AIMGroup group)
Removes the specified group

Parameters:
group -

registerModule

protected void registerModule(BotModule mod)
All bot modules will call this and pass a reference to themselves and an ArrayList containing the keywords they want to listen for

Parameters:
mod - the module

createDomDocument

protected static org.w3c.dom.Document createDomDocument()
createDomDocument - creates an empty document

Returns:
Document - returns an empty document


Copyright © 2001-2005 Java AIM Bot. All Rights Reserved.