This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

too many arguments in wwwlive

Old posts that have not been replied to for several years.
Locked
V
Vizor

too many arguments in wwwlive

Post by Vizor »

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] #naselo: mode change '+o Vizor' by CS!ChanServ@UniBG.services
<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
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

Code: Select all

proc www_mode {nick host hand chan mc} {
should be:

Code: Select all

proc www_mode {nick host hand chan mc victim} {
Elen sila lúmenn' omentielvo
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

The in effect this does the job, it will change the output given by the script.

Instead of saying "*** Mode change +o BLAH by BLAH on BLAH", the simple change made, will make it "*** Mode change +o by BLAH on BLAH".

To restore original functionality, instead of

Code: Select all

proc www_mode {nick host hand chan mc} { 
global www_channel
use

Code: Select all

proc www_mode {nick host hand chan mc victim} { 
global www_channel
set mc "$mc $victim"
V
Vizor

one more problem

Post by Vizor »

<spell> [16:46] Tcl error [www_part]: called "www_part" with too many arguments

how can i repair this error
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

I suggest u take a look in the tcl-commands.doc in the /doc dir on your eggdrop... look at the different bind-commands
Elen sila lúmenn' omentielvo
Locked