Tcl error [www_part]: wrong # args: should be "www_part nick host hand channel"
this is the code:
Code: Select all
#############################################################################
# #
# --== Wacko's Web Poster Mod ==-- #
# --== Writen by Wacko ==-- #
# Version 1.9 #
# With Pictures #
# #
# --== TCL is for eggdrop 1.3.18+ ==-- #
# #
#############################################################################
# --== (c) Nutzville 1994 - 1999 ==-- #
# #
# I wrote because all the others sux... and never support multi channel... #
# #
# It is real simple. I wrote it. You use it. And if for some reason it #
# trashes you bot that is your fault because it works.... #
# #
# This script was beta tested for 4 weeks before release... #
# As to microshit this WILL NOT work with win eggies... #
# #
#############################################################################
# #
# Ver 1.5 #
# This version worked but there were things I didn't like... #
# It did the multi channel and moved images and set the menu either from #
# A config file or does a standard one if the file is not there... #
# This version Does the pictures and the whole set... #
# #
# Ver 1.6 #
# This had the added feature of simple mirc color.... #
# But not Back Ground Color.... #
# #
# Ver 1.7 #
# This version supports all the above and full mirc color. also Back Ground #
# #
# Ver 1.8 #
# Add link to ftp and html typed in the channel.... #
# #
# Ver 1.9 #
# Ok the Whois go dropped but now there is a chat ability.. oh well... #
# #
#############################################################################
# --== Delete the next line and edit the config ==-- #
# die "You *must* edit webposter.1.9.tcl for it to work."
#############################################################################
# --== Configure Here ==-- #
#############################################################################
#
# -=> Set the location on the UNIX computer where your www dir is located
# -> Remember the / at the end....
set www_location "/home/ctlife/public_html/wwwlive/"
#
# -=> Number of Lines Before Reloading Clean File
set www_max 75
#
# -=> The IRC Network
set www_network "undernet"
#
# -=> Main Menu HTML (if blank there will be no page)
set menu "menu.html"
#
# -=> Set Color Settings for Web pages
# -> Back Ground Color
set www_bgcolor "White"
#
# -> Back Ground Image (if none leave blank -> "")
set bgimage "images/whites.jpg"
#
# -> Back Ground Properties (if not fixed leave blank -> "")
set bgset "fixed"
#
# -> Text Color
set www_text "Black"
#
# -> Link Color
set lcolor "Navy"
#
# -> Op Color for list
set ocolor "Red"
#
# -> Voice Color for list
set vcolor "Blue"
#
# -> Color For Chat
set cchat "Navy Blue"
#
# -> Color For Join
set cjoin "Dark Yellow"
#
# -> Color For Part
set cpart "Dark Green"
#
# -> Color For Kick
set ckick "Red"
#
# -> Color For Mode
set cmode "Red"
#
# -=> Set the Type of Font
set font "Arial"
#
# -=> Set the Size of Font
set fsize "2"
#
# -=> Enable Pictures ( 0 = off || 1 = on )
# For this to work you must put the Images in the scripts location
# or copy them to the www_location
set pix 1
#
set smile "=) :) 8)"
set frown "=( :( 8("
set talk "=O :O 8O"
#
#############################################################################
# --== If you change it I know it won't work ==-- #
#############################################################################
proc www_pubm {nick uhost hand channel args} {
global www_location www_lines pix smile frown talk cchat font fsize
set chan [string trimleft [string tolower $channel] #]
www_newfile $chan
set text [lindex $args 0]
set text [www_color "$text" "pubm"]
if {$pix == 1} {
foreach img $smile {
set i [lsearch $text $img]
if { $i >= 0 } {set text [lreplace $text $i $i <img src=smile.gif>]}
}
foreach img $frown {
set i [lsearch $text $img]
if { $i >= 0 } {set text [lreplace $text $i $i <img src=frown.gif>]}
}
foreach img $talk {
set i [lsearch $text $img]
if { $i >= 0 } {set text [lreplace $text $i $i <img src=talk.gif>]}
}
}
set www_file ${www_location}${chan}_chat.html
set wc [open $www_file a]
puts $wc "<table cellspacing=0 cellpadding=0 border=0><tr><td><font face=\"$font\" size=\"$fsize\"><b><Font color=\"$cchat\">\<</Font></b>$nick<b><Font color=\"$cchat\">></Font></b> $text</font></td></tr></table>"
close $wc
incr www_lines([string tolower $chan])
}
proc www_action {nick uhost hand dest key args} {
global www_location www_lines pix smile frown talk cchat font fsize botnick
if {$dest != $botnick} {
set chan [string trimleft [string tolower $dest] #]
www_newfile $chan
set text [lindex $args 0]
set text [www_color "$text" "act"]
if {$pix == 1} {
foreach img $smile {
set i [lsearch $text $img]
if { $i >= 0 } {set text [lreplace $text $i $i <img src=smile.gif>]}
}
foreach img $frown {
set i [lsearch $text $img]
if { $i >= 0 } {set text [lreplace $text $i $i <img src=frown.gif>]}
}
foreach img $talk {
set i [lsearch $text $img]
if { $i >= 0 } {set text [lreplace $text $i $i <img src=talk.gif>]}
}
}
set www_file ${www_location}${chan}_chat.html
set wc [open $www_file a]
puts $wc "<table cellspacing=0 cellpadding=0 border=0><tr><td><font face=\"$font\" size=\"$fsize\"><b><Font color=\"Red\">\ \§ </Font>$nick</b> $text</font></td></tr></table>"
close $wc
incr www_lines([string tolower $chan])
}
}
proc www_join {nick host hand channel} {
global www_location www_lines cjoin font fsize botnick
if {[string tolower $nick] == [string tolower $botnick]} {
foreach chan [channels] {
foreach nick [chanlist $chan] {
putserv "WHOIS $nick"
}
}
www_setup
} else {
putserv "WHOIS $nick"
set chan [string trimleft [string tolower $channel] #]
www_newfile $chan
set www_file ${www_location}${chan}_chat.html
set wc [open $www_file a]
puts $wc "<font face=\"$font\" size=\"$fsize\"><b><Font color=\"$cjoin\">-=></Font></b> $nick ($host) has joined $chan</font><br>"
close $wc
www_user $chan
incr www_lines([string tolower $chan])
}
}
proc www_part {nick host hand channel} {
global www_location www_lines cpart font fsize
set chan [string trimleft [string tolower $channel] #]
www_newfile $chan
set www_file ${www_location}${chan}_chat.html
set wc [open $www_file a]
puts $wc "<font face=\"$font\" size=\"$fsize\"><b><Font color=\"$cpart\">-=></Font></b> $nick ($host) has left $chan</font><br>"
close $wc
www_user $chan
incr www_lines([string tolower $chan])
}
proc www_sign {nick host hand channel args} {
global www_location www_lines font fsize
set chan [string trimleft [string tolower $channel] #]
www_newfile $chan
set text [lindex $args 0]
set text [www_color "$text" "sign"]
set www_file ${www_location}${chan}_chat.html
set wc [open $www_file a]
puts $wc "<table cellspacing=0 cellpadding=0 border=0><tr><td><font face=\"$font\" size=\"$fsize\"><b>-=></b> $nick ($host) has quit irc ($text)</font></td></tr></table>"
close $wc
www_user $chan
incr www_lines([string tolower $chan])
}
proc www_topc {nick host hand channel topc} {
global www_location www_lines font fsize
set chan [string trimleft [string tolower $channel] #]
www_newfile $chan
set topc [www_color "$topc" "topc"]
set www_file ${www_location}${chan}_chat.html
set wc [open $www_file a]
puts $wc "<table cellspacing=0 cellpadding=0 border=0><tr><td><font face=\"$font\" size=\"$fsize\"><b>-=></b> $nick has changed the topic on $chan to $topc</font></td></tr></table>"
close $wc
www_title $chan
incr www_lines([string tolower $chan])
}
proc www_mode {nick host hand chan change mc} {www_mode2 $nick $host $hand $chan "$change $mc"}
proc www_mode2 {nick host hand channel mc} {
global www_location www_lines cmode font fsize
set chan [string trimleft [string tolower $channel] #]
www_newfile $chan
set www_file ${www_location}${chan}_chat.html
set wc [open $www_file a]
puts $wc "<font face=\"$font\" size=\"$fsize\"><b><Font color=\"$cmode\">-=></font></b> Mode change $mc on $chan by $nick</font><br>"
close $wc
www_user $chan
incr www_lines([string tolower $chan])
}
proc www_kick {nick host hand channel kn kr} {
global www_location www_lines pix ckick font fsize
set chan [string trimleft [string tolower $channel] #]
www_newfile $chan
set www_file ${www_location}${chan}_chat.html
set wc [open $www_file a]
set kr [www_color "$kr" "kick"]
if {$pix == 1} {
puts $wc "<table cellspacing=0 cellpadding=0 border=0><tr><td><font face=\"$font\" size=\"$fsize\"><img src=kick.gif> $kn has been kicked off $chan by $nick ($kr)</font></td></tr></table>"
} else {
puts $wc "<table cellspacing=0 cellpadding=0 border=0><tr><td><font face=\"$font\" size=\"$fsize\"><b><Font color=\"$ckick\">-=></font></b> $kn has been kicked off $chan by $nick ($kr)</font></td></tr></table>"
}
close $wc
www_user $chan
incr www_lines([string tolower $chan])
}
proc www_nick {nick host hand channel newnick} {
global www_location www_lines font fsize
putserv "WHOIS $newnick"
set chan [string trimleft [string tolower $channel] #]
www_newfile $chan
set www_file ${www_location}${chan}_chat.html
set wc [open $www_file a]
puts $wc "<font face=\"$font\" size=\"$fsize\"><b>-=></b> <b>$nick</b> is now known as <b>$newnick</b></font><br>"
close $wc
www_user $chan
incr www_lines([string tolower $chan])
}
proc www_newfile {chan} {
global www_lines www_location www_max
if {$www_lines([string tolower $chan]) > $www_max} {
www_chat $chan
set www_lines([string tolower $chan]) 0
}
}
proc www_setup {} {
global www_location www_lines menu pix botnick
global bgset bgimage www_bgcolor www_text lcolor www_network
www_init
if {$pix == 1} {move_files}
if {$menu != "" } {www_menu}
foreach channel [channels] {
set chan [string trimleft [string tolower $channel] #]
set www_main ${www_location}${chan}.html
set www_talk ${www_location}${chan}_talk.html
set www_login ${www_location}${chan}_login.html
set www_lines([string tolower $chan]) 0
www_title $chan
www_user $chan
www_chat $chan
set wc [open $www_main w]
puts $wc "<html><head><title>$chan -=- $botnick IRC Moniter -=- Written By Wacko</title>"
puts $wc "<frameset rows=\"60,*\" FRAMEBORDER=0 FRAMESPACING=0 Border=0 marginheight=0 marginwidth=0>"
puts $wc " <frameset cols=\"150,*\" FRAMEBORDER=0 FRAMESPACING=0 Border=0 marginheight=0 marginwidth=0>"
puts $wc " <frame name=\"${chan}_talk\" src=\"${chan}_talk.html\" scrolling=\"no\" marginheight=0 marginwidth=0 noresize>"
puts $wc " <frame name=\"${chan}_title\" src=\"${chan}_title.html\" scrolling=\"no\" marginheight=0 marginwidth=0 noresize>"
puts $wc " </frameset>"
puts $wc " <frameset cols=\"150,*\" FRAMEBORDER=0 FRAMESPACING=0 Border=0 marginheight=0 marginwidth=0>"
puts $wc " <frame name=\"${chan}_user\" src=\"${chan}_user.html\" scrolling=\"auto\" marginheight=0 marginwidth=0 noresize>"
puts $wc " <frame name=\"${chan}_chat\" src=\"${chan}_chat.html\" scrolling=\"auto\" marginheight=0 marginwidth=0 noresize>"
puts $wc " </frameset>"
puts $wc "</frameset>"
close $wc
set wc [open $www_login w]
puts $wc "<html><head><title>$chan -=- $botnick IRC Moniter -=- Written By Wacko</title>"
puts $wc "<script language=\"javascript\">"
puts $wc "function click() {"
puts $wc "if (event.button==2) {"
puts $wc "alert('Web Poster 1.9 -=- By Wacko @ #eggdrop ! undernet.org.')"
puts $wc "}"
puts $wc "}"
puts $wc "document.onmousedown=click"
puts $wc "</script>"
puts $wc "<body bgcolor=\"$www_bgcolor\" text=\"$www_text\" background=\"$bgimage\" bgproperties=\"$bgset\">"
puts $wc "<center><form action=\"http://www.chatsystems.com:8080/${www_network}/signon.html\" method=\"GET\">"
puts $wc "<table border=\"0\">"
puts $wc "<tr><td align=\"right\">Nick Name: </td>"
puts $wc "<td><input name=\"N\" size=\"11\"></td></tr>"
puts $wc "<tr><td align=\"right\">Channel: </td>"
puts $wc "<td><select name=\"C\" size=\"1\"><option>#$chan </option></select></td></tr>"
puts $wc "<tr><td align=\"right\">Refresh Freq: </td>"
puts $wc "<td><select name=\"R\" size=\"1\"><option value=\"0\">Continuous </option><option value=\"5\">5 sec </option><option value=\"10\">10 sec </option><option value=\"15\">15 sec </option><option value=\"30\">30 sec </option></select></td></tr><tr>"
puts $wc "<td align=\"right\">Network: </td>"
puts $wc "<td><select name=\"NET\" size=\"1\"><option>$www_network </option></select></td></tr>"
puts $wc "</table><input type=\"image\" SRC=\"chatnow.gif\" value=\"Chat\"></form>"
close $wc
set wc [open $www_talk w]
puts $wc "<html><head><title>$chan -=- $botnick IRC Moniter -=- Written By Wacko</title>"
puts $wc "<script language=\"javascript\">"
puts $wc "function click() {"
puts $wc "if (event.button==2) {"
puts $wc "alert('Web Poster 1.9 -=- By Wacko @ #eggdrop ! undernet.org.')"
puts $wc "}"
puts $wc "}"
puts $wc "document.onmousedown=click"
puts $wc "</script>"
puts $wc "<body bgcolor=\"$www_bgcolor\" text=\"$www_text\" background=\"$bgimage\" bgproperties=\"$bgset\">"
puts $wc "<center><a href=\"${chan}_login.html\" target=\"${chan}_login\"><img SRC=\"chatnow.gif\" border=0></a>"
close $wc
}
}
proc www_chat {chan} {
global www_location bgset bgimage
global www_bgcolor www_text lcolor
set www_chat ${www_location}${chan}_chat.html
set www_lines([string tolower $chan]) 0
set wc [open $www_chat w]
puts $wc "<html><head><meta http-equiv=refresh content=10; url=${chan}_chat.html></head>"
puts $wc "<script language=\"JavaScript\">"
puts $wc "<!--"
puts $wc "vPos=100000000000;"
puts $wc "function onLast() {"
puts $wc " window.scroll(0,vPos);"
puts $wc "}"
puts $wc "function click() {"
puts $wc "if (event.button==2) {"
puts $wc "alert('Web Poster 1.9 -=- By Wacko @ #eggdrop ! undernet.org.')"
puts $wc "}"
puts $wc "}"
puts $wc "document.onmousedown=click"
puts $wc "</script>"
puts $wc "</script>"
puts $wc "<style type=\"text/css\">"
puts $wc "A:link \{ text-decoration : none; \}"
puts $wc "A:visited \{ text-decoration : none; \}"
puts $wc "A:hover \{ text-decoration : underline overline;\}"
puts $wc "</style>"
puts $wc "<body bgcolor=\"$www_bgcolor\" text=\"$www_text\" background=\"$bgimage\" bgproperties=\"$bgset\" link=\"$lcolor\" vlink=\"$lcolor\" onload=\"if(window.scroll)onLast()\"><tt>"
close $wc
}
proc www_title {chan} {
global www_location bgset bgimage
global www_bgcolor www_text
set www_topc ${www_location}${chan}_title.html
set topc [topic #${chan}]
set topc [www_color "$topc" "title"]
set wc [open $www_topc w]
puts $wc "<html><head><meta http-equiv=refresh content=60; url=${chan}_title.html></head>"
puts $wc "<script language=\"javascript\">"
puts $wc "function click() {"
puts $wc "if (event.button==2) {"
puts $wc "alert('Web Poster 1.9 -=- By Wacko @ #eggdrop ! undernet.org.')"
puts $wc "}"
puts $wc "}"
puts $wc "document.onmousedown=click"
puts $wc "</script>"
puts $wc "<body bgcolor=\"$www_bgcolor\" text=\"$www_text\" background=\"$bgimage\" bgproperties=\"$bgset\">"
puts $wc "<table cellspacing=0 cellpadding=0 border=0><tr><td>$topc</td></tr></table></body>"
close $wc
}
proc www_user {chan} {
global www_location vcolor ocolor font fsize lcolor
global www_bgcolor www_text bgset bgimage
set www_user ${www_location}${chan}_user.html
set www_who ${www_location}${chan}_who.html
set list [lsort -increasing [chanlist #${chan}]]
set wc [open $www_user w]
set wf [open $www_who w]
puts $wc "<html><head><meta http-equiv=refresh content=30; url=${chan}_user.html></head>"
puts $wc "<script language=\"javascript\">"
puts $wc "function click() {"
puts $wc "if (event.button==2) {"
puts $wc "alert('Web Poster 1.9 -=- By Wacko @ #eggdrop ! undernet.org.')"
puts $wc "}"
puts $wc "}"
puts $wc "document.onmousedown=click"
puts $wc "</script>"
puts $wc "<style type=\"text/css\">"
puts $wc "A:link \{ text-decoration : none; \}"
puts $wc "A:visited \{ text-decoration : none; \}"
puts $wc "A:hover \{ text-decoration : underline overline;\}"
puts $wc "</style>"
puts $wc "<body bgcolor=\"$www_bgcolor\" text=\"$www_text\" background=\"$bgimage\" bgproperties=\"$bgset\" link=\"$lcolor\" vlink=\"$lcolor\">"
foreach nick $list {
if {[isop $nick #$chan]} {
puts $wc "<font color=\"$ocolor\" face=\"$font\" size=\"$fsize\">@ ${nick}</font><br>"
}
}
foreach nick $list {
if {![isop $nick #$chan] && [isvoice $nick #$chan]} {
puts $wc "<font color=\"$vcolor\" face=\"$font\" size=\"$fsize\">+ ${nick}</font><br>"
}
}
foreach nick $list {
if {![isop $nick #$chan] && ![isvoice $nick #$chan]} {
puts $wc "<font face=\"$font\" size=\"$fsize\">\ \ ${nick}<br>"
}
}
close $wc
close $wf
}
proc www_menu {} {
global www_location vcolor ocolor menu botnick
global www_bgcolor www_text bgset bgimage font lcolor
set conf ./scripts/menu.conf
set www_menu ${www_location}${menu}
set wc [open $www_menu w]
puts $wc "<html><head><Title>$botnick IRC Moniter -=- Written By Wacko</title></head>"
puts $wc "<script language=\"javascript\">"
puts $wc "function click() {"
puts $wc "if (event.button==2) {"
puts $wc "alert('Web Poster 1.9 -=- By Wacko @ #eggdrop ! undernet.org.')"
puts $wc "}"
puts $wc "}"
puts $wc "document.onmousedown=click"
puts $wc "</script>"
puts $wc "</script>"
puts $wc "<style type=\"text/css\">"
puts $wc "A:link \{ text-decoration : none; \}"
puts $wc "A:visited \{ text-decoration : none; \}"
puts $wc "A:hover \{ text-decoration : underline overline;\}"
puts $wc "</style>"
puts $wc "<body bgcolor=\"$www_bgcolor\" text=\"$www_text\" background=\"$bgimage\" bgproperties=\"$bgset\" link=\"$lcolor\" vlink=\"$lcolor\">"
if {[file exists $conf]} {
set fd [open $conf r]
while {![eof $fd]} {puts $wc "[gets $fd]"}
close $fd
} else {
puts $wc "<CENTER>"
puts $wc "<font face=\"$font\" size=\"5\">Wacko's Web Bot Poster<br>Running on $botnick<br>"
puts $wc "Please choose a channel from below<br></font>"
}
foreach channel [lsort -increasing [channels]] {
set chan [string trimleft [string tolower $channel] #]
puts $wc "<a href=\"${chan}.html\">#${chan}<br>"
}
puts $wc "</body></html>"
close $wc
}
proc move_files {} {
global www_location images
foreach img $images {
set gf ./scripts/$img
set pf ${www_location}${img}
if {[file exists $gf] && ![file exists $pf]} {exec -- mv $gf $pf}
}
}
proc www_init {} {
putlog " -=> Loading... Wacko's Web Poster 1.9 ..."
bind pubm * * www_pubm
bind ctcp - ACTION www_action
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
}
set color_mirc "white black navy green red maroon purple olive yellow lime teal aqua blue fuchsia gray silver"
set images "smile.gif talk.gif frown.gif kick.gif chatnow.gif"
proc www_color {data where} {
global www_location www_lines cmode font fsize color_mirc
if {$where == "title"} {
set size 5 ; set data "<b><font face=$font size=$fsize>${data}"
} else {
set size $fsize
}
set a 15
while {$a > 0} {
set b 15
while {$b > 0} {
regsub -all ${a},${b} $data "</font></td><td bgcolor=[lindex $color_mirc $b]><font face=$font size=$size color=[lindex $color_mirc $a]>" data
incr b -1
}
incr a -1
}
set a 15
while {$a > 0} {
regsub -all ${a} $data "</font><font face=$font size=$size color=[lindex $color_mirc $a]>" data
incr a -1
}
regsub -all $data "" data
regsub -all -- \\\\ $data \\\\\\\\ data ; regsub -all -- \\\[ $data \\\\\[ data ; regsub -all -- \\\] $data \\\\\] data
regsub -all -- \\\} $data \\\\\} data ; regsub -all -- \\\{ $data \\\\\{ data ; regsub -all -- \\\" $data \\\\\" data
set data [split $data " "]
set a [lsearch -regexp [string tolower $data] http://]
set b [lsearch -regexp [string tolower $data] www.]
set c [lsearch -regexp [string tolower $data] ftp://]
set d [lsearch -regexp [string tolower $data] ftp.]
if {$a != -1} {
set site [lindex $data $a]
if {[string trimleft [string tolower $site] http://] != [string tolower $site]} {
set link "<a href=\"$site\" target=\"site\">${site}</a>"
set data [lreplace $data $a $a $link]
}
} elseif {$b != -1} {
set site [lindex $data $b]
if {[string trimleft [string tolower $site] www.] != [string tolower $site]} {
set link "<a href=\"http://${site}\" target=\"site\">${site}</a>"
set data [lreplace $data $b $b $link]
}
} elseif {$c != -1} {
set site [lindex $data $c]
if {[string trimleft [string tolower $site] ftp://] != [string tolower $site]} {
set link "<a href=\"$site\" target=\"site\">${site}</a>"
set data [lreplace $data $c $c $link]
}
} elseif {$d != -1} {
set site [lindex $data $d]
if {[string trimleft [string tolower $site] ftp.] != [string tolower $site]} {
set link "<a href=\"ftp://${site}\" target=\"site\">${site}</a>"
set data [lreplace $data $d $d $link]
}
}
set data [join $data]
return $data
}
www_setup