This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

help with syntax of timer/utimer

Help for those learning Tcl or writing their own scripts.
Post Reply
User avatar
arfer
Master
Posts: 436
Joined: Fri Nov 26, 2004 8:45 pm
Location: Manchester, UK

help with syntax of timer/utimer

Post by arfer »

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.
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

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: Select all

 tag when posting logs, code
Post Reply