The error is: Tcl error: no value given for parameter "idx" to "phpbb2eggaccept"
phpbb2egg.tcl
# found on egghelp.org a posting by ShavdApe about a phpbb2egg script
# to post live into a channel when a post on a board is made
# add the line source/phpbb2egg.tcl into your .conf and rehash the bot
# you can change the port here, but pls think about to change it to
# the same port on functions_phpbb2egg.php:
listen 6551 script phpbb2eggaccept
proc phpbb2eggaccept {idx} {
control $idx phpbb2eggincoming
}
proc phpbb2eggincoming {idx args} {
putlog "$args"
set line [join $args]
if {[join $args] != "" } {
set chan [lindex $line 0]
set line [lrange $line 1 end]
set line [join $line]
set line [split $line ";"]
foreach line $line { putserv "PRIVMSG $chan :$line" }
putlog "$line"
}
killdcc $idx
}
putlog "phpbb2egg.tcl Loaded..."
i wait for yours sugestionsfunctions_phpbb2egg.php
<?php
// version 1.0.1 beta[development]
$channel = "#fiodental";
$ids = "1 2 3 4 5"; // forums to display posts from
$botip = "207.44.155.125"; // your bot's ip
$botport = "6551"; // a nice port
$boardurl = "www.fiodental.net/forum";
function send2egg($mode, $forumid, $topic_id, $user_id, $subject, $message, $poll_title, $channel, $ids, $botip, $botport, $boardurl )
{
global $userdata;
$nick = $userdata[$user_id];
//strip BBCode off
$message = preg_replace("#\[(.*?)]#si", "", $message);
// shorten longer postings to 300 signs
$text = wordwrap($message, 300, "\0") . ' ...';
//here we ask for several cases and do some formating stuff with tcl readable colors.
if ( $poll_title != '' )
{
$text2 = "\00300,02 New poll! \00301,99 on our board:<br>";
}
else if ( $mode = 'newtopic' )
{
$text2 = "\00300,02 New topic! \00301,99 on our board:<br>";
}
else
{
$text2 = "\00300,02 Fresh! \00301,99 from our board:<br>";
}
if ( $poll_title != '' )
{
$text2 .= "\00300,04 $nick \00302,99 asks: $poll_title <br>";
}
else if ( $subject != '' )
{
$text2 .= "\00300,04 $nick \00302,99 about the subject $subject :<br>";
$text2 .= " \00302,99 $message <br>";
}
else
{
$text2 .= "\00300,04 $nick".":";
$text2 .= " \00302,99 $message <br>";
}
$text2 .= " Link: \00312,99 $boardurl/viewtopic.php?t=$topic_id ";
$chan = checkid( $forumid, $channel, $ids );
phpbb2egg($chan, $text=$text2, $botip, $botport );
}
function phpbb2egg( $channel, $text, $botip, $botport)
{
if ( $channel == '' || $text == '') {
return;
}
$text = ereg_replace(";", ":", $text);
$text = ereg_replace("<br>", ";", $text);
$line = "$channel $text";
$socket = @fsockopen ($botip, $botport, $null, $null, 60);
if (!$socket)
{
echo " no connection made ";
}
if ($socket) {
@fputs($socket,"$line\n");
for($i=0;$i<400000;$i++)
{
$g=$i;
}
fclose($socket);
}
}
// a little tricky from unknown
function checkid($forumid, $channel, $ids )
{
$public[forumids] = " $ids ";
$public[chan] = " $channel ";
$forumids=explode(" ", $public[forumids]);
while ( list($n, $id) = each($forumids))
{
if ($forumid == $id)
{
return "$public[chan]";
}
}
return "";
}
?>