bind pub - !parse parse:string
proc parse:string {nick uhost hand chan text} {
set string "a :: b :: c :: d ::"
set out [lrange [join [split $string ::]] 2 end]
putserv "PRIVMSG $chan :$out"
}
PS: you cannot split on "::", the interpreter will threat it like ":", but because the empty elements are merged together with join again it won't bother as long USERNAME doesn't contain a ":".
bind pub - !parse parse:string
proc parse:string {nick uhost hand chan text} {
set string "a:b :: b :: c :: d ::"
foreach s $string {
if ![string match :: $s] {lappend out $s}
}
putserv "PRIVMSG $chan :[lrange $out 2 e]"
# use this one if you want to keep the :: as a seperator
# putserv "PRIVMSG $chan :[join [lrange $out 2 e] { :: }]"
}
bind pub - !parse parse:string
proc parse:string {nick uhost hand chan text} {
set string "a:b :: b :: c :: d ::"
set type 0
foreach s $string {
if ![string match :: $s] {
if !$type {
lappend out \00302$s
set type 1
} {
lappend out \00304$s
set type 0
}
}
}
putserv "PRIVMSG $chan :[join [lrange $out 2 e] { :: }]"
}
bind pub - !parse parse:string
proc parse:string {nick uhost hand chan text} {
set string "a:b :: b :: c :: d ::"
set string [string map {"::" "~"} $string]
set type 0
foreach s [split $string ~] {
if !$type {
lappend out \00302$s
set type 1
} {
lappend out \00304$s
set type 0
}
}
putserv "PRIVMSG $chan :[join [lrange $out 0 e] { :: }]"
}
Edit: fixed typo, thanks Sir_Fz !
Last edited by greenbear on Fri May 06, 2005 6:56 pm, edited 2 times in total.