# HTML-DCC.Tcl -- a lot like ques3.tcl, but I wrote this one myself and to my
# likings =) -- for dcc partyline (channel 0)
# Buggy?
# by kn0
# Set these....
# What directory are your web pages in?
set web_dir /export/home/keith/public_html/
# What do you want the page to be called? ([string tolower $nick] is the bot's
# nickname, all in lowercase)
set dcc_page [string tolower $nick]-dcc.html
# How often do you want the page to be updated? (In minutes)
set dcc_update 1
###### Do not edit anything beyond this point!!! ######
foreach i [timers] {
if {[lindex $i 1] == "dcc_write"} {
killtimer [lindex $i 2]
}
}
if {$web_log == "1"} {
logfile mpjk $web_chan $web_logfile
}
proc dcc_write {} {
global web_dir dcc_page web_chan dcc_update botnick nick web_log web_logfile web_topic
set wpage $web_dir$dcc_page
set a [open $wpage w+]
puts $a "Partyline stats (Written at [time] [date])"
puts $a "
$nick's partyline stats
"
puts $a "
"
puts $a "
"
puts $a "
PartyLine ([llength [whom 0]] users)
"
puts $a "
Handle
Status
Address
"
set alist [whom 0]
foreach i $alist {
set nicq [lindex $i 0]
set bot [lindex $i 1]
set addr [lindex $i 2]
set stat [lindex $i 3]
if {$stat == "*"} {set stat owner}
if {$stat == "+"} {set stat master}
if {$stat == "@"} {set stat op}
if {$stat == "-"} {set stat ""}
set idle [lindex $i 4]
if !$idle {
set idle ""
} {
set idle "Idle $idle min"
}
if {$idle != "" && $stat != ""} {
set blah ", "
} {
set blah ""
}
set away [lindex $i 5]
puts $a "
$nicq@$bot
$idle$blah$stat
$addr
"
if {$away != ""} {
puts $a "
Away: $away
"
}
}
puts $a "
"
puts $a "
"
puts $a
puts $a "Click here if you have a text-only browser. "
puts $a "This page is updated every $dcc_update minutes."
puts $a "