egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

help with syntax of timer/utimer

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
arfer
Master


Joined: 26 Nov 2004
Posts: 436
Location: Manchester, UK

PostPosted: Sat Jan 28, 2006 8:10 pm    Post subject: help with syntax of timer/utimer Reply with quote

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
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Sat Jan 28, 2006 8:34 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
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


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber