Code: Select all
set www_channel "#naselo"
set www_file "/home/Vizor/public_html/log.html"
set www_title "roots live wwwgateway"
set www_bgcolor "#ffffff"
set www_fgcolor "#000000"
putlog "--- wwwlive 1.0 by --> roots <-- loaded ---"
putlog "--- type .wwwlive help to get some help ---"
set www_lines 0
proc init {hand idx mode} {
if {$mode == "on"} {
www_htmlheader
bind pubm * * www_pubm
bind join * * www_join
bind part * * www_part
bind sign * * www_sign
bind topc * * www_topc
bind mode * * www_mode
bind kick * * www_kick
bind nick * * www_nick
putlog "--> Initializing wwwlive"
}
if {$mode == "off"} {
unbind pubm * * www_pubm
unbind join * * www_join
bind part * * www_part
bind sign * * www_sign
bind topc * * www_topc
bind mode * * www_mode
bind kick * * www_kick
bind nick * * www_nick
putlog "--> Initializing wwwlive"
}
if {$mode == "off"} {
unbind pubm * * www_pubm
unbind join * * www_join
unbind part * * www_part
unbind sign * * www_sign
unbind topc * * www_topc
unbind mode * * www_mode
unbind kick * * www_kick
unbind nick * * www_nick
www_htmlheader
global www_file
set fh [open $www_file a]
puts $fh "<h2>LIVE WWW disabled.</h2>"
close $fh
putlog "--> Stopping wwwlive"
}
if {$mode == "help"} {
putlog "--> wwwlive help ... the commands :"
putlog " .wwwlive on - turns on the gateway to the www"
putlog " .wwwlive off - turns if off"
putlog " .wwwlive help - shows this help"
}
}
proc www_pubm {nick uhost hand chan args} {
global www_channel
if { $chan == $www_channel} {
www_newfile
set text [lindex $args 0]
global www_lines www_file
set fh [open $www_file a]
puts $fh "\<$nick> $text<br>"
close $fh
incr www_lines
}
}
proc www_pubm {nick uhost hand chan args} {
global www_channel
if { $chan == $www_channel} {
www_newfile
set text [lindex $args 0]
global www_lines www_file
set fh [open $www_file a]
puts $fh "\<$nick> $text<br>"
close $fh
incr www_lines
}
}
proc www_join {nick host hand chan} {
global www_channel
if { $chan == $www_channel} {
www_newfile
global www_lines www_file
set fh [open $www_file a]
puts $fh "*** $nick ($host) has joined $chan<br>"
close $fh
incr www_lines
}
}
proc www_part {nick host hand chan} {
global www_channel
if {$chan == $www_channel} {
www_newfile
global www_lines www_file
set fh [open $www_file a]
puts $fh "*** $nick ($host) has left $chan<br>"
close $fh
incr www_lines
}
}
proc www_sign {nick host hand chan reason} {
global www_channel
if {$chan == $www_channel} {
www_newfile
global www_lines www_file
set text [lindex $reason 0]
set fh [open $www_file a]
puts $fh "*** $nick ($host) has quit irc ($text)<br>"
close $fh
incr www_lines
}
}
proc www_topc {nick host hand chan topc} {
global www_channel
if {$chan == $www_channel} {
www_newfile
global www_lines www_file
set fh [open $www_file a]
puts $fh "*** roots has changed the topic on $chan to $topc<br>"
close $fh
incr www_lines
}
}
proc www_mode {nick host hand chan mc} {
global www_channel
if {$chan == $www_channel} {
www_newfile
global www_lines www_file
set fh [open $www_file a]
puts $fh "*** Mode change $mc on $chan by $nick<br>"
close $fh
incr www_lines
}
}
proc www_kick {nick host hand chan kn kr} {
global www_channel
if {$chan == $www_channel} {
www_newfile
global www_lines www_file
set fh [open $www_file a]
puts $fh "*** $kn has been kicked off $chan by $nick ($kr)<br>"
close $fh
incr www_lines
}
}
proc www_nick {nick host hand chan newnick} {
global www_channel
if {$chan == $www_channel} {
www_newfile
global www_lines www_file
set fh [open $www_file a]
puts $fh "*** $nick is now known as $newnick<br>"
close $fh
incr www_lines
}
}
proc www_newfile {} {
global www_lines
if {$www_lines >25} {
www_htmlheader
set www_lines 0
}
}
proc www_htmlheader {} {
global www_file
global www_title www_bgcolor www_fgcolor
set fh [open $www_file w]
puts $fh "<html><head><title>$www_title</title>"
puts $fh "<meta http-equiv=refresh content=5; url=log.html></head>"
puts $fh "<body bgcolor=\"$www_bgcolor\" text=\"$www_fgcolor\"><tt>"
close $fh
}
bind dcc n wwwlive init
<spell> [12:16] Tcl error [www_mode]: called "www_mode" with too many arguments
only joins topics and pubms works
nothing else...
where is the error