using
after 8000 {putlog "hello"}
Is not advisable
It's far simpler to use the "list" command.
An example of where the {} method would fail, is when you want to pass a variable to the command, once the timer has triggered.
EG
in a eggdrop script
Code: Select all
proc onjoin {nick uh hand chan} {
after 3000 {putlog "$nick join channel 3 seconds ago"}
}
This would work fine, except, if I where to join a channel (with the nickname ppslim) the log file would now have a line looking like
[00:00] $nick join channel 3 seconds ago
instead of desired
[oo:oo] ppslim join channel 3 seconds ago
This is all to do with the way Tcl handles lists.
If you where to let Tcl create the list for you (witht he list command), it would all be fine.
Code: Select all
proc onjoin {nick uh hand chan} {
after 3000 [list putlog "$nick join channel 3 seconds ago"]
}