Functions and Interfaces provided by default core modules.

Main Modules

Modules in the Main section are required for BeBot functionality. They are loaded before any other modules, and are loaded in a specific order.

security

File Path: main/03_Security.php
Reference:

$this -> bot -> core("security")

—-

check_access

Description

bool check_access ( string $character, string $access_level )
Check to see if $character meets or exceeds $access_level.

Parameters

character

The name of the character an access check is being performed on.

access_level

The access level to check against. BANNED1), ANONYMOUS, GUEST, MAMEBER, LEADER, ADMIN, SUPERADMIN, OWNER.

Return Values

TRUE if the character meets or exceeds the give access level, otherwise false.

Examples

if ($this -> bot -> core("security") -> check_access("Glarawyn", "MEMBER"))
{
    print_r("You access level is at least MEMBER!");
}
else
{
    print_r("Your access level is lower than MEMBER!");
}

See Also

is_banned

Description

bool is_banned ( string $character )
Check to see if $character is banned.

Parameters

character

The name of the character an access check is being performed on.

Return Values

TRUE if the character is banned, otherwise false.

Examples

if ($this -> bot -> core("security") -> is_banned("Glarawyn"))
{
    print_r("You are banned!");
}
else
{
    print_r("You are not banned!");
}

See Also

maintenance

File Path: main/05_Maintenance.php

prefs

File Path: main/06_Preferences.php

$this -> bot -> core("prefs")

create

Description

datatype create ( string $module, string $name, string $description, mixed $default, mixed $possible_values)
Creates a new preference definition.

Parameters

module

Name of the module the preference is for.

name

Name of the preference.

description

Description of the preference.

default

Default value of the preference.

possible_values

List/Array/Something of possible values for the preference.

Return Values

This function does not return anything.

Examples

/*
* Enter some Example Code
*/

See Also

