squalk-cvs Mailing List for squalk
Status: Inactive
Brought to you by:
mkavanagh
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
|
Feb
|
Mar
|
Apr
(9) |
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(12) |
Oct
|
Nov
|
Dec
|
From: Matthew K. <mka...@us...> - 2005-09-28 21:00:25
|
Update of /cvsroot/squalk/ircbot/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24782/modules Modified Files: log.php Log Message: lalalala Index: log.php =================================================================== RCS file: /cvsroot/squalk/ircbot/modules/log.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** log.php 27 Sep 2005 21:03:23 -0000 1.4 --- log.php 28 Sep 2005 21:00:11 -0000 1.5 *************** *** 1,5 **** <?php # squalk - lightweight modular irc bot written in PHP. ! # Copyright (C) 2004 Matt Kavanagh <ma...@te...> # # This program is free software; you can redistribute it and/or modify --- 1,5 ---- <?php # squalk - lightweight modular irc bot written in PHP. ! # Copyright (C) 2004-2005 Matt Kavanagh <ma...@te...> # # This program is free software; you can redistribute it and/or modify |
From: Matthew K. <mka...@us...> - 2005-09-28 21:00:19
|
Update of /cvsroot/squalk/ircbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24782 Modified Files: ircbot.php Removed Files: ircbot.cfg numerics.inc Log Message: lalalala --- numerics.inc DELETED --- Index: ircbot.php =================================================================== RCS file: /cvsroot/squalk/ircbot/ircbot.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ircbot.php 28 Sep 2005 20:38:07 -0000 1.7 --- ircbot.php 28 Sep 2005 21:00:11 -0000 1.8 *************** *** 1,5 **** <?php # squalk - lightweight modular irc bot written in PHP. ! # Copyright (C) 2004 Matt Kavanagh <ma...@te...> # # This program is free software; you can redistribute it and/or modify --- 1,5 ---- <?php # squalk - lightweight modular irc bot written in PHP. ! # Copyright (C) 2004-2005 Matt Kavanagh <ma...@te...> # # This program is free software; you can redistribute it and/or modify *************** *** 22,44 **** if(isset($_SERVER['REMOTE_HOST'])) { ! die('Will not run in web environment!'); } ! assert(debug("Not running in a web environment")); ! ! require_once(ROOT_PATH.'lib/functions.php'); ! require_once(ROOT_PATH.'lib/class_irc_commands.php'); ! require_once(ROOT_PATH.'lib/class_irc.php'); if(!extension_loaded('sockets')) { if(!@dl('sockets.so')) { ! error("Could not load sockets extension", TRUE); } - assert(debug("Loaded sockets extension")); } - $config = get_config('ircbot.cfg'); - assert(debug("Got configuration")); - $irc = new irc(); if($irc->connect($config['server'], $config['port'], $config['username'], $config['realname'])) { $irc->nick($config['nickname']); --- 22,39 ---- if(isset($_SERVER['REMOTE_HOST'])) { ! die('Will not run in web environment\n'); } ! ! require_once(ROOT_PATH.'/lib/irc.class.php'); ! require_once(ROOT_PATH.'/config.inc.php'); if(!extension_loaded('sockets')) { if(!@dl('sockets.so')) { ! die("Could not load sockets extension\n"; } } $irc = new irc(); + if($irc->connect($config['server'], $config['port'], $config['username'], $config['realname'])) { $irc->nick($config['nickname']); --- ircbot.cfg DELETED --- |
From: Matthew K. <mka...@us...> - 2005-09-28 21:00:19
|
Update of /cvsroot/squalk/ircbot/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24782/lib Added Files: irc.class.php Removed Files: class_irc.php class_irc_commands.php Log Message: lalalala --- NEW FILE: irc.class.php --- <?php # squalk - lightweight modular irc bot written in PHP. # Copyright (C) 2004-2005 Matt Kavanagh <ma...@te...> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # $Id: irc.class.php,v 1.1 2005/09/28 21:00:11 mkavanagh Exp $ class irc { public function notice($target, $message) { return $this->raw('NOTICE '.$target.' :'.$message); } public function privmsg($target, $message) { return $this->raw('PRIVMSG '.$target.' :'.$message); } public function join($channel, $key = '') { if($key != '') { $key = ' '.$key; } return $this->raw('JOIN '.$channel.$key); } public function nick($nick) { return $this->raw('NICK '.$nick); } public function part($channel, $message = '') { if($message != '') { $message = ' '.$message; } return $this->raw('PART '.$channel.$message); } protected $socket; protected $nickname; protected $username; protected $realname; protected $server; protected $port; protected $channels = array(); protected $users = array(); protected $handlers = array( 'recieve' => array( 'raw' => array(), 'command' => array() ), 'send' => array( 'pre' => array( 'raw' => array(), 'command' => array() ), 'post' => array( 'raw' => array(), 'command' => array() ) ) ); public function connect($server, $port, $username, $realname) { $this->socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); if(socket_connect($this->socket, $server, $port)) { $this->server = $server; if($this->raw('USER '.$username.' * * :'.$realname)) { $this->username = $username; $this->realname = $realname; } else { return false; } $this->nickname = 'user'.rand(1000, 9999); $this->nick($this->nickname); return true; } else { return false; } } public function raw($command) { $command = substr($this->send_preprocess($command), 0, 510)."\r\n"; $totallength = strlen($command); $totalwritten = 0; do { $length = strlen($command); if(($written = socket_write($this->socket, $command, $length)) === false) { return false; } $command = substr($command, $written - 1); $totalwritten = $totalwritten + $written; } while($totalwritten != $totallength); $this->send_postprocess($command); return true; } public function register_recieve_raw_handler($handler) { var_dump($handler); $this->handlers['recieve']['raw'][] = $handler; } public function register_recieve_command_handler($command, $handler) { $this->handlers['recieve']['command'][$command][] = $handler; } protected function recieve_process($data) { $return = true; foreach($this->handlers['recieve']['raw'] as $handler) { if(function_exists($handler)) { if(!($handler($this, $data))) { $return = false; } } else { $return = false; } } $command = explode(' ', $data); if(isset($command[1])) { $command = $command[1]; } else { var_export($data); } if($command == "NICK") { $nick1 = explode('!', $data); $nick1 = substr($nick1[0], 1); $nick2 = explode(' ', $data); $nick2 = substr($nick2[2], 1); if($this->nickname == $nick1) { $this->nickname = $nick2; } } if(isset($this->handlers['recieve']['command'][$command])) { foreach($this->handlers['recieve']['command'][$command] as $handler) { if(function_exists($handler)) { if(!($handler($this, $data))) { $return = false; } } else { $return = false; } } } return $return; } public function recieve() { $data = "\r"; while($data == "\r" || $data == "\n") { $data = socket_read($this->socket, 512, PHP_NORMAL_READ); } $this->recieve_process($data); return $data; } public function register_pre_send_raw_handler($handler) { $this->handlers['send']['pre']['raw'][] = $handler; } public function register_pre_send_command_handler($command, $handler) { $this->handlers['send']['pre']['raw'][$command] = $handler; } public function register_send_raw_handler($handler) { $this->handlers['send']['post']['raw'][] = $handler; } public function register_send_command_handler($command, $handler) { $this->handlers['send']['post']['raw'][$command] = $handler; } protected function send_postprocess($data) { $return = true; foreach($this->handlers['send']['post']['raw'] as $handler) { if(function_exists($handler)) { if(!($handler($this, $data))) { $return = false; } } else { $return = false; } } $command = explode(' ', $data); $command = $command[1]; if(is_array($this->handlers['send']['post']['command'][$command])) { foreach($this->handlers['send']['post']['command'][$command] as $handler) { if(function_exists($handler)) { if(!($handler($this, $data))) { $return = false; } } else { $return = false; } } } return $return; } protected function send_preprocess($data) { foreach($this->handlers['send']['pre']['raw'] as $handler) { if(function_exists($handler)) { $processed = $handler($this, $data); if($processed !== false) { $data = $processed; } } } $command = explode(' ', $data); $command = $command[1]; if(is_array($this->handlers['send']['pre'][$command])) { foreach($this->handlers['send']['pre'][$command] as $handler) { if(function_exists($handler)) { $processed = $handler($this, $data); if($processed !== false) { $data = $processed; } } } } return $data; } } --- class_irc_commands.php DELETED --- --- class_irc.php DELETED --- |
From: Matthew K. <mka...@us...> - 2005-09-28 20:38:17
|
Update of /cvsroot/squalk/ircbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19297 Modified Files: ircbot.cfg ircbot.php numerics.inc Log Message: more crap stuff gone Index: numerics.inc =================================================================== RCS file: /cvsroot/squalk/ircbot/numerics.inc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** numerics.inc 15 Apr 2004 16:52:03 -0000 1.2 --- numerics.inc 28 Sep 2005 20:38:07 -0000 1.3 *************** *** 156,159 **** 501 => 'ERR_UMODEUNKNOWNFLAG', 502 => 'ERR_USERSDONTMATCH' ! ); ! ?> \ No newline at end of file --- 156,158 ---- 501 => 'ERR_UMODEUNKNOWNFLAG', 502 => 'ERR_USERSDONTMATCH' ! ); \ No newline at end of file Index: ircbot.php =================================================================== RCS file: /cvsroot/squalk/ircbot/ircbot.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ircbot.php 27 Sep 2005 21:03:23 -0000 1.6 --- ircbot.php 28 Sep 2005 20:38:07 -0000 1.7 *************** *** 21,24 **** --- 21,29 ---- define('ROOT_PATH', realpath(dirname(__FILE__))); + if(isset($_SERVER['REMOTE_HOST'])) { + die('Will not run in web environment!'); + } + assert(debug("Not running in a web environment")); + require_once(ROOT_PATH.'lib/functions.php'); require_once(ROOT_PATH.'lib/class_irc_commands.php'); *************** *** 27,46 **** if(!extension_loaded('sockets')) { if(!@dl('sockets.so')) { ! panic('You know, we do need INTERNETS for this. Hurr.'); ! } ! else { ! echo "Loaded sockets extension\n"; } ! } ! ! if(isset($_SERVER['REMOTE_HOST'])) { ! panic('Will not run in web environment!'); ! } ! else { ! echo "Not running in a web environment, good\n"; } $config = get_config('ircbot.cfg'); ! echo "Got configuration\n"; $irc = new irc(); --- 32,42 ---- if(!extension_loaded('sockets')) { if(!@dl('sockets.so')) { ! error("Could not load sockets extension", TRUE); } ! assert(debug("Loaded sockets extension")); } $config = get_config('ircbot.cfg'); ! assert(debug("Got configuration")); $irc = new irc(); Index: ircbot.cfg =================================================================== RCS file: /cvsroot/squalk/ircbot/ircbot.cfg,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ircbot.cfg 27 Sep 2005 19:29:36 -0000 1.4 --- ircbot.cfg 28 Sep 2005 20:38:07 -0000 1.5 *************** *** 12,14 **** channels = "|#ptibot" [module_section] ! modules = "|modules/log.php|modules/misc.php|modules/lesbian.php|modules/attack.php|modules/sleep.php" --- 12,14 ---- channels = "|#ptibot" [module_section] ! modules = "|modules/log.php" |
From: Matthew K. <mka...@us...> - 2005-09-28 20:38:17
|
Update of /cvsroot/squalk/ircbot/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19297/lib Modified Files: class_irc.php class_irc_commands.php Removed Files: functions.php Log Message: more crap stuff gone --- functions.php DELETED --- Index: class_irc_commands.php =================================================================== RCS file: /cvsroot/squalk/ircbot/lib/class_irc_commands.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** class_irc_commands.php 15 Apr 2004 16:52:03 -0000 1.2 --- class_irc_commands.php 28 Sep 2005 20:38:07 -0000 1.3 *************** *** 44,47 **** return $this->raw('PART '.$channel.$message); } ! } ! ?> \ No newline at end of file --- 44,46 ---- return $this->raw('PART '.$channel.$message); } ! } \ No newline at end of file Index: class_irc.php =================================================================== RCS file: /cvsroot/squalk/ircbot/lib/class_irc.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** class_irc.php 27 Sep 2005 19:29:36 -0000 1.4 --- class_irc.php 28 Sep 2005 20:38:07 -0000 1.5 *************** *** 248,251 **** return true; } ! } ! ?> \ No newline at end of file --- 248,250 ---- return true; } ! } \ No newline at end of file |
From: Matthew K. <mka...@us...> - 2005-09-27 21:03:34
|
Update of /cvsroot/squalk/ircbot/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21068/lib Modified Files: functions.php Log Message: What the hell did I have this for anyway? Great job, genius, include a file for ONE CONSTANT Index: functions.php =================================================================== RCS file: /cvsroot/squalk/ircbot/lib/functions.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** functions.php 1 May 2004 14:06:51 -0000 1.3 --- functions.php 27 Sep 2005 21:03:23 -0000 1.4 *************** *** 18,27 **** # # $Id$ - function panic($message, $dump_globals = true) { - if($dump_globals) { - var_dump($GLOBALS); - } - die("******\nPANIC: ".$message."\n******"); - } function get_config($files) { --- 18,21 ---- *************** *** 51,99 **** } } ! } ! ! function parse_command($data) { ! $data = explode(' ', str_replace("\r", '', str_replace("\n", '', $data))); ! ! $command = array(); ! ! $data[0] = str_replace(':', '', $data[0]); ! ! if(strrpos($data[0], '!') === FALSE) { ! $command['type'] = 'server'; ! $command['nick'] = NULL; ! $command['user'] = NULL; ! $command['host'] = $data[0]; ! } ! else { ! $command['type'] = 'user'; ! $data[0] = explode('!', $data[0]); ! $command['nick'] = $data[0][0]; ! $data[0][1] = explode('@', $data[0][1]); ! $command['user'] = $data[0][1][0]; ! $command['host'] = $data[0][1][1]; ! } ! ! unset($data[0]); ! ! $command['command'] = $data[1]; ! ! unset($data[1]); ! ! $command['params'] = array(); ! ! foreach($data as $index => $datum) { ! if($datum{0} === ':') { ! break; ! } ! else { ! $command['params'][] = $datum; ! unset($data[$index]); ! } ! } ! ! $command['params'][] = substr(implode(' ', $data), 1); ! ! return $command; ! } ! ?> \ No newline at end of file --- 45,47 ---- } } ! } \ No newline at end of file |
From: Matthew K. <mka...@us...> - 2005-09-27 21:03:31
|
Update of /cvsroot/squalk/ircbot/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21068/modules Modified Files: log.php Log Message: What the hell did I have this for anyway? Great job, genius, include a file for ONE CONSTANT Index: log.php =================================================================== RCS file: /cvsroot/squalk/ircbot/modules/log.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** log.php 27 Sep 2005 19:29:36 -0000 1.3 --- log.php 27 Sep 2005 21:03:23 -0000 1.4 *************** *** 21,24 **** echo str_replace(array("\r", "\n"), '', $data)."\n"; } ! $irc->register_recieve_raw_handler('raw_log'); ! ?> \ No newline at end of file --- 21,23 ---- echo str_replace(array("\r", "\n"), '', $data)."\n"; } ! $irc->register_recieve_raw_handler('raw_log'); \ No newline at end of file |
From: Matthew K. <mka...@us...> - 2005-09-27 21:03:31
|
Update of /cvsroot/squalk/ircbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21068 Modified Files: ircbot.php Removed Files: defines.inc Log Message: What the hell did I have this for anyway? Great job, genius, include a file for ONE CONSTANT Index: ircbot.php =================================================================== RCS file: /cvsroot/squalk/ircbot/ircbot.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ircbot.php 27 Sep 2005 19:29:36 -0000 1.5 --- ircbot.php 27 Sep 2005 21:03:23 -0000 1.6 *************** *** 19,26 **** # $Id$ ! require_once('defines.inc'); ! require_once(LIB_PATH . 'functions.php'); ! require_once(LIB_PATH . 'class_irc_commands.php'); ! require_once(LIB_PATH . 'class_irc.php'); if(!extension_loaded('sockets')) { --- 19,27 ---- # $Id$ ! define('ROOT_PATH', realpath(dirname(__FILE__))); ! ! require_once(ROOT_PATH.'lib/functions.php'); ! require_once(ROOT_PATH.'lib/class_irc_commands.php'); ! require_once(ROOT_PATH.'lib/class_irc.php'); if(!extension_loaded('sockets')) { *************** *** 60,63 **** usleep(100); } ! } ! ?> --- 61,63 ---- usleep(100); } ! } \ No newline at end of file --- defines.inc DELETED --- |
From: Matthew K. <mka...@us...> - 2005-09-27 19:32:06
|
Update of /cvsroot/squalk/ircbot/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32030/doc Removed Files: AUTHORS COPYING ChangeLog INSTALL README TODO Log Message: lolled --- INSTALL DELETED --- --- ChangeLog DELETED --- --- COPYING DELETED --- --- AUTHORS DELETED --- --- README DELETED --- --- TODO DELETED --- |
From: Matthew K. <mka...@us...> - 2005-09-27 19:29:50
|
Update of /cvsroot/squalk/ircbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31073 Modified Files: ircbot.cfg ircbot.php Log Message: hurrrrrrrrrrr Index: ircbot.php =================================================================== RCS file: /cvsroot/squalk/ircbot/ircbot.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ircbot.php 1 May 2004 14:06:51 -0000 1.4 --- ircbot.php 27 Sep 2005 19:29:36 -0000 1.5 *************** *** 24,32 **** --- 24,45 ---- require_once(LIB_PATH . 'class_irc.php'); + if(!extension_loaded('sockets')) { + if(!@dl('sockets.so')) { + panic('You know, we do need INTERNETS for this. Hurr.'); + } + else { + echo "Loaded sockets extension\n"; + } + } + if(isset($_SERVER['REMOTE_HOST'])) { panic('Will not run in web environment!'); } + else { + echo "Not running in a web environment, good\n"; + } $config = get_config('ircbot.cfg'); + echo "Got configuration\n"; $irc = new irc(); *************** *** 36,43 **** --- 49,58 ---- foreach($config['modules'] as $module) { include_once($module); + echo "Included module \"$module\"\n"; } foreach($config['channels'] as $channel) { $irc->join($channel); + echo "Joined channel \"$channel\"\n"; } *************** *** 46,48 **** } } ! ?> \ No newline at end of file --- 61,63 ---- } } ! ?> Index: ircbot.cfg =================================================================== RCS file: /cvsroot/squalk/ircbot/ircbot.cfg,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ircbot.cfg 1 May 2004 14:06:51 -0000 1.3 --- ircbot.cfg 27 Sep 2005 19:29:36 -0000 1.4 *************** *** 7,14 **** nickname = "ptibot" [server_section] ! server = "irc.freenode.net" port = 6667 [channel_section] ! channels = "|#ptibot|#phpbbchat|" [module_section] ! modules = "|modules/log.php|modules/misc.php|modules/lesbian.php|modules/attack.php|" \ No newline at end of file --- 7,14 ---- nickname = "ptibot" [server_section] ! server = "irc.brutix.com" port = 6667 [channel_section] ! channels = "|#ptibot" [module_section] ! modules = "|modules/log.php|modules/misc.php|modules/lesbian.php|modules/attack.php|modules/sleep.php" |
From: Matthew K. <mka...@us...> - 2005-09-27 19:29:49
|
Update of /cvsroot/squalk/ircbot/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31073/modules Modified Files: log.php Removed Files: attack.php lesbian.php misc.php Log Message: hurrrrrrrrrrr --- lesbian.php DELETED --- --- misc.php DELETED --- Index: log.php =================================================================== RCS file: /cvsroot/squalk/ircbot/modules/log.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** log.php 15 Apr 2004 16:52:03 -0000 1.2 --- log.php 27 Sep 2005 19:29:36 -0000 1.3 *************** *** 18,23 **** # # $Id$ ! function raw_log(&$irc, $data) { ! echo str_replace("\r", '', $data); } $irc->register_recieve_raw_handler('raw_log'); --- 18,23 ---- # # $Id$ ! function raw_log($irc, $data) { ! echo str_replace(array("\r", "\n"), '', $data)."\n"; } $irc->register_recieve_raw_handler('raw_log'); --- attack.php DELETED --- |
From: Matthew K. <mka...@us...> - 2005-09-27 19:29:44
|
Update of /cvsroot/squalk/ircbot/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31073/lib Modified Files: class_irc.php Log Message: hurrrrrrrrrrr Index: class_irc.php =================================================================== RCS file: /cvsroot/squalk/ircbot/lib/class_irc.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** class_irc.php 1 May 2004 14:06:51 -0000 1.3 --- class_irc.php 27 Sep 2005 19:29:36 -0000 1.4 *************** *** 98,101 **** --- 98,102 ---- // include the \r\n at the end. public function register_recieve_raw_handler($handler) { + var_dump($handler); $this->handlers['recieve']['raw'][] = $handler; } *************** *** 105,111 **** // the nasty \r\n at the end. public function register_recieve_command_handler($command, $handler) { - if(!isset($this->handlers['recieve']['raw'][$command])) { - $this->handlers['recieve']['raw'][$command] = array(); - } $this->handlers['recieve']['command'][$command][] = $handler; } --- 106,109 ---- *************** *** 124,128 **** } $command = explode(' ', $data); ! $command = $command[1]; if($command == "NICK") { --- 122,131 ---- } $command = explode(' ', $data); ! if(isset($command[1])) { ! $command = $command[1]; ! } ! else { ! var_export($data); ! } if($command == "NICK") { *************** *** 136,140 **** } ! if(is_array($this->handlers['recieve']['command'][$command])) { foreach($this->handlers['recieve']['command'][$command] as $handler) { if(function_exists($handler)) { --- 139,143 ---- } ! if(isset($this->handlers['recieve']['command'][$command])) { foreach($this->handlers['recieve']['command'][$command] as $handler) { if(function_exists($handler)) { *************** *** 152,156 **** public function recieve() { ! $data = socket_read($this->socket, 512, PHP_NORMAL_READ); $this->recieve_process($data); return $data; --- 155,163 ---- public function recieve() { ! $data = "\r"; ! while($data == "\r" || $data == "\n") { ! $data = socket_read($this->socket, 512, PHP_NORMAL_READ); ! } ! $this->recieve_process($data); return $data; |
From: Matthew K. <mka...@us...> - 2004-05-01 14:07:01
|
Update of /cvsroot/squalk/ircbot/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14133/lib Modified Files: class_irc.php functions.php Log Message: functionality..of a sort ;) Index: functions.php =================================================================== RCS file: /cvsroot/squalk/ircbot/lib/functions.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** functions.php 15 Apr 2004 16:52:03 -0000 1.2 --- functions.php 1 May 2004 14:06:51 -0000 1.3 *************** *** 52,54 **** --- 52,99 ---- } } + + function parse_command($data) { + $data = explode(' ', str_replace("\r", '', str_replace("\n", '', $data))); + + $command = array(); + + $data[0] = str_replace(':', '', $data[0]); + + if(strrpos($data[0], '!') === FALSE) { + $command['type'] = 'server'; + $command['nick'] = NULL; + $command['user'] = NULL; + $command['host'] = $data[0]; + } + else { + $command['type'] = 'user'; + $data[0] = explode('!', $data[0]); + $command['nick'] = $data[0][0]; + $data[0][1] = explode('@', $data[0][1]); + $command['user'] = $data[0][1][0]; + $command['host'] = $data[0][1][1]; + } + + unset($data[0]); + + $command['command'] = $data[1]; + + unset($data[1]); + + $command['params'] = array(); + + foreach($data as $index => $datum) { + if($datum{0} === ':') { + break; + } + else { + $command['params'][] = $datum; + unset($data[$index]); + } + } + + $command['params'][] = substr(implode(' ', $data), 1); + + return $command; + } ?> \ No newline at end of file Index: class_irc.php =================================================================== RCS file: /cvsroot/squalk/ircbot/lib/class_irc.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** class_irc.php 15 Apr 2004 16:52:03 -0000 1.2 --- class_irc.php 1 May 2004 14:06:51 -0000 1.3 *************** *** 19,30 **** --- 19,52 ---- # $Id$ class irc extends irc_commands { + // Holds the socket resource for our connection. protected $socket; + + // Holds our current nickname. protected $nickname; + + // Holds our current username; cannot be changed + // while connected. protected $username; + + // Holds our current realname; cannot be changed + // while connected. protected $realname; + + // Holds the address of the server we connected + // to. protected $server; + + // Holds the number of the port we connected to + // on the server. protected $port; + + // An array of channels we are aware of. protected $channels = array(); + + // An array of users we are aware of. + protected $users = array(); + // Big nasty array of recieve and send handler + // functions. protected $handlers = array( 'recieve' => array( *************** *** 44,47 **** --- 66,73 ---- ); + // Attempts to connect to the server at $server:$port + // using a randomly generated nickname between user1000 + // and user9999, with $username and $realname as the + // username and realname respectively. public function connect($server, $port, $username, $realname) { $this->socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); *************** *** 66,75 **** } public function register_recieve_raw_handler($handler) { $this->handlers['recieve']['raw'][] = $handler; } public function register_recieve_command_handler($command, $handler) { ! $this->handlers['recieve']['raw'][$command] = $handler; } --- 92,112 ---- } + // Registers a handler function for recieved data; + // note that this will return everything, not just + // stuff for a specific command; if you want that, + // use register_recieve_command_handler. Both will + // include the \r\n at the end. public function register_recieve_raw_handler($handler) { $this->handlers['recieve']['raw'][] = $handler; } + // Registers a handler function for a specific + // recieved command; note that this will include + // the nasty \r\n at the end. public function register_recieve_command_handler($command, $handler) { ! if(!isset($this->handlers['recieve']['raw'][$command])) { ! $this->handlers['recieve']['raw'][$command] = array(); ! } ! $this->handlers['recieve']['command'][$command][] = $handler; } *************** *** 88,91 **** --- 125,139 ---- $command = explode(' ', $data); $command = $command[1]; + + if($command == "NICK") { + $nick1 = explode('!', $data); + $nick1 = substr($nick1[0], 1); + $nick2 = explode(' ', $data); + $nick2 = substr($nick2[2], 1); + if($this->nickname == $nick1) { + $this->nickname = $nick2; + } + } + if(is_array($this->handlers['recieve']['command'][$command])) { foreach($this->handlers['recieve']['command'][$command] as $handler) { *************** *** 187,191 **** return false; } ! $command = substr($command, $written - 1, $length - $written); $totalwritten = $totalwritten + $written; } while($totalwritten != $totallength); --- 235,239 ---- return false; } ! $command = substr($command, $written - 1); $totalwritten = $totalwritten + $written; } while($totalwritten != $totallength); |
From: Matthew K. <mka...@us...> - 2004-05-01 14:07:01
|
Update of /cvsroot/squalk/ircbot/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14133/modules Added Files: attack.php lesbian.php misc.php Log Message: functionality..of a sort ;) --- NEW FILE: misc.php --- <?php # squalk - lightweight modular irc bot written in PHP. # Copyright (C) 2004 Matt Kavanagh <ma...@te...> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # $Id: misc.php,v 1.1 2004/05/01 14:06:52 mkavanagh Exp $ function banghandlers(&$irc, $data) { global $banghandlers; $data = parse_command($data); $lastparam = count($data['params']) - 1; $bangdata = array(); $data['params'][$lastparam] = explode(' ', $data['params'][$lastparam]); $bangdata['command'] = $data['params'][$lastparam][0]; if($bangdata['command']{0} !== '!') { return true; } $bangdata['command'] = substr($data['params'][$lastparam][0], 1); unset($data['params'][$lastparam][0]); $bangdata['params'] = $data['params'][$lastparam]; sort($bangdata['params']); if(isset($banghandlers[$bangdata['command']])) { $bangdata['nick'] = $data['nick']; $bangdata['user'] = $data['user']; $bangdata['host'] = $data['host']; if($data['params'][0]{0} === '#') { $bangdata['replyto'] = $data['params'][0]; } else { $bangdata['replyto'] = &$bangdata['nick']; } return $banghandlers[$bangdata['command']]($irc, $bangdata); } } $irc->register_recieve_command_handler('PRIVMSG', 'banghandlers'); ?> --- NEW FILE: lesbian.php --- <?php # squalk - lightweight modular irc bot written in PHP. # Copyright (C) 2004 Matt Kavanagh <ma...@te...> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # $Id: lesbian.php,v 1.1 2004/05/01 14:06:52 mkavanagh Exp $ function lesbian(&$irc, $data) { $irc->privmsg($data['replyto'], 'uNF uNF'); } if(!isset($banghandlers)) { $banghandlers = array(); } $banghandlers['lesbian'] = 'lesbian'; ?> --- NEW FILE: attack.php --- <?php # squalk - lightweight modular irc bot written in PHP. # Copyright (C) 2004 Matt Kavanagh <ma...@te...> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # $Id: attack.php,v 1.1 2004/05/01 14:06:52 mkavanagh Exp $ function attack(&$irc, $data) { if(!isset($data['params'][0])) { $attackee = $data['nick']; } else { $attackee = $data['params'][0]; } $irc->privmsg($data['replyto'], "\001".'ACTION staples '.$attackee.' to the wall and throws balloons full of bull-sperm at them'."\001"); } if(!isset($banghandlers)) { $banghandlers = array(); } $banghandlers['attack'] = 'attack'; ?> |
From: Matthew K. <mka...@us...> - 2004-05-01 14:07:00
|
Update of /cvsroot/squalk/ircbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14133 Modified Files: ircbot.cfg ircbot.php Log Message: functionality..of a sort ;) Index: ircbot.php =================================================================== RCS file: /cvsroot/squalk/ircbot/ircbot.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ircbot.php 15 Apr 2004 16:52:03 -0000 1.3 --- ircbot.php 1 May 2004 14:06:51 -0000 1.4 *************** *** 24,46 **** require_once(LIB_PATH . 'class_irc.php'); ! if(isset($_SERVER)) { panic('Will not run in web environment!'); } $config = get_config('ircbot.cfg'); - foreach($config as $setting => $value) { - $$setting = $value; - echo $setting.' = '.$value."\n"; - } $irc = new irc(); ! if($irc->connect($server, $port, $username, $realname)) { ! $irc->nick($nickname); ! foreach($modules as $module) { include_once($module); } ! foreach($channels as $channel) { $irc->join($channel); } --- 24,42 ---- require_once(LIB_PATH . 'class_irc.php'); ! if(isset($_SERVER['REMOTE_HOST'])) { panic('Will not run in web environment!'); } $config = get_config('ircbot.cfg'); $irc = new irc(); ! if($irc->connect($config['server'], $config['port'], $config['username'], $config['realname'])) { ! $irc->nick($config['nickname']); ! foreach($config['modules'] as $module) { include_once($module); } ! foreach($config['channels'] as $channel) { $irc->join($channel); } Index: ircbot.cfg =================================================================== RCS file: /cvsroot/squalk/ircbot/ircbot.cfg,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ircbot.cfg 9 Apr 2004 01:13:43 -0000 1.2 --- ircbot.cfg 1 May 2004 14:06:51 -0000 1.3 *************** *** 1,12 **** ;// $Id$ [user_section] ! username = "bot" ! realname = "bot" ! nickname = "bot" [server_section] ! server = "irc.example.net" port = 6667 [channel_section] ! channels = "|#example|" [module_section] ! modules = "|modules/log.php|" --- 1,14 ---- ;// $Id$ + ;change this for yourself..I can't be bothered to set sensible + ;defaults ;) [user_section] ! username = "ptibot" ! realname = "ptibot" ! nickname = "ptibot" [server_section] ! server = "irc.freenode.net" port = 6667 [channel_section] ! channels = "|#ptibot|#phpbbchat|" [module_section] ! modules = "|modules/log.php|modules/misc.php|modules/lesbian.php|modules/attack.php|" \ No newline at end of file |
From: Matthew K. <mka...@us...> - 2004-04-15 16:52:13
|
Update of /cvsroot/squalk/ircbot/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28413/modules Modified Files: log.php Log Message: adding file headers. Index: log.php =================================================================== RCS file: /cvsroot/squalk/ircbot/modules/log.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** log.php 9 Apr 2004 01:10:48 -0000 1.1.1.1 --- log.php 15 Apr 2004 16:52:03 -0000 1.2 *************** *** 1,4 **** <?php ! // $Id$ function raw_log(&$irc, $data) { echo str_replace("\r", '', $data); --- 1,21 ---- <?php ! # squalk - lightweight modular irc bot written in PHP. ! # Copyright (C) 2004 Matt Kavanagh <ma...@te...> ! # ! # This program is free software; you can redistribute it and/or modify ! # it under the terms of the GNU General Public License as published by ! # the Free Software Foundation; either version 2 of the License, or ! # (at your option) any later version. ! # ! # This program is distributed in the hope that it will be useful, ! # but WITHOUT ANY WARRANTY; without even the implied warranty of ! # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! # GNU General Public License for more details. ! # ! # You should have received a copy of the GNU General Public License ! # along with this program; if not, write to the Free Software ! # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! # ! # $Id$ function raw_log(&$irc, $data) { echo str_replace("\r", '', $data); |
From: Matthew K. <mka...@us...> - 2004-04-15 16:52:12
|
Update of /cvsroot/squalk/ircbot/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28413/lib Modified Files: class_irc.php class_irc_commands.php functions.php Log Message: adding file headers. Index: functions.php =================================================================== RCS file: /cvsroot/squalk/ircbot/lib/functions.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** functions.php 9 Apr 2004 01:10:48 -0000 1.1.1.1 --- functions.php 15 Apr 2004 16:52:03 -0000 1.2 *************** *** 1,4 **** <?php ! // $Id$ function panic($message, $dump_globals = true) { if($dump_globals) { --- 1,21 ---- <?php ! # squalk - lightweight modular irc bot written in PHP. ! # Copyright (C) 2004 Matt Kavanagh <ma...@te...> ! # ! # This program is free software; you can redistribute it and/or modify ! # it under the terms of the GNU General Public License as published by ! # the Free Software Foundation; either version 2 of the License, or ! # (at your option) any later version. ! # ! # This program is distributed in the hope that it will be useful, ! # but WITHOUT ANY WARRANTY; without even the implied warranty of ! # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! # GNU General Public License for more details. ! # ! # You should have received a copy of the GNU General Public License ! # along with this program; if not, write to the Free Software ! # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! # ! # $Id$ function panic($message, $dump_globals = true) { if($dump_globals) { Index: class_irc_commands.php =================================================================== RCS file: /cvsroot/squalk/ircbot/lib/class_irc_commands.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** class_irc_commands.php 9 Apr 2004 01:10:48 -0000 1.1.1.1 --- class_irc_commands.php 15 Apr 2004 16:52:03 -0000 1.2 *************** *** 1,4 **** <?php ! // $Id$ class irc_commands { public function notice($target, $message) { --- 1,21 ---- <?php ! # squalk - lightweight modular irc bot written in PHP. ! # Copyright (C) 2004 Matt Kavanagh <ma...@te...> ! # ! # This program is free software; you can redistribute it and/or modify ! # it under the terms of the GNU General Public License as published by ! # the Free Software Foundation; either version 2 of the License, or ! # (at your option) any later version. ! # ! # This program is distributed in the hope that it will be useful, ! # but WITHOUT ANY WARRANTY; without even the implied warranty of ! # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! # GNU General Public License for more details. ! # ! # You should have received a copy of the GNU General Public License ! # along with this program; if not, write to the Free Software ! # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! # ! # $Id$ class irc_commands { public function notice($target, $message) { Index: class_irc.php =================================================================== RCS file: /cvsroot/squalk/ircbot/lib/class_irc.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** class_irc.php 9 Apr 2004 01:10:48 -0000 1.1.1.1 --- class_irc.php 15 Apr 2004 16:52:03 -0000 1.2 *************** *** 1,4 **** <?php ! // $Id$ class irc extends irc_commands { protected $socket; --- 1,21 ---- <?php ! # squalk - lightweight modular irc bot written in PHP. ! # Copyright (C) 2004 Matt Kavanagh <ma...@te...> ! # ! # This program is free software; you can redistribute it and/or modify ! # it under the terms of the GNU General Public License as published by ! # the Free Software Foundation; either version 2 of the License, or ! # (at your option) any later version. ! # ! # This program is distributed in the hope that it will be useful, ! # but WITHOUT ANY WARRANTY; without even the implied warranty of ! # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! # GNU General Public License for more details. ! # ! # You should have received a copy of the GNU General Public License ! # along with this program; if not, write to the Free Software ! # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! # ! # $Id$ class irc extends irc_commands { protected $socket; |
From: Matthew K. <mka...@us...> - 2004-04-15 16:52:12
|
Update of /cvsroot/squalk/ircbot/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28413/doc Modified Files: AUTHORS Log Message: adding file headers. Index: AUTHORS =================================================================== RCS file: /cvsroot/squalk/ircbot/doc/AUTHORS,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AUTHORS 15 Apr 2004 16:08:50 -0000 1.1 --- AUTHORS 15 Apr 2004 16:52:03 -0000 1.2 *************** *** 0 **** --- 1 ---- + Matt Kavanagh <ma...@te...> \ No newline at end of file |
From: Matthew K. <mka...@us...> - 2004-04-15 16:52:12
|
Update of /cvsroot/squalk/ircbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28413 Modified Files: defines.inc ircbot.php numerics.inc Log Message: adding file headers. Index: numerics.inc =================================================================== RCS file: /cvsroot/squalk/ircbot/numerics.inc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** numerics.inc 9 Apr 2004 01:10:48 -0000 1.1.1.1 --- numerics.inc 15 Apr 2004 16:52:03 -0000 1.2 *************** *** 1,4 **** <?php ! // $Id$ $numerics = array( 001 => 'RPL_WELCOME', --- 1,21 ---- <?php ! # squalk - lightweight modular irc bot written in PHP. ! # Copyright (C) 2004 Matt Kavanagh <ma...@te...> ! # ! # This program is free software; you can redistribute it and/or modify ! # it under the terms of the GNU General Public License as published by ! # the Free Software Foundation; either version 2 of the License, or ! # (at your option) any later version. ! # ! # This program is distributed in the hope that it will be useful, ! # but WITHOUT ANY WARRANTY; without even the implied warranty of ! # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! # GNU General Public License for more details. ! # ! # You should have received a copy of the GNU General Public License ! # along with this program; if not, write to the Free Software ! # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! # ! # $Id$ $numerics = array( 001 => 'RPL_WELCOME', Index: ircbot.php =================================================================== RCS file: /cvsroot/squalk/ircbot/ircbot.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ircbot.php 9 Apr 2004 20:06:49 -0000 1.2 --- ircbot.php 15 Apr 2004 16:52:03 -0000 1.3 *************** *** 1,4 **** <?php ! // $Id$ require_once('defines.inc'); require_once(LIB_PATH . 'functions.php'); --- 1,22 ---- <?php ! # squalk - lightweight modular irc bot written in PHP. ! # Copyright (C) 2004 Matt Kavanagh <ma...@te...> ! # ! # This program is free software; you can redistribute it and/or modify ! # it under the terms of the GNU General Public License as published by ! # the Free Software Foundation; either version 2 of the License, or ! # (at your option) any later version. ! # ! # This program is distributed in the hope that it will be useful, ! # but WITHOUT ANY WARRANTY; without even the implied warranty of ! # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! # GNU General Public License for more details. ! # ! # You should have received a copy of the GNU General Public License ! # along with this program; if not, write to the Free Software ! # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! # ! # $Id$ ! require_once('defines.inc'); require_once(LIB_PATH . 'functions.php'); Index: defines.inc =================================================================== RCS file: /cvsroot/squalk/ircbot/defines.inc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** defines.inc 9 Apr 2004 01:10:48 -0000 1.1.1.1 --- defines.inc 15 Apr 2004 16:52:02 -0000 1.2 *************** *** 1,4 **** <?php ! // $Id$ define('LIB_PATH', './lib/'); ?> \ No newline at end of file --- 1,21 ---- <?php ! # squalk - lightweight modular irc bot written in PHP. ! # Copyright (C) 2004 Matt Kavanagh <ma...@te...> ! # ! # This program is free software; you can redistribute it and/or modify ! # it under the terms of the GNU General Public License as published by ! # the Free Software Foundation; either version 2 of the License, or ! # (at your option) any later version. ! # ! # This program is distributed in the hope that it will be useful, ! # but WITHOUT ANY WARRANTY; without even the implied warranty of ! # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! # GNU General Public License for more details. ! # ! # You should have received a copy of the GNU General Public License ! # along with this program; if not, write to the Free Software ! # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! # ! # $Id$ define('LIB_PATH', './lib/'); ?> \ No newline at end of file |
From: Matthew K. <mka...@us...> - 2004-04-15 16:37:08
|
Update of /cvsroot/squalk/ircbot/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25561 Modified Files: COPYING Log Message: GPL. Index: COPYING =================================================================== RCS file: /cvsroot/squalk/ircbot/doc/COPYING,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** COPYING 15 Apr 2004 16:08:50 -0000 1.1 --- COPYING 15 Apr 2004 16:36:59 -0000 1.2 *************** *** 0 **** --- 1,340 ---- + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your + freedom to share and change it. By contrast, the GNU General Public + License is intended to guarantee your freedom to share and change free + software--to make sure the software is free for all its users. This + General Public License applies to most of the Free Software + Foundation's software and to any other program whose authors commit to + using it. (Some other Free Software Foundation software is covered by + the GNU Library General Public License instead.) You can apply it to + your programs, too. + + When we speak of free software, we are referring to freedom, not + price. Our General Public Licenses are designed to make sure that you + have the freedom to distribute copies of free software (and charge for + this service if you wish), that you receive source code or can get it + if you want it, that you can change the software or use pieces of it + in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid + anyone to deny you these rights or to ask you to surrender the rights. + These restrictions translate to certain responsibilities for you if you + distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether + gratis or for a fee, you must give the recipients all the rights that + you have. You must make sure that they, too, receive or can get the + source code. And you must show them these terms so they know their + rights. + + We protect your rights with two steps: (1) copyright the software, and + (2) offer you this license which gives you legal permission to copy, + distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain + that everyone understands that there is no warranty for this free + software. If the software is modified by someone else and passed on, we + want its recipients to know that what they have is not the original, so + that any problems introduced by others will not reflect on the original + authors' reputations. + + Finally, any free program is threatened constantly by software + patents. We wish to avoid the danger that redistributors of a free + program will individually obtain patent licenses, in effect making the + program proprietary. To prevent this, we have made it clear that any + patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and + modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains + a notice placed by the copyright holder saying it may be distributed + under the terms of this General Public License. The "Program", below, + refers to any such program or work, and a "work based on the Program" + means either the Program or any derivative work under copyright law: + that is to say, a work containing the Program or a portion of it, + either verbatim or with modifications and/or translated into another + language. (Hereinafter, translation is included without limitation in + the term "modification".) Each licensee is addressed as "you". + + Activities other than copying, distribution and modification are not + covered by this License; they are outside its scope. The act of + running the Program is not restricted, and the output from the Program + is covered only if its contents constitute a work based on the + Program (independent of having been made by running the Program). + Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's + source code as you receive it, in any medium, provided that you + conspicuously and appropriately publish on each copy an appropriate + copyright notice and disclaimer of warranty; keep intact all the + notices that refer to this License and to the absence of any warranty; + and give any other recipients of the Program a copy of this License + along with the Program. + + You may charge a fee for the physical act of transferring a copy, and + you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion + of it, thus forming a work based on the Program, and copy and + distribute such modifications or work under the terms of Section 1 + above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + + These requirements apply to the modified work as a whole. If + identifiable sections of that work are not derived from the Program, + and can be reasonably considered independent and separate works in + themselves, then this License, and its terms, do not apply to those + sections when you distribute them as separate works. But when you + distribute the same sections as part of a whole which is a work based + on the Program, the distribution of the whole must be on the terms of + this License, whose permissions for other licensees extend to the + entire whole, and thus to each and every part regardless of who wrote it. + + Thus, it is not the intent of this section to claim rights or contest + your rights to work written entirely by you; rather, the intent is to + exercise the right to control the distribution of derivative or + collective works based on the Program. + + In addition, mere aggregation of another work not based on the Program + with the Program (or with a work based on the Program) on a volume of + a storage or distribution medium does not bring the other work under + the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, + under Section 2) in object code or executable form under the terms of + Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + + The source code for a work means the preferred form of the work for + making modifications to it. For an executable work, complete source + code means all the source code for all modules it contains, plus any + associated interface definition files, plus the scripts used to + control compilation and installation of the executable. However, as a + special exception, the source code distributed need not include + anything that is normally distributed (in either source or binary + form) with the major components (compiler, kernel, and so on) of the + operating system on which the executable runs, unless that component + itself accompanies the executable. + + If distribution of executable or object code is made by offering + access to copy from a designated place, then offering equivalent + access to copy the source code from the same place counts as + distribution of the source code, even though third parties are not + compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program + except as expressly provided under this License. Any attempt + otherwise to copy, modify, sublicense or distribute the Program is + void, and will automatically terminate your rights under this License. + However, parties who have received copies, or rights, from you under + this License will not have their licenses terminated so long as such + parties remain in full compliance. + + 5. You are not required to accept this License, since you have not + signed it. However, nothing else grants you permission to modify or + distribute the Program or its derivative works. These actions are + prohibited by law if you do not accept this License. Therefore, by + modifying or distributing the Program (or any work based on the + Program), you indicate your acceptance of this License to do so, and + all its terms and conditions for copying, distributing or modifying + the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the + Program), the recipient automatically receives a license from the + original licensor to copy, distribute or modify the Program subject to + these terms and conditions. You may not impose any further + restrictions on the recipients' exercise of the rights granted herein. + You are not responsible for enforcing compliance by third parties to + this License. + + 7. If, as a consequence of a court judgment or allegation of patent + infringement or for any other reason (not limited to patent issues), + conditions are imposed on you (whether by court order, agreement or + otherwise) that contradict the conditions of this License, they do not + excuse you from the conditions of this License. If you cannot + distribute so as to satisfy simultaneously your obligations under this + License and any other pertinent obligations, then as a consequence you + may not distribute the Program at all. For example, if a patent + license would not permit royalty-free redistribution of the Program by + all those who receive copies directly or indirectly through you, then + the only way you could satisfy both it and this License would be to + refrain entirely from distribution of the Program. + + If any portion of this section is held invalid or unenforceable under + any particular circumstance, the balance of the section is intended to + apply and the section as a whole is intended to apply in other + circumstances. + + It is not the purpose of this section to induce you to infringe any + patents or other property right claims or to contest validity of any + such claims; this section has the sole purpose of protecting the + integrity of the free software distribution system, which is + implemented by public license practices. Many people have made + generous contributions to the wide range of software distributed + through that system in reliance on consistent application of that + system; it is up to the author/donor to decide if he or she is willing + to distribute software through any other system and a licensee cannot + impose that choice. + + This section is intended to make thoroughly clear what is believed to + be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in + certain countries either by patents or by copyrighted interfaces, the + original copyright holder who places the Program under this License + may add an explicit geographical distribution limitation excluding + those countries, so that distribution is permitted only in or among + countries not thus excluded. In such case, this License incorporates + the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions + of the General Public License from time to time. Such new versions will + be similar in spirit to the present version, but may differ in detail to + address new problems or concerns. + + Each version is given a distinguishing version number. If the Program + specifies a version number of this License which applies to it and "any + later version", you have the option of following the terms and conditions + either of that version or of any later version published by the Free + Software Foundation. If the Program does not specify a version number of + this License, you may choose any version ever published by the Free Software + Foundation. + + 10. If you wish to incorporate parts of the Program into other free + programs whose distribution conditions are different, write to the author + to ask for permission. For software which is copyrighted by the Free + Software Foundation, write to the Free Software Foundation; we sometimes + make exceptions for this. Our decision will be guided by the two goals + of preserving the free status of all derivatives of our free software and + of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY + FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN + OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES + PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED + OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS + TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE + PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, + REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING + WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR + REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, + INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING + OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED + TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY + YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER + PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE + POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest + possible use to the public, the best way to achieve this is to make it + free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest + to attach them to the start of each source file to most effectively + convey the exclusion of warranty; and each file should have at least + the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + + Also add information on how to contact you by electronic and paper mail. + + If the program is interactive, make it output a short notice like this + when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + + The hypothetical commands `show w' and `show c' should show the appropriate + parts of the General Public License. Of course, the commands you use may + be called something other than `show w' and `show c'; they could even be + mouse-clicks or menu items--whatever suits your program. + + You should also get your employer (if you work as a programmer) or your + school, if any, to sign a "copyright disclaimer" for the program, if + necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + + This General Public License does not permit incorporating your program into + proprietary programs. If your program is a subroutine library, you may + consider it more useful to permit linking proprietary applications with the + library. If this is what you want to do, use the GNU Library General + Public License instead of this License. |
From: Matthew K. <mka...@us...> - 2004-04-15 16:08:58
|
Update of /cvsroot/squalk/ircbot/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18625 Added Files: README INSTALL COPYING AUTHORS ChangeLog TODO Log Message: empty doc files. --- NEW FILE: COPYING --- --- NEW FILE: INSTALL --- --- NEW FILE: AUTHORS --- --- NEW FILE: README --- --- NEW FILE: ChangeLog --- --- NEW FILE: TODO --- |
From: Matthew K. <mka...@us...> - 2004-04-15 16:06:39
|
Update of /cvsroot/squalk/ircbot/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18012/doc Log Message: Directory /cvsroot/squalk/ircbot/doc added to the repository |
From: Matthew K. <mka...@us...> - 2004-04-09 20:20:14
|
Update of /cvsroot/squalk/ircbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5031 Modified Files: ircbot.php Log Message: oops; fixing include. Index: ircbot.php =================================================================== RCS file: /cvsroot/squalk/ircbot/ircbot.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ircbot.php 9 Apr 2004 01:10:48 -0000 1.1.1.1 --- ircbot.php 9 Apr 2004 20:06:49 -0000 1.2 *************** *** 1,9 **** <?php // $Id$ ! require_once('defines.php'); require_once(LIB_PATH . 'functions.php'); require_once(LIB_PATH . 'class_irc_commands.php'); require_once(LIB_PATH . 'class_irc.php'); $config = get_config('ircbot.cfg'); foreach($config as $setting => $value) { --- 1,13 ---- <?php // $Id$ ! require_once('defines.inc'); require_once(LIB_PATH . 'functions.php'); require_once(LIB_PATH . 'class_irc_commands.php'); require_once(LIB_PATH . 'class_irc.php'); + if(isset($_SERVER)) { + panic('Will not run in web environment!'); + } + $config = get_config('ircbot.cfg'); foreach($config as $setting => $value) { |
From: Matthew K. <mka...@us...> - 2004-04-09 01:27:01
|
Update of /cvsroot/squalk/ircbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26275 Modified Files: ircbot.cfg Removed Files: .project Log Message: oops :) --- .project DELETED --- Index: ircbot.cfg =================================================================== RCS file: /cvsroot/squalk/ircbot/ircbot.cfg,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ircbot.cfg 9 Apr 2004 01:10:48 -0000 1.1.1.1 --- ircbot.cfg 9 Apr 2004 01:13:43 -0000 1.2 *************** *** 1,12 **** ;// $Id$ [user_section] ! username = "ptibot" ! realname = "ptibot" ! nickname = "ptibot" [server_section] ! server = "irc.freenode.net" port = 6667 [channel_section] ! channels = "|#ptitest|" [module_section] ! modules = "|modules/log.php|" \ No newline at end of file --- 1,12 ---- ;// $Id$ [user_section] ! username = "bot" ! realname = "bot" ! nickname = "bot" [server_section] ! server = "irc.example.net" port = 6667 [channel_section] ! channels = "|#example|" [module_section] ! modules = "|modules/log.php|" |
From: <mka...@us...> - 2003-11-14 20:22:11
|
Update of /cvsroot/squalk/squalk/lib In directory sc8-pr-cvs1:/tmp/cvs-serv5093/lib Modified Files: libsqualk.php Added Files: libfile.php libmodule.php libxml.php Log Message: seperating objects for clarity. --- NEW FILE: libfile.php --- <?php # squalk; a multithreading modular services bot for IRC. # ------------------------------------------------------ # Copyright (c) 2003 Matthew Kavanagh. # Licensed under the GNU Lesser GPL. # For details see the file 'copyright'. # ------------------------------------------------------ # $Id: libfile.php,v 1.1 2003/11/14 20:22:02 mkavanagh Exp $ class file extends template { protected $object_info = array( 'name' => 'Basic filesystem interface object', 'author' => 'Matt Kavanagh', 'description' => 'This object is for the basic reading, writing and manipulation of files and directories.', 'file' => __FILE__, 'instance' => array( 'time' => null, 'arguments' => array() ) ); protected $files = array(); function dir_list($dir_name, $mode = 'all') { if(is_dir($dir_name)) { if($dir_resource = opendir($dir_name)) { while(( $dir_entry = readdir($dir_resource) ) !== false) { if($mode == 'all') { $return_array[] = $dir_entry; } else if($mode == 'files') { if(is_file($dir_name.'/'.$dir_entry)) { $return_array[] = $dir_entry; } } else if($mode == 'dirs') { if(is_dir($dir_name.'/'.$dir_entry)) { $return_array[] = $dir_entry; } } else { return false; } } return $return_array; } else { return false; } } else { return false; } } function open_file($file_path, $mode) { } } ?> --- NEW FILE: libmodule.php --- <?php # squalk; a multithreading modular services bot for IRC. # ------------------------------------------------------ # Copyright (c) 2003 Matthew Kavanagh. # Licensed under the GNU Lesser GPL. # For details see the file 'copyright'. # ------------------------------------------------------ # $Id: libmodule.php,v 1.1 2003/11/14 20:22:03 mkavanagh Exp $ class module extends xml { protected $object_info = array( 'name' => 'Module loading system', 'author' => 'Matt Kavanagh', 'description' => 'This object is for the loading and unloading of modules, together with retrieving information about them.', 'file' => __FILE__, 'instance' => array( 'time' => null, 'arguments' => array() ) ); protected $loaded_modules = array(); function module_list_files($dir_name) { if($files = $this->dir_list($dir_name, 'files')) { foreach($files as $file) { if(( substr(0, 6, $file) == 'module_' ) && ( substr(strlen($file)-5, strlen($file)-1, $file) == '.xml' )) { $return_array[] = $dir_name.'/'.$file; } } return $return_array; } else { return false; } } function module_get_info($module_path) { if(is_file($module_path)) { if($module_info_xml = simplexml_load_file($module_path)) { } else { return false; } } else { return false; } } } ?> --- NEW FILE: libxml.php --- <?php # squalk; a multithreading modular services bot for IRC. # ------------------------------------------------------ # Copyright (c) 2003 Matthew Kavanagh. # Licensed under the GNU Lesser GPL. # For details see the file 'copyright'. # ------------------------------------------------------ # $Id: libxml.php,v 1.1 2003/11/14 20:22:03 mkavanagh Exp $ class xml extends file { protected $object_info = array( 'name' => 'XML parsing object', 'author' => 'Matt Kavanagh', 'description' => 'Parses XML files for use in such things as configuration files and data files.', 'file' => __FILE__, 'instance' => array( 'time' => null, 'arguments' => array() ) ); function load_file($file_path) { if(is_file($file_path)) { } else { return false; } } } ?> Index: libsqualk.php =================================================================== RCS file: /cvsroot/squalk/squalk/lib/libsqualk.php,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -C2 -d -r1.1.1.2 -r1.2 *** libsqualk.php 14 Nov 2003 16:43:49 -0000 1.1.1.2 --- libsqualk.php 14 Nov 2003 20:22:03 -0000 1.2 *************** *** 54,171 **** } - class file extends template { - protected $object_info = array( - 'name' => 'Basic filesystem interface object', - 'author' => 'Matt Kavanagh', - 'description' => 'This object is for the basic reading, writing and manipulation of files and directories.', - 'file' => __FILE__, - 'instance' => array( - 'time' => null, - 'arguments' => array() - ) - ); - - protected $files = array(); - - function dir_list($dir_name, $mode = 'all') { - if(is_dir($dir_name)) { - if($dir_resource = opendir($dir_name)) { - while(( $dir_entry = readdir($dir_resource) ) !== false) { - if($mode == 'all') { - $return_array[] = $dir_entry; - } - else if($mode == 'files') { - if(is_file($dir_name.'/'.$dir_entry)) { - $return_array[] = $dir_entry; - } - } - else if($mode == 'dirs') { - if(is_dir($dir_name.'/'.$dir_entry)) { - $return_array[] = $dir_entry; - } - } - else { - return false; - } - } - return $return_array; - } - else { - return false; - } - } - else { - return false; - } - } - - function open_file($file_path, $mode) { - } - } - - class xml extends file { - protected $object_info = array( - 'name' => 'XML parsing object', - 'author' => 'Matt Kavanagh', - 'description' => 'Parses XML files for use in such things as configuration files and data files.', - 'file' => __FILE__, - 'instance' => array( - 'time' => null, - 'arguments' => array() - ) - ); - - function load_file($file_path) { - if(is_file($file_path)) { - - } - else { - return false; - } - } - } - - class module extends xml { - protected $object_info = array( - 'name' => 'Module loading system', - 'author' => 'Matt Kavanagh', - 'description' => 'This object is for the loading and unloading of modules, together with retrieving information about them.', - 'file' => __FILE__, - 'instance' => array( - 'time' => null, - 'arguments' => array() - ) - ); - - protected $loaded_modules = array(); - - function module_list_files($dir_name) { - if($files = $this->dir_list($dir_name, 'files')) { - foreach($files as $file) { - if(( substr(0, 6, $file) == 'module_' ) && ( substr(strlen($file)-5, strlen($file)-1, $file) == '.xml' )) { - $return_array[] = $dir_name.'/'.$file; - } - } - return $return_array; - } - else { - return false; - } - } - - function module_get_info($module_path) { - if(is_file($module_path)) { - if($module_info_xml = simplexml_load_file($module_path)) { - - } - else { - return false; - } - } - else { - return false; - } - } - } - ?> --- 54,56 ---- |