| |
| |
| |
|
Comments:
<0> hms, set nickz [lsearch -regexp $nicklist "(.*)path(.*)"] gives nickz value 1, anyone understanding how to force it to set the match? <1> ;set nickz "nick1 nick2";foreach i [split $nickz] { set match [lsearch $i "nick1"]};puts "[lindex $nickz $match]" <1> like that ? <1> ;puts "test" <2> anc: #325 (stdout) test <1> ;set nickz "nick1 nick2"
<2> anc: #326 (150 clicks) Tcl: nick1 nick2 <0> anc, hold your horses <1> k <1> foreach i [split $nickz] { set match [lsearch $i "nick1"]} <1> ;foreach i [split $nickz] { set match [lsearch $i "nick1"]} <2> anc: #330 (356 clicks) Tcl: <1> ;puts $match <2> anc: #331 (stdout) -1 <1> ah no dont use foreach <1> damn im still drunk from last nite :< <0> I have a var containing some nicks separated by a space. This list is not updated and match the nicks in the channel. So I have to match the nicks in the var with the nicks in the channel, just in case someone have changed nick. <0> before I tell the code to dostuff with that nick. <1> making a pickup script :) <0> the thing is, I'd most likely want to use regexp to catch any nicks who changed to nick_ or nick- _nick etc <0> so in one hand: a var with nicks (not updated) and in the other hand: a freash list with nicks. <0> match unupdated to fit updated :) <0> how would such a script work? <0> "pickup script" <1> if {[lsearch -exact $nicklist $nick] != -1} { change nick using lreplace } } <1> just do it like that ?
<1> dont know how to do it with regexp <0> yeanor do I. <0> :( <1> why would you use it anyway <1> this is just as fast <0> well'll check out lreplace then, thanks mate! <1> np <0> can't even type anymore :( <1> set newnicklist [lreplace $nicklist [lsearch -exact $nicklist $nick] [lsearch -exact $nicklist $nick] $updatednick] <0> awesome, hey $nick is the nick from the foreach nick [chanlist $channel] { ... loop, right? <3> [PASTE] prkle just pasted code at http://paste.anbcs.com/4126 (hmmm) <0> I have not fixed the lsearch part yet. <0> but this is what the proc looks like. <0> the var holding every nick (unupdated nicks) isn't included in this one tho. <4> append nicklist "$nick "? <3> append -> http://www.tcl.tk/man/tcl8.4/TclCmd/append.htm <4> append nicklist "$nick"? <3> append -> http://www.tcl.tk/man/tcl8.4/TclCmd/append.htm <4> append nicklist "$nick" <4> $nickz? <3> [PASTE] prkle just pasted code at http://paste.anbcs.com/4128 (info..) <0> I did som ecomments
Return to
#tcl or Go to some related
logs:
myspace.com/mogi
legion of doom lindros leclair renberg #microsoft how to use eggdrop on multiple networks? #beginner #hardware van meer belanger powerball #networking #winxp #winvista
|
|