forked from super3/IRC-Bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wild_bot.php
50 lines (43 loc) · 1.62 KB
/
wild_bot.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
/**
* IRC Bot
*
* LICENSE: This source file is subject to Creative Commons Attribution
* 3.0 License that is available through the world-wide-web at the following URI:
* http://creativecommons.org/licenses/by/3.0/. Basically you are free to adapt
* and use this script commercially/non-commercially. My only requirement is that
* you keep this header as an attribution to my work. Enjoy!
*
* @license http://creativecommons.org/licenses/by/3.0/
*
* @package IRCBot
* @author Super3 <[email protected]>
*/
// Configure PHP
set_time_limit( 0 );
ini_set( 'display_errors', 'on' );
// Make autoload working
require 'Classes/Autoloader.php';
spl_autoload_register( 'Autoloader::load' );
// Create the bot.
$bot = new Library\IRC\Bot();
// Configure the bot.
$bot->setServer( 'irc.freenode.org' );
$bot->setPort( 6667 );
$bot->setChannel( array('#wildphp') );
$bot->setName( 'wildbotz' );
$bot->setNick( 'wildbotz' );
$bot->setMaxReconnects( 1 );
$bot->setLogFile( 'C:\\Users\\Super3\\Code\\IRC-Bot\\log\\test-' );
// Add commands to the bot.
$bot->addCommand( new Command\Say );
$bot->addCommand( new Command\Poke );
$bot->addCommand( new Command\Join );
$bot->addCommand( new Command\Part );
$bot->addCommand( new Command\Timeout );
$bot->addCommand( new Command\Quit );
$bot->addCommand( new Command\Restart );
// Connect to the server.
$bot->connectToServer();
// Nothing more possible, the bot runs until script ends.
?>