* [[#other_function_name|other_function_name()]]


get

Description

array get ( mixed $name, mixed $module=false, mixed $setting=false )
Retrieve preferences for a user. If only name is give, all preferences for the user will be returned. If name and module are given, all the user's preferences for that module will be returned. If name, module, and setting are given, only the specific preference will be returned.

Parameters

name

Character name or UID of the player we want to retrieve preferences for.

module

Name of the module to retrieve preferences for.

setting

Return Values

What does this function return.

Examples

/*
* Enter some Example Code
*/

See Also

* [[#other_function_name|other_function_name()]]


change

Description

string change ( mixed $name, string $module, string $setting, mixed $value )
Changes a preference value.

Parameters

name

Character name or UID of the user to change a preference for.

module

Name of the module where the preference exists.

setting

Name of the preference to be changed.

value

New value for the preference.

Return Values

  • Preference for $name, {$module}→{$setting} was already set to '$value'. Nothing changed.
  • Preferences for $name, {$module}→{$setting} reset to default value '$value'
  • Preference was created for $name, {$module}→{$setting} = $value
  • Preferences for $name, {$module}→{$setting} changed to '$value'

Examples

/*
* Enter some Example Code
*/

See Also

* [[#other_change|other_change()]]


change_default

Description

datatype change_default ( string $name, string $module, string $setting, mixed $value )
Changes the default value of a preference.

Parameters

name

Name of the person changing the default value.

module

Name of the module the preference exists under.

setting

Name of the preference.

value

New default value for the preference.

Return Values

  • The default value for {$module}→{$setting} has been set to '$value'.

Examples

/*
* Enter some Example Code
*/

See Also

* [[#other_change_default|other_change_default()]]


exists

Description

datatype exists ( string $module, string $setting )
Check to see if a preference exists.

Parameters

module

Name of the module.

variable2

Name of the preference.

Return Values

TRUE if the preference exists, otherwise false.

Examples

/*
* Enter some Example Code
*/

See Also

* [[#other_exists|other_exists()]]


settings

File Path: main/06_Settings.php

$this -> bot -> core("settings")

exists

Description

bool function_name ( string $module, string $setting )
Checks if a setting exists.

Parameters

module

Name of the group/module.

setting

Name of the setting.

Return Values

True if the setting exists, otherwise false.

Examples

/*
* Enter some Example Code
*/

See Also

* [[#other_function_name|other_function_name()]]


get

Description

mixed get ( string $module, string $setting )
Retrives a setting from the database.

Parameters

module

Name of the group/module.

setting

Name of the setting.

Return Values

Return Values

Returns the value of the specified setting.

Examples

/*
* Enter some Example Code
*/

See Also

* [[#other_function_name|other_function_name()]]


create

Description

datatype create ( string $module, string $setting, mixed $value, string $longdesc, string $defaultoptions=“”, bool $hidden=FALSE, int $disporder=1 )
Creates a new or Updates an existing setting in the database.

Parameters

module

Name of the settings group/module.

setting

Name of the setting.

value

Default value of the setting.

longdesc

Description of the setting.

defaultoptions

Semicolon (;) seperated list of options to display in the settings interface.

hidden

If set to true, the setting will be hidden from the settings interface.

disporder

Set the display order of the setting in the settings interface. By default settings are displayed alphabetically. This can override that.

Return Values

Returns an error array.

Examples

/*
* Enter some Example Code
*/

See Also

* [[#other_function_name|other_function_name()]]


del

Description

datatype del ( string $module, string $setting=NULL )
Deletes a setting or group of settings from the database.

Parameters

module

Group/Module of the setting(s) to be deleted.

setting

Name of the setting to be deleted. If setting is omitted, all settings for the module will be deleted.

Return Values

Error status array.

Examples

// Delete the setting named example in the setting group named TestSettings
$this -> bot -> core("settings") -> del("TestSettings", "Example");
// Delete all settings in the group named TestSettings
$this -> bot -> core("settings") -> del("TestSettings");

See Also

* [[#other_function_name|other_function_name()]]


access_control

File Path: main/09_AccessControl.php

roster_core

File Path: main/10_Roster.php

flexible_security

File Path: main/11_FlexibleSecurity.php

ini

File Path: main/12_ConfigMagik.php

tools

File Path: main/14_Tools.php

$this -> bot -> core("tools")

chatcmd

Description

datatype chatcmd ( string $link, string $title [, mixed $origin ] )
This function generates chat commands in front of a link, useful for inside of a text window.

Parameters

Usually the chat command without prefix.

title

Title of the link.

origin

Origin of the original chat command, or the desired channel for the generated chat command.

Return Values

  • <a href=\'chatcmd:/'.$chatcmd.$link . '\'>' . $title . '</a> === Examples === <code php> /* * Enter some Example Code */ </code> === See Also === * [[#other_function_name|other_function_name()]] —- ==== get_site ==== === Description === string get_site ( string $url [, bool [, $strip_headers [, int $server_timeout [, int $read_timeout ]]]] )
    This function returns the content of the given URL as a string. If CURL is available it will be used, otherwise will use sockets. === Parameters === == url == URL to retrive. == strip_headers == Optionally strip HTTP headers from the result. Default off. == server_timeout == Timeout for making a connection to the remote server. Only used for socket method. Default 25. == read_timeout == Timeout for reading data from the remote server. Only used for socket method. Default 30. === Return Values === Returns the content in a string. === Examples === <code php> /* * Enter some Example Code */ </code> === See Also === * [[#other_get_site|other_get_site()]] —- ==== xmlparse ==== === Description === string xmlparse ( string $xml, string $tag )
    Parses XML elements. === Parameters === == xml == XML to be parsed. == tag == XML tag to parse. === Return Values === Returns the content of the requested XML tag. === Examples === <code php> /* * Enter some Example Code */ </code> === See Also === * [[#other_function_name|other_function_name()]] —- ==== make_blob ==== === Description === string make_blob ( string $title, string $content )
    This function makes a text based click window. === Parameters === == title == Title of the click window. == content == Content of the click window. === Return Values === Returns a text window string. === Examples === <code php> /* * Enter some Example Code */ </code> === See Also === * [[#other_make_blob|other_make_blob()]] —- ==== make_item ==== === Description === string make_item ( string $lowid, string $highid, string $ql, string $name [, bool $alternate ] )
    Creates a text blob. === Parameters === == lowid == Low Quality Item ID for the item link. == highid == High Quality Item ID for the item link. == ql == Quality of the item link. == name == Name of the item. == alternate == Setting this to TRUE will return a link with single quotes instead of double quotes. === Return Values === Returns an item link. === Examples === <code php> /* * Enter some Example Code */ </code> === See Also === * [[#other_function_name|other_function_name()]] —- ==== parse_item ==== === Description === array parse_item ( string $item )
    Takes an item string and returns an array with lowid, highid, ql and name. === Parameters === == item == Description of variable1. === Return Values === Returns an array with lowid, highid, ql and name. If $item is unparsable it returns a BotError === Examples === <code php> /* * Enter some Example Code */ </code> === See Also === * [[#other_function_name|other_function_name()]] —- ==== is_item ==== === Description === bool is_item ( string $item )
    Returns true if $item is an itemref, false otherwise. === Parameters === == item == An item link. === Return Values === Returns true if $item is an itemref, false otherwise. === Examples === <code php> /* * Enter some Example Code */ </code> === See Also === * [[#other_is_item|other_is_item()]] —- ==== int_to_string ==== === Description === string function_name ( int $int )
    Convert an overflowed (unsigned) integer to a string with the correct positive unsigned integer value. === Parameters === == int == Overflowed integer. === Return Values === * String with the correct positive unsigned integer value * If the passed integer is not negative, the integer is merely passed back as a string. === Examples === <code php> /* * Enter some Example Code */ </code> === See Also === * [[#other_function_name|other_function_name()]] —- ==== string_to_int ==== === Description === int string_to_int ( string $string )
    Used to convert an unsigned interger in string form to an overflowed (negative) integer. === Parameters === == string == String form of an integer. === Return Values === * An overflowed (negative) integer. * If the passed string is not an integer large enough to overflow, the string is merely passed back as an integer. === Examples === <code php> /* * Enter some Example Code */ </code> === See Also === * [[#other_function_name|other_function_name()]] —- ==== validate_player ==== === Description === datatype validate_player ( string $name [ , bool $check_exists ] )
    Checks if a player name is valid and if the player exists. === Parameters === == name == Name of the player we are validating. == check_exists == If set to true, the function will check to see if $name is a valid character in addition to checking if it is a valid player name. === Return Values === * Returns BotError on failure * Returns ucfirst(strtolower($name)) if the player exists. === Examples === <code php> /* * Enter some Example Code */ </code> === See Also === * [[#other_function_name|other_function_name()]] —- ===== chat ===== File Path: main/15_AOChatWrapper.php <code php> $this → bot → core(“chat”) </code> —- ==== get_uid ==== === Description === string get_uid ( string $user )
    Converts a name to user id. === Parameters === == user == Name of the character to lookup. === Return Values === Returns the UID of the requested user. === Examples === <code php> /* * Enter some Example Code */ </code> === See Also === * [[#other_function_name|other_function_name()]] —- ==== get_uname ==== === Description === string get_uname ( string $user )
    Gets the character name from a UID === Parameters === == UID == UID to lookup. === Return Values === Returns a UID. === Examples === <code php> /* * Enter some Example Code */ </code> === See Also === * [[#other_function_name|other_function_name()]] —- ==== buddy_add ==== === Description === bool buddy_add ( string $user [ , bool $queue ] )
    Adds $user to the bot's buddy list. === Parameters === == user == Name of the character to be added. == queue == Use the buddy queue (Default.) Set to FALSE if you want to bypass the queue. === Return Values === Returns TRUE on success, FALSE on failure. === Examples === <code php> /* * Enter some Example Code */ </code> === See Also === * [[#other_function_name|other_function_name()]] —- ==== buddy_remove ==== === Description === bool buddy_remove ( string $user )
    Removes a user from the bot's buddy list. === Parameters === == user == Username to remove. === Return Values === TRUE on success, FALSE on failure. === Examples === <code php> /* * Enter some Example Code */ </code> === See Also === * [[#other_function_name|other_function_name()]] —- ==== buddy_exists ==== === Description === bool buddy_exists ( string $who )
    Check to see if a buddy exists on the bot's friends list. === Parameters === == who == Name of player to check for. === Return Values === TRUE if the character is on the buddy list, otherwise FALSE. === Examples === <code php> /* * Enter some Example Code */ </code> === See Also === * [[#other_function_name|other_function_name()]] —- ==== buddy_online ==== === Description === bool buddy_online ( string $who )
    Checks to see if $who is online. === Parameters === == who == Name of the character to check online status for. === Return Values === TRUE if the character is online, otherwise false. === Examples === <code php> /* * Enter some Example Code */ </code> === See Also === * [[#other_function_name|other_function_name()]] —- ==== pgroup_invite ==== === Description === datatype pgroup_invite ( string $user )
    Invite user to private group. === Parameters === == user == User to invite to bot's private group. —- ==== pgroup_kick ==== === Description === datatype pgroup_kick ( string $user )
    Kicks a user from the bot's private group. === Parameters === == user == User who needs a #9 boot to the ass. —- function pgroup_kick_all() ==== pgroup_kick_all ==== === Description === datatype pgroup_kick_all ( )
    Kicks everyone from the bot's private group. —- ===== help ===== File Path: main/15_BotHelp.php ===== chat_queue ===== File Path: main/15_ChatQueue.php ===== colors ===== File Path: main/15_Colors.php ===== command_alias ===== File Path: main/15_CommandAlias.php ===== notify ===== File Path: main/15_Notify.php ===== online ===== File Path: main/15_OnlineDB.php ===== timer ===== File Path: main/15_Timer_Core.php ====== Common Core Modules ====== Common Core Modules are shared by Anarchy Online and Age of Conan. ===== aliis ===== File Path: core/Alias.php ===== alts ===== File Path: core/Alts.php ===== bot_statistics ===== File Path: core/BotStatistics.php ===== buddy_queue ===== File Path: core/Buddy_Queue.php ===== funfilters ===== File Path: core/FunFilters.php ===== irc ===== File Path: modules/IRC.php ===== logon_notifies ===== File Path: core/Logon_Notifies.php ===== module_core ===== File Path: core/ModuleCatcher.php ===== player_notes ===== File Path: core/PlayerNotes.php ===== points ===== File Path: modules/Points.php ===== professions ===== File Path: core/Professions.php ===== relay ===== File Path: modules/Relay.php ===== shortcuts ===== File Path: core/ShortCuts.php ===== statistics ===== File Path: core/Statistics.php ===== stringfilter ===== File Path: core/StringFilter.php ===== time ===== File Path: core/Time.php ===== user ===== File Path: core/User.php ====== Anarchy Online Specific Modules ====== These modules provide functionality unique to Anarchy Online. ===== whois ===== File Path: core/ao/Whois.php ====== Age of Conan Specific Modules ====== These modules provide functionality unique to Age of Conan. ===== autouseradd ===== File Path: modules/aoc/Autouseradd.php ===== items ===== File Path: core/aoc/Items.php ===== whois ===== File Path: core/aoc/Whois.php ====== Template for Module and Function Documentation ====== ===== module name ===== ==== function_name ==== === Description === datatype function_name ( datatype $variable1, datatype $variable2 )
    What this function does. === Parameters === == variable1 == Description of variable1. == variable2 == Description of variable2. === Return Values === What does this function return. === Examples === <code php> /* * Enter some Example Code */ </code> === See Also === * [[#other_function_name|other_function_name()]]
1) Checking for banned users should be done with the is_banned() function.
 
core_functions.txt · Last modified: 2013/09/12 22:49 (external edit)
[unknown button type]
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
WikiForumIRCBugs
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki