variables and functions are not reconized, .. if i eval the script waits untill the thread is finished obviously this isn't what it is supposed to do.
basicly variables and functions don't work in this case putserv & $chan.
Code: Select all
package require Thread
set TID1 [thread::create]
set TID2 [thread::create]
proc test_proc {nick host hand chan arg} {
global TID1
thread::send -async $TID1 {
after 10000
::putserv "PRIVMSG $chan:DELAY 10 seconds"
}
putserv "PRIVMSG $chan :Sended to thread with after"
}
proc test_proc2 {nick host hand chan arg} {
global TID2
thread::send -async $TID2 {
::putserv "PRIVMSG $chan :NO DELAY"
}
putserv "PRIVMSG $chan : Sended to thread without after"
}
bind pub -|- !test test_proc
bind pub -|- !test2 test_proc2