simple script:
Code: Select all
bind pub - !do do_proc
proc do_proc {unick uhost uhand uchan uarg} {
namespace eval $unick {
set nickname [lindex [split [namespace current] ":"] 2]
set letters {a b c d e f g}
foreach letter [split $letters] {
putquick "PRIVMSG $nickname :$letter"
}
}
}
When user1 type !do script is writing letters, yeah that's okey.
Now, after 2 seconds user2 is typing !do too and the problem begins..
user1, pm:
Code: Select all
a
b
c
d
e
f
g
Code: Select all
d
e
f
g
a
b
c
How to make this to work?
I mean how to make this to "parallel"...
If i tried without "foreach", just some simple incr var 1 inside namespace, it was good.
I could make !do on first and second user and all were good, numbers were ok for both of them.
I don't know why its not working with foreach/for.
Thanks!
P.S
Sorry for my bad english.