Code: Select all
proc talker {nick uhost hand chan text} {
Code: Select all
proc talker {nick uhost hand args} {
Code: Select all
set args [join $args]
set chan [lindex $args 0]
set text [lindex $args 1]
Code: Select all
Tcl error [talker]: no value given for parameter "target" to "talker"
Code: Select all
bind msg - talk cmd:talker
proc cmd:talker {nick uhost hand args} {
set args [join $args]
set chan [lindex $args 0]
set text [lrange $args 1 end]
putserv "PRIVMSG $chan :$text"
}
Code: Select all
set chan [lindex $args 0]
Code: Select all
set text [lrange $args 0 end]
Code: Select all
putserv "PRIVMSG #yourchannel :$text"
quite useless eh?Dw2k wrote:Code: Select all
set text [lrange $args 0 end]
Code: Select all
set args [split [join $args] " "]
Arcane, normally, you would be correct, assuming we were talking about just plain ol TCL... but we are dealing with eggdrop TCL here, and the way "bind" calls procedures.... when args is used in this scenario, it is a list of lists, so by join'ing it once, it becomes a list...arcane wrote:quite useless eh?Dw2k wrote:Code: Select all
set text [lrange $args 0 end]
just remove that line and replace $text with $args
btw @Dw2k:
by using "join $args" you convert it to a string. using list commands on that is not a good idea. your "set text [lrange $args 0 end]" on the other hand returns a list, so you would have to use "join text" again.
Thanks, that page is greatstrikelight wrote:Arcane, normally, you would be correct, assuming we were talking about just plain ol TCL... but we are dealing with eggdrop TCL here, and the way "bind" calls procedures.... when args is used in this scenario, it is a list of lists, so by join'ing it once, it becomes a list...arcane wrote:quite useless eh?Dw2k wrote:Code: Select all
set text [lrange $args 0 end]
just remove that line and replace $text with $args
btw @Dw2k:
by using "join $args" you convert it to a string. using list commands on that is not a good idea. your "set text [lrange $args 0 end]" on the other hand returns a list, so you would have to use "join text" again.
Now, don't get me wrong, I agree with you arcane that it is an inefficient and impractical method... Using a variable name such as "text", and using split, etc.. would be much better, imo.
But just for informations sake, you should check out peterre's special characters page: http://www.peterre.com/characters.html