I get this error:
Code: Select all
Tcl error [pub:delgreet]: extra characters after close-quote
Code: Select all
proc pub:delgreet { nick uhost handle channel arguments } {
set greetdb "scripts/charlie.tcl/greet.db"
list arguments $arguments
set greetnick [lindex $arguments 0]
set greetchannel [lindex $arguments 1]
set searchString "$greetchannel $greetnick"
set greetChannel [open $greetdb "r"]
set greetData [read $greetChannel]
close $greetChannel
set greetData [split $greetData "\n"]
if {($greetchannel == "ALL")} {
set greetIndex [lsearch -all $greetData *$greetnick*]
foreach { greets } $greetIndex {
set greetData [lreplace $greetData $greetIndex $greetIndex]
}
putquick "NOTICE $nick :All greets for $greetnick has been removed."
} elseif {([string index $greetchannel 0]=="#")} {
set greetIndex [lsearch $greetData $searchString*]
set greetData [lreplace $greetData $greetIndex $greetIndex]
putquick "NOTICE $nick :Greeting for $greetnick has been removed from channel $greetchan."
} elseif {([string range $greetchannel 0 2]=="all")} {
set greetIndex [lsearch $greetData $searchString*]
set greetData [lreplace $greetData $greetIndex $greetIndex]
putquick "NOTICE $nick :Greeting for $greetnick has been removed from the "all" block."
} else {
putquick "NOTICE $nick :Missing parameter! \026!chelp !delgreet\026 for more info."
return
}
set greetChannel [open $greetdb "w"]
set greetData [join $greetData "\n"]
puts -nonewline $greetChannel "$greetData\n"
close $greetChannel
}