PHP Classes

File: bot.php

Recommend this page to a friend!
  Classes of Max   maxIrcBot   bot.php   Download  
File: bot.php
Role: Example script
Content type: text/plain
Description: Example
Class: maxIrcBot
Create a robot to access IRC channels
Author: By
Last change:
Date: 17 years ago
Size: 1,116 bytes
 

Contents

Class file image Download

 <?php
 
 
require('class.maxIrcBot.inc');
 
 
$bot = new maxIrcBot('irc.rn.brasnet.org', 6667);
 
$bot->setNick('mazzirq'); // define o nick - it sets the nick
 
$bot->setUser('mazzirq'); // define o usuário - it sets the user
 
$bot->setPass('*******');
 
//
 
$NickServ = &$bot->plugin('NickServ'); // it loads the plugin
 
$NickServ->identify('******');
 
//
 
$bot->joinChannel('#maxIrcBot'); // entre no canal - it go in the channel
 
$bot->setMaster('kn1ght'); // indica o administrador do bot no canal - it set the master
 
$bot->replyTo('#maxIrcBot'); // local de resposta aos comandos do administrador - the bot replies to the channel
 
$bot->createCommand('QUIT', 'calma'); // cria comando e a resposta ao comando do administrador - it creates a command for reply of the bot
  //$bot->leaveChannel('#maxIrcBot', 'tchau!'); // deixa o canal
  // $op = &$bot->plugin('IamOP'); // carrega o plugin
  // $op->setTopic('Seja livre', '#php'); // executa método do plugin
 
$bot->close(); // finaliza
 
 
$nicks = $bot->getNamesByChannel('#maxIrcBot');
 
 
print_r($nicks);
 
?>