Here's the script:
Code: Select all
set channels "#chan1 #chan2 #chan3"
set messages "msg1 msg2 msg3"
foreach message $messages {
foreach channel $channels {
after 10000 {
puts "PRIVMSG $message $channel ([clock format [clock seconds] -format %H:%M:%S])"
set ::pleasewait 1
}
vwait ::pleasewait
}
}
Code: Select all
PRIVMSG msg1 #chan1 (11:55:44)
PRIVMSG msg1 #chan2 (11:55:54)
PRIVMSG msg1 #chan3 (11:56:04)
PRIVMSG msg2 #chan1 (11:56:14)
PRIVMSG msg2 #chan2 (11:56:24)
PRIVMSG msg2 #chan3 (11:56:34)
PRIVMSG msg3 #chan1 (11:56:44)
PRIVMSG msg3 #chan2 (11:56:54)
PRIVMSG msg3 #chan3 (11:57:04)
I'm trying it with this code:
Code: Select all
set channels "#chan1 #chan2 #chan3"
set messages "msg1 msg2 msg3"
proc sendmsg {} {
global channels messages
foreach message $messages {
foreach channel $channels {
after 10000 {
puts "PRIVMSG $message $channel ([clock format [clock seconds] -format %H:%M:%S])"
set ::pleasewait 1
}
vwait ::pleasewait
}
}
}
::sendmsg
Code: Select all
can't read "message": no such variable
while executing
"puts "PRIVMSG $message $channel ([clock format [clock seconds] -format %H:%M:%S])""
("after" script)
[12:41] Tcl error in file 'coixi.conf':
[12:41] can't wait for variable "::pleasewait": would wait forever
while executing
"vwait ::pleasewait"
(procedure "::sendmsg" line 13)
invoked from within
"::sendmsg"
(file "scripts/sendmsg.tcl" line 24)
invoked from within
"source scripts/sendmsg.tcl"
(file "coixi.conf" line 1343)
[12:41] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)
If someone could solve or help with this problem, i'd be happyhappyhappy
