This doesn't work, for the reasons stated.
Eggdrop Tcl scripts, are not background tasks, or at least not in the Tcl scope of background tasks.
vwait is designed to block the main loop, until the data required to continue is processed. The problem with eggdrop, the the RAW bind won't be triggered until the main lopp has cycled at least once.
You will have to store any data that is needed to send information elewhere, in global memory. Once you have any RAW retuened data needed, you can use this stored information to forward other details on.
IE, it's the reverse of what you are currently using.
Instead of freezing the current proc until you have the data needed. You freeze the data needed (store it in a variable) and use it once you have the rest of the info.
Here is a fake example.
Code: Select all
bind pub - "!test" tester1
proc tester1 {nick uh hand chan arg} {
global SendTo
set SendTo [lindex [split $arg] 0]
putserv "COMMAND [lindex [split $arg] 1]"
}
bind RAW - "123" raw:test
proc raw:test {fro key arg} {
global SendTo
putserv "PRIVMSG $SendTo: [lindex [split $arg] 0]"
}