5 protected $current_msg_info = false;
8 function __construct() {
9 $this->ircmain
= main
::GetInstance();
12 function parse_get($msg) {
14 if (preg_match("`^ERROR :(Closing Link: )?(.*)\r?$`i", $this->msg
))
16 @fclose
($this->ircmain
->C
);
18 throw new Exception('Closing Link.',1);
21 elseif (preg_match("`^PING :(.*)\r?\n`", $this->msg
, $T))
23 $this->ircmain
->put('PONG '.$T[1]);
24 echo "PING :{$T[1]}\nPONG {$T[1]}\n\n";
26 // Bot kicked, thanks kicker !
27 elseif (preg_match('`^:(.*?)!.*?@.*? KICK '.main
::$channel.' '.preg_quote(main
::$myBotName, '`').' :`', $this->msg
, $T))
30 $this->ircmain
->joinChannel(main
::$channel);
31 $this->ircmain
->privmsg(main
::$channel,'Merci '.$T[1].' !');
34 // Illegals characters in Nickname : 432
35 // Nick already in use : 433
36 elseif (preg_match('`^:[^ ]+ (001|432|433) (.*?)\r?\n`', $this->msg
,$T))
40 $this->ircmain
->joinChannel(main
::$channel);
44 $this->ircmain
->newNick('NoNameBot'.rand(0,9).rand(0,9));
47 echo "Nick already in use\n\n";
48 $this->ircmain
->newNick(false);
50 echo "Geeeh, I do not known what this mean ...\n";
51 echo "DEBUG :>".$this->msg
;
56 if (preg_match('`^:(.*?)!.*?@.*? PRIVMSG ('.main
::$myBotName.'|'.main
::$channel.") :(.*)\r`",$msg,$T)) {
63 } elseif (preg_match('`^:(.*?)!.*?@.*? NOTICE '.main
::$myBotName." :(.*)\r`",$msg,$T)) {
67 'to' => main
::$myBotName,
74 * return last privmsg / notice
78 public function get_msg_info() {