egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem with phpbb2egg

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
jsilvestre
Voice


Joined: 05 Mar 2005
Posts: 20
Location: Lisbon, Portugal

PostPosted: Sun Mar 13, 2005 3:06 pm    Post subject: Problem with phpbb2egg Reply with quote

I use phpbb2egg tcl but when have a new post or any action in forum bot show an error in partyline and the script don´t work.
The error is: Tcl error: no value given for parameter "idx" to "phpbb2eggaccept"

Quote:

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..."




Quote:

functions_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 "";
}



?>


i wait for yours sugestions Smile
_________________
Best Regards

José Eduardo Silvestre
Back to top
View user's profile Send private message Send e-mail MSN Messenger
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Sun Mar 13, 2005 4:27 pm    Post subject: Reply with quote

next time use [code] tag when pasting code

remove that for($i=0;$i<400000;$i++) from your PHP script

use .set errorInfo from eggdrop's party line to obtain full error traceback
Back to top
View user's profile Send private message Visit poster's website
jsilvestre
Voice


Joined: 05 Mar 2005
Posts: 20
Location: Lisbon, Portugal

PostPosted: Mon Mar 14, 2005 6:13 am    Post subject: Reply with quote

.set errorInfo
Code:

Currently: list element in braces followed by "ngel" instead of space
Currently:     while executing
Currently: "lindex $arg 5"
Currently:     (procedure "raw_352" line 3)
Currently:     invoked from within
Currently: "raw_352 $_raw1 $_raw2 $_raw3"

_________________
Best Regards

José Eduardo Silvestre
Back to top
View user's profile Send private message Send e-mail MSN Messenger
De Kus
Revered One


Joined: 15 Dec 2002
Posts: 1361
Location: Germany

PostPosted: Mon Mar 14, 2005 9:36 am    Post subject: Reply with quote

hmm, I believe "set line [join $args]" should " set line [split $args]"
btw. there are known issues with the var name "args", better use arg or something like this.
your error leads to this TCL FAQ entry:
http://forum.egghelp.org/viewtopic.php?t=2603
_________________
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
Back to top
View user's profile Send private message MSN Messenger
AxS
Halfop


Joined: 09 Apr 2003
Posts: 46

PostPosted: Fri Mar 03, 2006 1:25 am    Post subject: Reply with quote

Is anyone able to write a working script or a modification of the one available to make it work? Really want this script running... so far i got the eggdrop saying lost telnet connection, eitherway - if you guys have it running and working - please point me in the right direction - if not, can someone clever enough, which i'm sure one of you here is, write a script... its something which I find very useful.

Many thanx
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Fri Mar 03, 2006 1:34 am    Post subject: Reply with quote

many people have been requesting this, noone delivered - so if you really want it that bad, pay someone to write it for you
_________________
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code
Back to top
View user's profile Send private message Visit poster's website
AxS
Halfop


Joined: 09 Apr 2003
Posts: 46

PostPosted: Fri Mar 03, 2006 7:06 am    Post subject: Reply with quote

Thanx, that helps alot!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Script Support & Releases All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber