DeBot Framework


DeBot\Bots
core/Bots.php at line 18

Class Bots

Singleton
└─Bots

public class Bots
extends Singleton

DeBot Core - Bots Created by dab ??? ?? 2009 Last Edited: Jul 29 2010 This is our Bot handler. It maintains all of our Bots' variables, and the other small things. Not actually too complex. Jul 29 2010 - Added support for syncronizing the Module Memory copies.

Author:
David (dab)
Version:
v1.0

Method Summary
final Bot[]

__construct()

Returns the bots that are created.

Boolean

addBot(string sNick)

This adds a new bot to the Bots class.

void

check()

This is called in our main loop.

Boolean

delBot(String sNick)

This does the opposite of the addBot.

void

getBot(string sNick)

Fetches the object for the bot so we can use its methods

static string

getDef()

This returns the default bot.

void

load()

This function loads all of the bots from the Config.

static boolean|string

setDef(mixed sBotNick, string sKey)

This sets the default bot.

Methods inherited from DeBot\Singleton
__construct, obj

Method Detail

core/Bots.php at line 157

__construct

public final Bot[] __construct()

Returns the bots that are created.

Returns:
The array of bots created in the class

core/Bots.php at line 65

addBot

public Boolean addBot(string sNick)

This adds a new bot to the Bots class. It needs to be added this way so we can loop through them as it can be checked.

Parameters:
sNick - The nickanme of the bot to be added. Will be fetched from config, if not existant, pulls defBot

core/Bots.php at line 113

check

public void check()

This is called in our main loop. This performs the checks on each bot.


core/Bots.php at line 78

delBot

public Boolean delBot(String sNick)

This does the opposite of the addBot. Removes the bot from being checked and disconnects the bot from all servers.

Parameters:
sNick - The name of the bot (not current name, the name used to create the bot)

core/Bots.php at line 94

getBot

public void getBot(string sNick)

Fetches the object for the bot so we can use its methods

Parameters:
sNick - The nickname of the bot

core/Bots.php at line 127

getDef

public static string getDef()

This returns the default bot.

Returns:
the default bot

core/Bots.php at line 46

load

public void load()

This function loads all of the bots from the Config. the addBot makes further calls


core/Bots.php at line 140

setDef

public static boolean|string setDef(mixed sBotNick, string sKey)

This sets the default bot.

Parameters:
sKey - The bot to set as default
Returns:
New nick on success, false on failure

DeBot Framework