Code: Select all
puthelp "PRIVMSG #chan :[lindex $list 0]"
foreach item [lrange $list 1 end] {
puthelp "PRIVMSG nick :$item"
}
Code: Select all
{some text more text}
Code: Select all
some
text
more
text
Yeah, and forrubenmb wrote:That looks nice. Tks for the reply. But how should it be done if some of the results contain more then one argument in the same string:lindex will result in an output of those words like they were diferent results:Code: Select all
{some text more text}
Code: Select all
some text more text
Code: Select all
{"some text" "more text"}
some text
more text
Code: Select all
{some text and more text} {second result text} {and so on}
Code: Select all
[TAG] Result 1: \002some text and more text\002
Code: Select all
## instead of looping around the raw data first
## I separated the first result ($n1) from the rest ($nx)
set n1 [lindex $data 0]
set nx [lrange $data 1 end]
## then i submited the first result to my proc with type=public
my_proc $n1 $needed $variables public
## for the rest of the results, and now yes, i use a foreach loop and type=private
foreach item $nx {
my_proc $item $needed $variables private
}
## then on my proc
proc my_proc { item needed variables type }
set this
set that
bla bla
if {$type == "public"} {
putserv "PRIVMSG $channel :$line"
} else {
putserv "PRIVMSG $nick :$line"}
}