example:
<Killah420> @reqs del 1
<Incomplete> removing : test.r00 /test , was requested by Killah420 on Sat Nov 11 23:48:54 2006
<Killah420> @reqs view
<Incomplete> Please try and help us fill these requests
<Incomplete> #1, test.r00 /test , was requested by Killah420 on Sat Nov 11 23:48:54 2006
<Incomplete> End of file. If you can fill a request, please upload it to an op
<Incomplete> [00:32] Tcl error [pubm:req]: couldn't create error file for command: no such file or directory
^ that comes up in the incomplete dcc chat box
Code: Select all
##########################################
# REQS 1.3.1 Tcl for Channel Request List by [-Scorp-] (aka : Scorpion`)
# Revision History:
# 1.1 (May 10, 1999) - Added main options as variables
# 1.2 (July 2, 1999) - Minor bug fixes & added e-mail contact
# 1.2b5-f (Oct , 1999) added a list for requests that have been filled
# and a few major changes
# 1.3 (11/12/99) fixed a few small bugs in the HTML generator
# added a link to this Tcl in the HTML generator
# 1.3.1 (11/13/99) added a fix so that if someone uses quotes , it will remove them
# insted of changing them to {brackets}
# [-Scorp-] can be contacted at : bikini.team@sweden.com
# If you edit this Tcl , i would like the proper recognition
# Please E mail me with any bugs or comments
# This TCL is designed to maintain a "Channel Request List"
# For use in MP3, Warez, or other channels. Please change
# the few variables below for channel & bot options.
# Additions, deletions, and the list are maintained through
# a public @reqs command, with certain arguments (see below).
# The script will run on your bot, and will only recognize
# public messages in that channel. If the user tries @reqs via
# /MSG, the bot will respond that it must be done publicly.
# There is also a template file that will be sent with a
# @reqs send command. It is sent appended to the top of the
# requests file, in a .doc format. Please note that it MUST be
# edited with a *nix editor such as pico.
# The commands it recognizes are as follows:
#
# @reqs help [to get a list of available commands]
# @reqs view [to see the list via msg]
# @reqs send [for a .doc of the list]
# @reqs add <Song Title-Artist> [to add to the list] (Must be +v or +o in the channel, not on the bot)
# @reqs del <request#> [to delete a request] (Must be +o in the channel, not on the bot)
# @reqs filled <to see the list of requests that have been filled via msg>
# @reqs purge <number of the filled request> :You Must Be +o to remove filled requests from the requests filled file
##########################################
##########################################
#
#set the channel you want the script to run in
set reqschanl "#incomplete"
##########################################
#set this to the file you want to be sent for "@reqs send"
set reqsfile "incomplete"
##########################################
#set the number of requests you want the bot to tell people to limit their requests to
set reqnub "8"
##########################################
#this is the file you need to edit or change , it will be sent at the top
#of the .doc for a "@reqs send"
set tfile "template"
##########################################
#set the name of the reqs filled file
set fld "filled_requests"
##########################################
#set this to the msg that you want the bot to advertise
#set admsg "Please help us fill requests, type @reqs for an index of commands. or goto http://shell.com/~username/ .Feel free to add a request or 2. Thank You!!"
##########################################
#set this to how many minute intervals you want the ad to repeat (30 minutes is recommended)
set adtm "60"
##########################################
##########################################
#Below are the settings for the Request list HTML Generator
##########################################
#set this to on or off for the HTML generator
set gnr "off"
#########
#if you set the HTML generator to on, you need to edit the header and footer files to your needs
#and set the dir for the Request list HTML to goto
#########
#set the header for the HTML file
set hdfile "./headforhtml"
##########################################
#set the footer for the HTML file
set ftfile "./footforhtml"
##########################################
#set the filename for the HTML output
set htmlout "index.html"
##########################################
#set the full public_html path
set htmlpath "/home/username/public_html"
##########################################
##########################################
##
##DO NOT CHANGE ANYTHING BELOW THIS POINT!
##
##########################################
set reqsver "1.3.1"
proc chanmsg1 {} {
global admsg reqschanl adtm
puthelp "PRIVMSG $reqschanl :$admsg"
timer $adtm chanmsg1
}
if {![info exists timerloaded]} {
putlog "reqs.tcl ad msg timer started"
timer 5 chanmsg1
set timerloaded 1
}
bind pub - @reqs pubm:req
proc pubm:req {nick uhost hand chan arg} {
global reqsver reqsfile time date tfile reqschanl reqnub hdfile ftfile htmlout htmlpath rpl bld1 bld2 gnr fld
set command [string tolower [lindex $arg 0]]
set ops [isop $nick $chan]
set vops [isvoice $nick $chan]
set channel [string tolower $chan]
set reqschan [string tolower $reqschanl]
if {$channel == "$reqschan"} {
if {$command == "help" || $command == ""} {
puthelp "PRIVMSG $nick :USAGE: @reqs add Song Title-Artist :You Must Be +v or +o to add requests"
puthelp "PRIVMSG $nick :USAGE: @reqs del <number of the request> :You Must Be +o to delete requests"
puthelp "PRIVMSG $nick :USAGE: @reqs send <for a .doc of the list to keep>"
puthelp "PRIVMSG $nick :USAGE: @reqs view <to see the list via msg>"
puthelp "PRIVMSG $nick :USAGE: @reqs filled <to see the list of requests that have been filled via msg>"
puthelp "PRIVMSG $nick :USAGE: @reqs purge <number of the filled request> :You Must Be +o to remove filled requests from the requests filled file"
puthelp "PRIVMSG $nick :USAGE: @reqs help <this help msg>"
puthelp "PRIVMSG $nick :All Commands are via the channel"
puthelp "PRIVMSG $nick :-------------------------------------------"
putlog "#$nick# asked for the help file"
return 0
}
if {$command == "add" && ($ops || $vops)} {
set reqsm [lrange $arg 1 end]
set sts [regsub -all -- \} $reqsm "" reqsb]
set sts [regsub -all -- \{ $reqsb "" reqsa]
set reqs "$reqsa"
if {$reqs == "" || $reqs == "help"} {
puthelp "PRIVMSG $nick :USAGE: @reqs add Song Title-Artist"
return 0
}
if {[file exist $reqsfile]} {set file [open $reqsfile a]} else {set file [open $reqsfile w]}
set time1 [ctime [unixtime]]
puts $file "$reqs , was requested by $nick on $time1"
close $file
puthelp "PRIVMSG $nick :$reqs added to the $reqschan Request list."
puthelp "PRIVMSG $nick :Please Limit your Requests to $reqnub Request(s). Thank You"
putcmdlog "#$nick# added the file : $reqs ..."
if {$gnr == "off"} {
return 0
}
if {$gnr == "on"} {
utimer 1 wpgnr
}
}
if {$command == "add" && !($ops || $vops)} {
puthelp "PRIVMSG $nick :You must be either +o or +v to add a request, sorry"
return 0
}
if {$command == "del" && ($ops)} {
set numbofreqs [lindex $arg 1]
if {($numbofreqs == "" || $numbofreqs == "help")} {
puthelp "PRIVMSG $nick :USAGE: @reqs del number of the request"
return 0
}
putlog "#$nick# : is Removing $numbofreqs from $reqsfile"
if {![file exist $reqsfile]} {
puthelp "PRIVMSG $nick :$reqsfile doesnt exist!"
return 0
}
set count 0
set open [open $reqsfile r]
set bah ""
while {![eof $open] && $bah == ""} {
set poi [gets $open]
if {[lindex $poi 0] != $numbofreqs && $poi != ""} {
incr count
}
if {$count == $numbofreqs} {
puthelp "PRIVMSG $nick :removing : $poi"
set bah "$poi"
}
}
close $open
exec cp $reqsfile $reqsfile.bak
set doc [open $reqsfile.bak r]
set khg [open $reqsfile w]
if {[file exist $fld]} {set fldfile [open $fld a]} else {set fldfile [open $fld w]}
set tribz ""
set time2 [ctime [unixtime]]
set count 0
while {![eof $doc]} {
set poi [gets $doc]
if {$poi != ""} {
incr count
}
if {($count == $numbofreqs) && ($poi != "")} {
putlog "#$nick# removed $poi"
puts $fldfile "The Request: $poi , was filled on $time2"
}
if {$count != $numbofreqs} {
puts $khg "$poi"
}
}
close $doc
close $khg
close $fldfile
if {$gnr == "off"} {
return 0
}
if {$gnr == "on"} {
utimer 1 wpgnr
}
}
if {$command == "del" && !($ops)} {
puthelp "PRIVMSG $nick :You must be +o to remove a request, sorry. ask an op to help you"
return 0
}
if {$command == "purge" && ($ops)} {
set numbofreqs [lindex $arg 1]
if {($numbofreqs == "" || $numbofreqs == "help")} {
puthelp "PRIVMSG $nick :USAGE: @reqs purge number of the filled request on the filled request list"
return 0
}
putlog "#$nick# : is Removing $numbofreqs from $fld"
if {![file exist $fld]} {
puthelp "PRIVMSG $nick :$reqsfile doesnt exist!"
return 0
}
set count 0
set open [open $fld r]
set bah ""
while {![eof $open] && $bah == ""} {
set poi [gets $open]
if {[lindex $poi 0] != $numbofreqs && $poi != ""} {
incr count
}
if {$count == $numbofreqs} {
puthelp "PRIVMSG $nick :removing : $poi"
set bah "$poi"
}
}
close $open
exec cp $fld $fld.bak
set doc [open $fld.bak r]
set khg [open $fld w]
set tribz ""
set count 0
while {![eof $doc]} {
set poi [gets $doc]
if {$poi != ""} {
incr count
}
if {($count == $numbofreqs) && ($poi != "")} {
putlog "#$nick# removed $poi"
}
if {$count != $numbofreqs} {
puts $khg "$poi"
}
}
close $doc
close $khg
if {$gnr == "off"} {
return 0
}
if {$gnr == "on"} {
utimer 1 wpgnr
}
}
if {$command == "purge" && !($ops)} {
puthelp "PRIVMSG $nick :You need to be +o to remove idems from this list"
return 0
}
if {$command == "view"} {
if {![file exist $reqsfile]} {
puthelp "PRIVMSG $nick :There are no requests stored, yet"
return 0
}
set input [open $reqsfile r]
puthelp "PRIVMSG $nick :Thank you for viewing the $reqschan request list"
puthelp "PRIVMSG $nick :Please try and help us fill these requests"
set count 1
while {![eof $input]} {
set poi [gets $input]
if {[lindex $poi 0] != "" } {
puthelp "PRIVMSG $nick :#$count, $poi"
incr count
}
}
if {$count == 1 } {
puthelp "PRIVMSG $nick :There are no requests stored, yet"
} else {
puthelp "PRIVMSG $nick :End of file. If you can fill a request, please upload it to an op"
}
close $input
putcmdlog "#$nick# asked for @reqs view and was sent [expr $count -1] requests"
return 0
}
if {$command == "filled"} {
if {![file exist $fld]} {
puthelp "PRIVMSG $nick :There have been no requests filled, or they were removed from this list."
return 0
}
set inputfld [open $fld r]
puthelp "PRIVMSG $nick :reqs.tcl version $reqsver by \[-Scorp-\] 1999."
puthelp "PRIVMSG $nick :Thank you for viewing the $reqschan Filled Request list."
set count 1
while {![eof $inputfld]} {
set poi [gets $inputfld]
if {[lindex $poi 0] != "" } {
puthelp "PRIVMSG $nick :#$count, $poi"
incr count
}
}
if {$count == 1 } {
puthelp "PRIVMSG $nick :There have been no requests filled yet, or they were removed from this list."
} else {
puthelp "PRIVMSG $nick :End of file. If your Request has been filled , and is on this list, please Nicely ask an op who has your Request, thank you"
}
close $inputfld
putcmdlog "#$nick# asked for @reqs filled and was sent [expr $count -1] filled requests"
return 0
}
if {$command == "send"} {
if {[file exist $tfile]} {
set tpl [open $tfile r]
} else {
set tpl2 [open $tfile w]
puts $tpl2 "Welcome , this is the $reqschanl Request List"
puts $tpl2 "Please help us fill Requests"
puts $tpl2 "---------------------------------------------"
close $tpl2
set tpl [open $tfile r]
}
if {[file exist $reqsfile]} {
set doc [open $reqsfile r]
} else {
puthelp "PRIVMSG $nick :There are no Requests stored"
close $tpl
return 0
}
set khg [open $reqsfile.doc w]
set tribz ""
while {![eof $tpl]} {
set dnd [gets $tpl]
if {$dnd != ""} {
puts $khg "$dnd"
}
}
close $tpl
set tribz ""
set count 1
while {![eof $doc]} {
set poi [gets $doc]
if {$poi != ""} {
puts $khg "#$count , $poi"
incr count
}
}
close $doc
close $khg
putlog "#$nick# is getting $reqsfile.doc"
dccsend $reqsfile.doc $nick
return 0
}
}
}
proc wpgnr {} {
global reqsver reqsfile time date tfile reqschanl reqnub hdfile ftfile htmlout htmlpath rpl bld1 bld2 gnr fld
if {[file exist $hdfile]} {
set hed [open $hdfile r]
} else {
putlog "there is no header file loaded for the html generator"
return 0
}
if {[file exist $ftfile]} {
set fot [open $ftfile r]
} else {
putlog "there is no footer file loaded for the html generator"
return 0
}
set mnf [open $reqsfile r]
if {[file exist ./$htmlout]} {
exec cp ./$htmlout ./$htmlout.bak
set hto [open ./$htmlout w]
} else {
set hto [open ./$htmlout w]
}
while {![eof $hed]} {
set dnd [gets $hed]
if {$dnd != ""} {
puts $hto "$dnd"
}
}
close $hed
set tribz ""
set count 1
while {![eof $mnf]} {
set poi [gets $mnf]
if {$poi != ""} {
puts $hto "#$count , $poi"
puts $hto "<br>"
incr count
}
}
close $mnf
if {[file exist $fld]} {
set cvb [open $fld r]
puts $hto "<center><hr width=300></center><p><p>"
puts $hto "<h2>Here is a list of Requests that have been Filled :</h2><p><p>"
set count 0
while {![eof $cvb]} {
set pog [gets $cvb]
if {4 < [string length $pog]} {
incr count
puts $hto "#$count , $pog"
puts $hto "<br>"
}
}
if {$count == 0} {
puts $hto "There have been no requests Filled or they were removed from the Filled Requests List"
}
close $cvb
} else {
puts $hto "<center><hr width=300></center><p><p>"
puts $hto "There have been no requests Filled or they were removed from the Filled Requests List"
}
puts $hto "<p><p><center><hr width=300></center><p><p>"
while {![eof $fot]} {
set dbd [gets $fot]
if {$dbd != ""} {
puts $hto "$dbd"
}
}
close $fot
puts $hto "This page was made with reqs.tcl version $reqsver by <b><i>\[-Scorp-\]</b></i>"
puts $hto "Send any comments to <a href=\"mailto:bikini.team@sweden.com\">bikini.team@sweden.com</a><p>"
puts $hto "To Download this TCL for Eggdrops <a href=\"http://lithium.ings.com/~clover/reqs.tcl.tar.gz\">Click Here</a><p>"
puts $hto "Special thanks goes to <b><i>KCyborg</b></i> , <b><i>^rolling</b></i> & <b><i>Dynomite</b></i> <br>for ideas and finding bugs for me<br>And all the people in <b><i>#mp3-80's</b></i> for putting up with my sometimes annoying testing of this tcl"
puts $hto "<p><p><p>"
puts $hto "</body>"
puts $hto "</html>"
close $hto
exec cp ./$htmlout $htmlpath/$htmlout
return 0
}
bind msg - @reqs in_chan
proc in_chan {nick uhost hand arg} {
puthelp "PRIVMSG $nick :You Must use the channel for the requests, msg will Not work. thank you"
}
putlog "@reqs.tcl by \[-Scorp-\] 1999 version $reqsver loaded."
Thanks for your help