i have found a solution for this. and it works for me now.
im using TSSE5.6
Just add this in your takeupload.php
AFTER
PHP Code:
$res = sql_query ('SELECT name FROM categories WHERE id=' . sqlesc ($catid));
$arr = mysql_fetch_assoc ($res);
$cat = $arr['name'];[/quote][quote]// Bot IRC
$res = mysql_query("SELECT name FROM categories WHERE id=$catid") or sqlerr();
$arr = mysql_fetch_assoc($res);
$cat = $arr["name"];
$s = mksize($totallen);
$bot['ip'] = "IP ADRESSE FOR BOT SERVER"; // your bot ip
$bot['port'] = "PORT TO BOT USING"; // your script listen port
$bot['password'] = "PASSWORD"; // password which you have set in script
$bot['message'] = "7,1[New torrent was uploaded] 0,1-> 3,1Name: \002$torrent\002 .:. Category: \002$cat\002 0,1.:. 4,1URL: \002$BASEURL/details.php?id=$id"; // your message
$fp = fsockopen($bot['ip'], $bot['port'], $errno, $errstr, 40);
if($fp)
{
fputs($fp, $bot['password'] . " " . $bot['message'] . "\n");
sleep(15);
fclose($fp);
}
//botmsg("New Torrent :: ($torrent) :: ($cat) :: ($s) :: ($BASEURL/details.php?id=$id)");
// Bot IRC end
And in your Eggdrop bot.
announce.tcl
PHP Code:
# port for your script you want to listen on (you need to set same port in php script)
set botlisten(port) "SAME PORT AS TAKEUPLOAD"
# password (you need to set same password in php script)
set botlisten(password) "PASSWORD"
# channel you want to send output to
set botlisten(channel) "#IRCCHAN"
listen $botlisten(port) script botlisten
proc botlisten {idx} {
control $idx botlisten2
}
proc botlisten2 {idx args} {
global botlisten newTorrentChannel
set args [join $args]
set botlisten(pass) [lindex [split $args] 0]
set botlisten(message) [join [lrange [split $args] 1 end]]
if {[string match $botlisten(pass) $botlisten(password)]} then {
putquick "PRIVMSG $botlisten(channel) :$botlisten(message)"
} else {
putlog "Unauthorized person tried to connect to the bot"
}
}
Or using this torrents.tcl
PHP Code:
listen PORT_FROM _TAKEUPLOAD script xxGRAB
proc xxGRAB { NewIDX } {
control $NewIDX torrent:CTL
putlog "TORRENT: Received connection $NewIDX"
}
proc torrent:CTL { IDX Args } {
putlog "TORRENT: $Args"
putserv "PRIVMSG #IRCCHAN :$Args"
}
putlog "### Torrent announcer loaded"