Contraclass › Bot

From Botdom Documentation

Jump to: navigation, search

Bot is the core class for Contra. It holds all of the bot data and makes sure everything is running properly.

Contents

Location

~/core/Core_class.php

Properties

public $start;		// Timestamp for when the bot was launched.
public $info = array(); 	// Information about the bot.
public $username;		// The username being used.
protected $_password;		// The password being used.
public $owner;		// The owner of the bot.
public $trigger;		// The trigger character being used.
public $aboutStr;		// The string used for the about message.
public $autojoin;		// The bot's autojoin list.
public $Console;		// Instance of the Console class.
public $sysString;		// System information string.
public $dAmn;			// Instance of dAmnPHP.
public $Events;		// Instance of the Events_system class.
public $Timer;		// Instance of the Timer class.
public $running = false;	// Whether we are still running on dAmn or not.
public $user;			// Instance of the User class.
public $mod = array();	// Instances of loaded modules.
public $shutdownStr = array();// Messages displayed on shutdown.

Methods

These are the methods present in Contra's Bot class.

__construct

This one is called when the class is instantiated. It loads everything, and checks for errors along the way.

load_config

This method loads the configuration data into the class. There are no return values given by this method.

save_config

Use this to save the bot's configuration data!

run

The main engine of the bot. Pretty much just a while loop.

Personal tools