com.levelonelabs.aimbot
Class BotModule

java.lang.Object
  extended bycom.levelonelabs.aimbot.BotModule
Direct Known Subclasses:
BabelModule, BuddyManagementModule, DefaultModule, HeadlinesModule, HeyuModule, ListModule, MegaHalModule, MessengerModule, MoviesModule, PreferenceModule, ReminderModule, ScheduleModule, SkiReportModule, StockModule, TelnetModule, TicTacToeModule, TVListingsModule, UserAdminModule, UserInformationModule, WeatherModule

public abstract class BotModule
extends java.lang.Object

All Modules that wish to provide services to AIMBot should implement this. This base class acts as a facade to allow a extending module to be pretty much self-contained and just call methods here without needing to know about the AIMSender.

Author:
Scott Oster

Field Summary
protected  AIMBot bot
          A handle to the hosting AIMBot
 
Constructor Summary
BotModule(AIMBot bot)
          Constructor for the BotModule object
 
Method Summary
 void addAIMListener(AIMListener listener)
          Convenience method to call aimsender's addAIMListener
 void addBuddies(java.util.List aimbuddies)
          Convience method to call aimsender's addBuddies
 void addBuddy(AIMBuddy buddy)
          Convience method to call aimsender's addBuddy
 void denyBuddy(AIMBuddy buddy)
          Deny a buddy
 AIMBuddy getBuddy(java.lang.String name)
          Convience method to call aimsender's getBuddy
 java.util.Iterator getBuddyNames()
          Convience method to call aimsender's getBuddyIterator
abstract  java.lang.String getName()
          Gets the canonical name of the BotModule
 int getPermitMode()
          Gets the permit mode that is set on the server.
abstract  java.util.ArrayList getServices()
          Must implement this to return a list of Strings that represent the keywords the module wants to be called for
abstract  java.lang.String help()
          A String to be presented to a client that descibes the services (keywords) this module provides.
abstract  void performService(AIMBuddy buddy, java.lang.String query)
          This will be called when the AIMBot gets a string starting with a keyword that this module advertised as a service.
 void permitBuddy(AIMBuddy buddy)
          Permit a buddy
 void removeBuddies(java.util.List aimbuddies)
          Convience method to call aimsender's removeBuddies
 void removeBuddy(AIMBuddy buddy)
          Convience method to call aimsender's removeBuddy
 void sendMessage(AIMBuddy buddy, java.lang.String text)
          Convenience method to call aimsender's sendMessage
 void sendWarning(AIMBuddy buddy)
          Convenience method to call aimsender's sendWarning
 void setAvailable()
          Clear unvailable message
 void setPermitMode(int mode)
          Sets the permit mode on the server.
 void setUnavailable(java.lang.String reason)
          Set unvailable message
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bot

protected AIMBot bot
A handle to the hosting AIMBot

Constructor Detail

BotModule

public BotModule(AIMBot bot)
Constructor for the BotModule object

Parameters:
bot - A handle to the hosting AIMBot
Method Detail

getName

public abstract java.lang.String getName()
Gets the canonical name of the BotModule

Returns:
The name of the module

getBuddy

public AIMBuddy getBuddy(java.lang.String name)
Convience method to call aimsender's getBuddy

Parameters:
name -
Returns:
The buddy value

getBuddyNames

public java.util.Iterator getBuddyNames()
Convience method to call aimsender's getBuddyIterator

Returns:
iterator

getServices

public abstract java.util.ArrayList getServices()
Must implement this to return a list of Strings that represent the keywords the module wants to be called for

Returns:
all list of strings that are the keywords the module wants to hear about

addBuddy

public void addBuddy(AIMBuddy buddy)
Convience method to call aimsender's addBuddy

Parameters:
buddy - The feature to be added to the Buddy attribute

addBuddies

public void addBuddies(java.util.List aimbuddies)
Convience method to call aimsender's addBuddies

Parameters:
aimbuddies - List of AIMBuddys

removeBuddy

public void removeBuddy(AIMBuddy buddy)
Convience method to call aimsender's removeBuddy

Parameters:
buddy - remove the specified buddy

removeBuddies

public void removeBuddies(java.util.List aimbuddies)
Convience method to call aimsender's removeBuddies

Parameters:
aimbuddies - List of AIMBuddys

denyBuddy

public void denyBuddy(AIMBuddy buddy)
Deny a buddy

Parameters:
buddy -

permitBuddy

public void permitBuddy(AIMBuddy buddy)
Permit a buddy

Parameters:
buddy -

setPermitMode

public void setPermitMode(int mode)
Sets the permit mode on the server. (Use constants from AIMSender)

Parameters:
mode -

getPermitMode

public int getPermitMode()
Gets the permit mode that is set on the server.

Returns:
int representation (see constants) of current permit mode.

sendMessage

public void sendMessage(AIMBuddy buddy,
                        java.lang.String text)
Convenience method to call aimsender's sendMessage

Parameters:
buddy - buddy to message
text - text to send buddy

sendWarning

public void sendWarning(AIMBuddy buddy)
Convenience method to call aimsender's sendWarning

Parameters:
buddy - buddy to warn

setAvailable

public void setAvailable()
Clear unvailable message


setUnavailable

public void setUnavailable(java.lang.String reason)
Set unvailable message

Parameters:
reason -

addAIMListener

public void addAIMListener(AIMListener listener)
Convenience method to call aimsender's addAIMListener

Parameters:
listener - The listener

help

public abstract java.lang.String help()
A String to be presented to a client that descibes the services (keywords) this module provides. NOTE: a URL to documentation is acceptable.

Returns:
the help text

performService

public abstract void performService(AIMBuddy buddy,
                                    java.lang.String query)
This will be called when the AIMBot gets a string starting with a keyword that this module advertised as a service.

Parameters:
buddy -
query -


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