| View previous topic :: View next topic |
| Author |
Message |
arfer Master

Joined: 26 Nov 2004 Posts: 436 Location: Manchester, UK
|
Posted: Sat Jan 28, 2006 8:10 pm Post subject: help with syntax of timer/utimer |
|
|
I am using a JOIN bind to initiate a scan of the users in a specific IRC channel when it is the bot itself that joins the channel. However, the bot has not had chance to update [chanlist $chan] which returns botnick only, irrespective of who else is on the channel. So I wish to use a utimer to allow the bot time to update the channel list before attempting a scan.
The proc npScan requiring a single argument $chan is called to execute the scan.
utimer 10 [npScan $chan] ... works but executes the scan immediately rather than after the expected 10 seconds ... so only the botnick is in the channel list
utimer 10 [list npScan $chan] ... gives a tcl error in script for 'timerXX' - invalid command name npScan
utimer 10 {npScan $chan} ... gives a tcl error in script for 'timerXX' - can't read "chan"; no such variable
I can only assume that calling a proc rather than invoking a recognised tcl command in the utimer statement is the cause of the problem. I can't find the correct syntax (assuming it's possible). Any help would be appreciated. |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Sat Jan 28, 2006 8:34 pm Post subject: |
|
|
that should not be done by timer - you never know how long it would take to resync after join - typically it's about 2-3 secs, but it might be 5, 10 or more; generally, nothing bound to irc dynamics should be done by timer - irc is event-driven system, and timers in eggdrop really do have very few sane uses
instead, bind to raw 315 (End of /WHO List) - upon entering a channel, eggdrop issues WHO #chan command and subsequently receiving 315 means resync has been completed and the bot now has its [chanlist] properly constructed _________________ connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|