# HTML2.Tcl -- a lot like ques3.tcl, but I wrote this one myself and to my # likings PLUS improvemnets for eggdrop1.3.4! # # fixed - doesn't display chan voices twice.. # # Original Version by kn0 # Edited for Eggdrop1.3.x by Prime # Set these.... # Do this for every channel you want set web_chans(#Montreal) montreal.html # What directory are your web pages in? Or what directory do you want this to # be in? set web_dir /home/prime/public_html/ # How often do you want the page to be updated? (In minutes) set web_update 1 ###### Do not edit anything beyond this point!!! ###### foreach i [timers] { if {[lindex $i 1] == "web_write"} { killtimer [lindex $i 2] } } if ![info exists web_topic] {set web_topic(*) "*"} foreach i [channels] {set web_topic($i) ""} proc web_write {} { global web_dir web_update botnick nick web_topic web_chans foreach i [array names web_chans] { set wpage $web_dir$web_chans($i) set web_page $web_chans($i) set web_chan $i set a [open $wpage w] if {$web_topic($i) == ""} { set web_topic($i) "topic unknown" } puts $a "" puts $a "$web_chan IRC channel stats (Written at [time] [date])" puts $a "
$nick's $web_chan stats
(Topic: $web_topic($i))
" if {![onchan $botnick $web_chan]} { puts $a "I ($nick) am currently not on $web_chan, try again later" puts $a

} puts $a "

" puts $a "" puts $a "" puts $a "" set chanlist [chanlist $web_chan] set chanlist "$botnick [lsort [lrange $chanlist 1 end]]" set oplist "" set vlist "" set noplist "" set noplist2 "" foreach i $chanlist {if [isop $i $web_chan] {lappend oplist $i} {lappend noplist $i}} foreach i $noplist { if [isvoice $i $web_chan] { lappend vlist $i } { lappend noplist2 $i } } set noplist $noplist2 foreach i "\{$oplist\} \{$noplist\} \{$vlist\}" { foreach b $i { set c "" if {[isop $b $web_chan]} {set q "@"} {set q ""} if {[isvoice $b $web_chan]} {set q "+"} if {[matchattr [nick2hand $b $web_chan] b]} {append c ", (BOT)"} if {$botnick == $b} { puts $a "" } if {$botnick != $b} { set hand [nick2hand $b $web_chan] puts $a "" if {[getchaninfo $hand $web_chan] != "" && ![matchattr $b b] && $hand != "*"} { puts $a "" } } } } puts $a "
$web_chan, [getchanmode $web_chan] ([llength [chanlist $web_chan]] users)
NicknameStatus/info lineAddress
$q$b<-- It's me!
$q$bIdle [getchanidle $b $web_chan] min$c[getchanhost $b $web_chan]
Info: [getchaninfo [nick2hand $b $web_chan] $web_chan]
" if {[chanbans $web_chan] != ""} { puts $a "" puts $a "" foreach c [chanbans $web_chan] { puts $a "" } puts $a "
Bans:
$c
" } puts $a "
" puts $a
puts $a "Click here if you have a text-only browser.
" puts $a "This page is updated every $web_update minute(s)." puts $a "
-- HTML2.Tcl Eggdrop 1.3 script --
" close $a } timer $web_update web_write } bind topc - * web_topic proc web_topic {nick uhost handle channel vars} { global web_topic web_chans if {[lsearch [array names web_chans] $channel] != "-1"} { set web_topic($channel) $vars } } web_write putlog "\002HTML2\002 by \037Prime\037 - Writing: [array names web_chans] :stats files"