Class: Master
Source Location: /OUTRAGEbot/System/Master.php
Master class for OUTRAGEbot
Author(s):
Version:
- 1.1.1-RC6 (Git commit: 09eae40a2d1115ab2c6e5a45c9734a09722196b1)
Copyright:
- David Weston (c) 2010 -> http://www.typefish.co.uk/licences/
|
|
|
Class Details
Class Variables
Class Methods
method Action [line 1551]
void Action(
string
$sChannel, string
$sMessage, [integer
$mSend = SEND_DEF])
|
|
Sends an action to the specified channel.
Tags:
Parameters:
method activatePlugin [line 1729]
bool activatePlugin(
string
$sPlugin)
|
|
Loads a plugin from the plugin directory.
Tags:
Parameters:
method addChild [line 284]
bool addChild(
string
$sChild, string
$sNickname, [string
$sUsername = null], [string
$sRealname = null])
|
|
This function creates a child. A child is an instance of the Socket, basically an IRC client.
Tags:
Parameters:
method addEventHandler [line 1912]
string addEventHandler(
string
$sEvent, callback
$cCallback)
|
|
Creates an event handler, designed for lambda functions.
Tags:
Parameters:
method addHandler [line 1950]
string addHandler(
string
$sInput, callback
$cCallback, [array
$aFormat = array()])
|
|
Create a command or event handler for IRC numerics/commands.
Tags:
Parameters:
method addTimer [line 1660]
string addTimer(
callback
$cCallback, float
$fInterval, integer
$iRepeat, mixed
$...)
|
|
Creates a timer, note that arguments to be passed to $cCallback to after $iRepeat. $sKey = $this->addTimer(array($this, 'Message'), '0.5000', '10', '#OUTRAGEbot', 'Test Message');
$sKey = $this->addTimer('sampleTimer', '10', '-1');
Tags:
Parameters:
method ctcpReply [line 1624]
void ctcpReply(
string
$sNickname, string
$sMessage)
|
|
Sends a CTCP reply. $this->ctcpReply('Westie', 'COMMAND something here');
Tags:
Parameters:
method ctcpRequest [line 1640]
void ctcpRequest(
string
$sNickname, string
$sRequest, [integer
$mSend = SEND_DEF])
|
|
Sends a CTCP request.
Tags:
Parameters:
method deactivatePlugin [line 1790]
bool deactivatePlugin(
string
$sPlugin)
|
|
Unloads an active plugin from memory.
Tags:
Parameters:
method doesChildExist [line 396]
bool doesChildExist(
string
$sChild)
|
|
Checks if a child exists. Note that the child name is not necessarily the IRC nick of the bot, but in most cases it is.
Tags:
Parameters:
method Format [line 1486]
string Format(
$sInputText, string
$sText)
|
|
Adds formatting to the text.
Tags:
Parameters:
method getActiveTimer [line 1706]
Gets the active timer ID.
Tags:
method getChannel [line 1088]
Channel getChannel(
string
$sChannel)
|
|
Returns a stdClass instance of the information about a channel. Will only work if the bot is in the channel, otherwise a blank object will be returned.
Tags:
Parameters:
method getChannelBanList [line 1143]
array getChannelBanList(
string
$sChannel)
|
|
Returns the active bans in the channel requested.
Tags:
Parameters:
method getChannelExceptList [line 1197]
array getChannelExceptList(
string
$sChannel)
|
|
Returns the active exceptions in the channel requested.
Tags:
Parameters:
method getChannelInviteList [line 1170]
array getChannelInviteList(
string
$sChannel)
|
|
Returns the active invite list in the channel requested.
Tags:
Parameters:
method getChannelList [line 1106]
Returns the channels that the bot is in.
Tags:
method getChannelTopic [line 1224]
array getChannelTopic(
string
$sChannel)
|
|
Returns the channel topic in the channel requested.
Tags:
Parameters:
method getChannelUserCount [line 1118]
integer getChannelUserCount(
string
$sChannel)
|
|
Returns the amount of users in the channel.
Tags:
Parameters:
method getChildConfig [line 437]
mixed getChildConfig(
string
$sKey)
|
|
Returns a value from the current bot's configuration.
Tags:
Parameters:
method getChildObject [line 322]
Socket getChildObject(
string
$sChild)
|
|
Returns an object of a child from its reference.
Tags:
Parameters:
method getChildren [line 303]
Returns a list of all the children that the bot has.
Tags:
method getHandler [line 1980]
array getHandler(
string
$sKey)
|
|
Gets the information of a bind from its reference ID.
Tags:
Parameters:
method getHostname [line 599]
string getHostname(
string
$sHost)
|
|
Get the users hostname from a hostname string.
Tags:
Parameters:
method getIBCCount [line 2342]
integer getIBCCount(
[string
$sChannel = "Default"])
|
|
Counts the amount of messages in the stack for the current bot group.
Tags:
Parameters:
method getIBCMessages [line 2326]
array getIBCMessages(
[string
$sChannel = "Default"])
|
|
Recieve all inter-bot-communication messages that are in the stack for this particular bot.
Tags:
Parameters:
method getNetworkConfig [line 455]
mixed getNetworkConfig(
string
$sKey)
|
|
Returns a value from the network configuration. This is anything that is within [~Network].
Tags:
Parameters:
method getNextChild [line 642]
This function gets the next child along in the queue.
Tags:
method getNickname [line 586]
string getNickname(
string
$sHost)
|
|
Get the users nickname from a hostname string.
Tags:
Parameters:
method getPlugin [line 1756]
Plugin getPlugin(
string
$sPlugin)
|
|
Gets the instance of the plugin if it exists.
Tags:
Parameters:
method getPluginName [line 1773]
string getPluginName(
class
$pInstance)
|
|
Get the name of the plugin from the instance
Tags:
Parameters:
method getRequest [line 2093]
array getRequest(
string
$sRequest, mixed
$mSearch, mixed
$mEndNumeric, [mixed
$iTimeout = 4], [integer
$iSleep = 0.3])
|
|
Request information realtime. The data that are you requesting (for instance, what is in $mSearch) will not be parsed by the bot. This essentially means it is the job of the code using that request to deal with parsing it properly.
Tags:
Parameters:
method getTimer [line 1695]
array getTimer(
string
$sKey)
|
|
Gets the information of a timer from its reference ID.
Tags:
Parameters:
method getUser [line 1074]
User getUser(
string
$sNickname)
|
|
Returns information about the user in an OOP format. This only currently retrieves channel information. For this, the user must be in a channel with the bot.
Tags:
Parameters:
method getUsername [line 573]
string getUsername(
string
$sHost)
|
|
Get the users username from a hostname string.
Tags:
Parameters:
method getWhois [line 2223]
array getWhois(
string
$sNickname, [boolean
$bKeepModes = false], integer
$iDelay)
|
|
Returns current WHOIS data about a user into an array.
Tags:
Parameters:
method introduceFunction [line 1845]
boolean introduceFunction(
string
$sFunction, callback
$cCallback)
|
|
Introduces a function handler.
Tags:
Parameters:
method Invite [line 2122]
void Invite(
string
$sChannel, string
$sNickname)
|
|
Invites a user to a channel.
Tags:
Parameters:
method isAdmin [line 1365]
Check if the current, active IRC user is a bot admin.
Tags:
method isChild [line 1381]
bool isChild(
[string
$sChild = ""])
|
|
Checks if either the current instance, or a specific instance is actually a child. Children differ from master bots in one variable.
Tags:
Parameters:
method isChildInChannel [line 1249]
bool isChildInChannel(
string
$sChannel)
|
|
Checks if the current child is in the channel.
Tags:
Parameters:
method isFunction [line 1871]
boolean isFunction(
string
$sFunction)
|
|
Checks if a function handler exists.
Tags:
Parameters:
method isPluginActivated [line 1832]
bool isPluginActivated(
string
$sPlugin)
|
|
Check if a plugin is loaded into memory.
Tags:
Parameters:
method isUserAdmin [line 1326]
bool isUserAdmin(
string
$sChannel, string
$sUser)
|
|
Checks if that user has admin in that channel. Admins have the mode ' & ', and may not be available on all networks.
Tags:
Parameters:
method isUserHalfOp [line 1284]
bool isUserHalfOp(
string
$sChannel, string
$sUser)
|
|
Checks if that user has half-op in that channel. Half operators have the mode ' % ', and may not be available on all networks.
Tags:
Parameters:
method isUserInChannel [line 1237]
bool isUserInChannel(
string
$sChannel, string
$sUser)
|
|
Checks if that user is actually in that channel.
Tags:
Parameters:
method isUserOper [line 1305]
bool isUserOper(
string
$sChannel, string
$sUser)
|
|
Checks if that user has operator in that channel. Operators have the mode ' @ '.
Tags:
Parameters:
method isUserOwner [line 1347]
bool isUserOwner(
string
$sChannel, string
$sUser)
|
|
Checks if that user has owner in that channel. Owners have the mode ' ~ ', and may not be available on all networks.
Tags:
Parameters:
method isUserVoice [line 1263]
bool isUserVoice(
string
$sChannel, string
$sUser)
|
|
Checks if that user has voice in that channel. Voicers have the mode ' + '.
Tags:
Parameters:
method Join [line 2147]
void Join(
string
$sChannel, [mixed
$mSend = SEND_DEF])
|
|
Allows the bot to join a channel.
Tags:
Parameters:
method Kick [line 2135]
void Kick(
string
$sChannel, string
$sNickname, [string
$sReason = "Kick"])
|
|
Kicks a user from a channel.
Tags:
Parameters:
method Message [line 1537]
void Message(
string
$sChannel, string
$sMessage, [integer
$mSend = SEND_DEF])
|
|
Sends a message to the specified channel.
Tags:
Parameters:
method Mode [line 2172]
void Mode(
string
$sChannel, string
$sMode)
|
|
Set the modes on a channel.
Tags:
Parameters:
method Notice [line 1576]
void Notice(
string
$sNickname, string
$sMessage, [integer
$mSend = SEND_DEF])
|
|
Sends a notice to the specified channel.
Tags:
Parameters:
method parseHostmask [line 612]
array parseHostmask(
string
$sHost)
|
|
Get the hostmask info as an array.
Tags:
Parameters:
method parseModes [line 2184]
array parseModes(
$sModes
$sMode)
|
|
Parses a mode string into a usable array.
Tags:
Parameters:
method Part [line 2160]
void Part(
string
$sChannel, [string
$sReason = null], [mixed
$mSend = SEND_DEF])
|
|
Allows the bot to part a channel.
Tags:
Parameters:
method reactivatePlugin [line 1819]
bool reactivatePlugin(
string
$sPlugin)
|
|
Unloads and reloads a plugin.
Tags:
Parameters:
method removeChild [line 364]
bool removeChild(
string
$sChild, [string
$sReason = null])
|
|
Removes a child from this group. Please note that you cannot remove the master. That would just be pointless.
Tags:
Parameters:
method removeEventHandler [line 1926]
void removeEventHandler(
string
$sHandlerID)
|
|
Removes the event hander.
Tags:
Parameters:
method removeFunction [line 1883]
void removeFunction(
string
$sFunction)
|
|
Remove a function handler.
Tags:
Parameters:
method removeHandler [line 1997]
bool removeHandler(
string
$sKey)
|
|
Delete a reference to a bind handler.
Tags:
Parameters:
method removeTimer [line 1717]
bool removeTimer(
string
$sKey)
|
|
Removes a timer from memory.
Tags:
Parameters:
method resetChild [line 417]
void resetChild(
string
$sChild, [string
$sMessage = "Rehash!"])
|
|
This function reconnects a IRC child. This is useful in cases where IRC bots have to physically disconnect from the network in order to work.
Tags:
Parameters:
method sendIBCMessage [line 2312]
void sendIBCMessage(
string
$sBotGroup, mixed
$mContents, [string
$sChannel = "Default"])
|
|
Send an inter-bot-communication message to a bot-group. It will remain in the queue until it is retrieved from the stack.
Tags:
Parameters:
method sendRaw [line 499]
void sendRaw(
string
$sMessage, [mixed
$mSend = SEND_DEF])
|
|
Sends RAW IRC Messages to the server. There are many different ways of sending a message with this function - this covers all outbound functions. There are three different ways, using the definitions, a string of a child name, or an array of children's names. as Definitions: - SEND_MAST: Sends a message from the master child.
- SEND_CURR: Sends a message from the current child.
- SEND_DIST: Sends a message from each child in succession.
- SEND_ALL: Send a message from all children at the same time.
as a String: You can send a message from a child's name. For children that are defined in the configuration, it will be their original nickname, whilst for bots created later, it will be name you give them. as an Array: You can send messages only from selected children. The same note above applies. $this->sendRaw('PRIVMSG #Westie :hai there'); // Use default settings.
$this->sendRaw('PRIVMSG #Westie :Everyone says hai!', SEND_ALL); // All children.
$this->sendRaw('PRIVMSG #Westie :OUTRAGEbot says hai!', 'OUTRAGEbot'); // From the OUTRAGEbot child.
Tags:
Parameters:
method setNickname [line 345]
void setNickname(
string
$sChild, string
$sNewNick)
|
|
This function renames a child by its reference. The reference is (in most cases) the bot's original name. Look in the configuration for more details.
Tags:
Parameters:
method stripAll [line 1522]
string stripAll(
string
$sText)
|
|
Strips the text of formatting and colours.
Tags:
Parameters:
method stripColour [line 1510]
string stripColour(
string
$sText)
|
|
Strips the text of colours.
Tags:
Parameters:
method stripFormat [line 1498]
string stripFormat(
string
$sText)
|
|
Strips the text of formatting.
Tags:
Parameters:
method syncChannelLists [line 1131]
void syncChannelLists(
string
$sChannel)
|
|
Syncs the internal channel lists. Useful if there happens to be a mistake.
Tags:
Parameters:
method triggerEvent [line 1401]
void triggerEvent(
string
$sEvent, mixed
$...)
|
|
Invokes an event/callback from plugins.
Tags:
Parameters:
method triggerSingleEvent [line 1438]
void triggerSingleEvent(
string
$sPlugin, string
$sEvent, mixed
$...)
|
|
Invokes an event from one plugin only.
Tags:
Parameters:
method triggerSingleEventArray [line 1456]
void triggerSingleEventArray(
string
$sPlugin, string
$sEvent, array
$aArguments, [
$iTimerCalled = false])
|
|
Invokes an event from one plugin only, but arguments are an array
Tags:
Parameters:
|
|