The script is used as follows:
Gamers seeking war and HAVE server use the !addpcw <theis speccs> command
Gamers seeking war WITHOUT server use "!listpcw" which will display the last 10 entrys to "!addpcw", using notice from my egg (this is where I an afraid of excess flood if the script is used very often)
First the "addpcw" script:
Code: Select all
set minkanal "#clan-war"
bind pub - !addpcw addpcwmsg
proc addpcwmsg {n u h c t} {
######
global minkanal
if {[string tolower $c] != $minkanal} {
putserv "NOTICE $n : Join #Clan-War to get full use of the seek and add Clan-War features!"
return 0
}
######
set filename "/home/to2/website/pw.txt"
set fid [open $filename "a"]
puts $fid "$n: Have Server! $t"
close $fid
puthelp "NOTICE $n :Your PCW: <Have Server! $t> have been added."
}
and second the "listpcw" script:
Code: Select all
package require http
set minkanal "#clan-war"
bind pub - !listpcw listplayers
proc listplayers {n u h c t} {
######
global minkanal
if {[string tolower $c] != $minkanal} {
putserv "NOTICE $n : Join #Clan-War to get full use of the seek and add Clan-War features!"
return 0
}
######
set x [::http::geturl http://localhost/pw.txt]
set lines [lrange [split [::http::data $x] \n] end-9 end]
foreach e $lines {puthelp "NOTICE $n :$e"}
::http::cleanup $x
}