DeBot Framework


main.php

DeBot Main Created by dab ??? ?? 2009 Last Edited: Jul 29 2010

This file is created to piece everything together and initiate the bot. This file is REQUIRED to run the bot. Jul 18 2010 - Added log support (initiating)


/**
 * DeBot Main
 * Created by dab ??? ?? 2009
 * Last Edited: Jul 29 2010
 *
 * This file is created to piece everything together and initiate the bot.
 * This file is REQUIRED to run the bot.
 * Jul 18 2010 - Added log support (initiating)
 *
 * @author David (dab) 
 * @version v1.0
 */

error_reporting( E_ALL );

include "core/Functions.php"; // Our Functions file. Contains small useful functions.
include "config.php";	 // The file with an array of settings to use.
include "core/Singleton.php"; // The class that allows the 'universal' usage of my bot class
include "core/Config.php"; // Manage Bot Settings
include "core/Bot.php";		 // The class where all bots are managed.
include "core/Bots.php";		 // The class where all bots are managed.
include "core/Server.php";	 // This loads a socket handler.
include "core/Servers.php"; // This handles all networks
include "core/Channel.php"; // Stores Channel Info
include "core/Timers.php"; // Timer class
include "core/Modules.php"; // Stores all module info, per bot
include "core/Module.php"; // Possible callbacks in a module
include "core/Logs.php"; // Logging Clas


Config	:: obj( )->load( $aConfig );

Timers  :: obj( )->load( );	// Sets up the Timer Class
Logs  	:: obj( )->load( );	// Sets up the Timer Class

set_error_handler( array( Logs::obj( ), 'onError' ) );
register_shutdown_function( array( Logs::obj( ), 'onFatal' ) );

Logs::obj( )->addLog( '*************************************' );
Logs::obj( )->addLog( 'Framework initializing' );
Logs::obj( )->addLog( '*************************************' );

Servers :: obj( )->load( ); // Load in the pre-created Servers
Bots 	:: obj( )->load( ); // Loads all the bots


while( 1 )
{

	Timers :: obj( ) -> tick( );
	
	Bots :: obj( ) -> check( );
	
	usleep( 50000 );
}


?>

DeBot Framework