Created
April 25, 2018 14:41
-
-
Save Jan02/eb1c8e7c19a66cee7bcac93cc6a02e36 to your computer and use it in GitHub Desktop.
IRC Announce for Eggdrops
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Carlcox89 post Jun 4 2006, 07:27 PM | |
For those of you, that don't want to have your computer on 24/7 and have a eggdrop, i will give you a .tcl that displays on eggdrops channel a message saying a new torrent was uploaded. | |
Copy this text, create a new .txt file, rename it to announcer.tcl and paste this: | |
CODE | |
set colour "03" | |
proc tagcolour {} { | |
global colour | |
if {$colour!=""} { return "\003$colour" } | |
} | |
proc Server {channel clientaddr clientport} { | |
gets $channel msg_bt | |
putserv "PRIVMSG #CHANNEL :[tagcolour]$msg_bt" | |
close $channel | |
socket -server Server 2345 | |
} | |
socket -server Server 2345 | |
you only have to change where it says #CHANNEL, to your eggdrop channel and the 2345 number, that is the port that eggdrop will open for connection. | |
Sometimes you may get an error when trying to run the eggdrop, when it happens, you only have to change the port to another (its because its already in use) | |
Now in the eggdrop.conf (the configuration file of your eggdrop) | |
you have to add the following line, at the end: | |
CODE | |
source scripts/announcer.tcl | |
Open Torrents-Upload.php | |
find: | |
CODE | |
write_log("Torrent $id ($torrent) was uploaded by " . $CURUSER["username"]); | |
add bellow: | |
CODE | |
//IRC ANNOUNCE THE POST | |
if ($IRCANNOUNCE){ | |
$msg_bt = chr(3)."10 $SITENAME - New Torrent: (".chr(3)."15 $torrent".chr(3)."10 ) Size: (".chr(3)."15 ".mksize($totallen).chr(3)."10 ) Uploader: (".chr(3)."15 $CURUSER[username]".chr(3)."10 ) Link: (".chr(3)."15 $SITEURL/torrents-details.php?id=$id&hit=1".chr(3)."10 )\r\n"; | |
$fs = fsockopen("$ANNOUNCEIP", "$ANNOUNCEPORT", $errno, $errstr); | |
if($fs) { | |
fwrite($fs, $msg_bt); | |
fclose($fs); | |
} | |
}//END IRC ANNOUNCE | |
Of course, you have to turn on the IRC announcer option in Site Settings, define the IP of your eggdrop and the port that you choose in the .tcl script! | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment