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.

ChanServ guard procedure

Old posts that have not been replied to for several years.
Locked
s
stammer
Voice
Posts: 31
Joined: Mon Mar 10, 2003 9:39 am
Location: Bulgaria

ChanServ guard procedure

Post by stammer »

hi all,
my question is:
when i use utimer commnad in procedure for example

utimer 20 [putlog "test"]

only execution of putlog is delayed with 20 seconds or procedure stops for that time and continues after that?
is utimer works for commands like 'foreach' and 'if'?

i'm asking this because i write a procedure for calling ChanServ after netsplit. I want to delay 'foreach' with couple of seconds because somethimes ChanServ returns sometimes not. Here is code:

Code: Select all

bind raw  - NOTICE pub:sident

proc pub:sident {from keyword arg} {
	global nsnick csnick passwd nsserv csserv
	
	set wrd [lindex $arg 1] 
	if {((($from==$nsserv)&&($wrd==":This"))||(($from==$csserv)&&($wrd==":Password")))} { 
		putserv "PRIVMSG $nsnick :IDENTIFY $passwd"
		putlog  "$nsnick IDENTIFY..."

		foreach ch [channels] {
			if {([botisop $ch])&&((![onchan $csnick $ch])||([onchansplit $csnick $ch]))} {
				putserv "PRIVMSG $csnick :SET $ch GUARD ON"
				putlog "$csnick $ch GUARD ON..."	
			}
		}
	}
}
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

utimer <seconds> <tcl-command>
Description: executes the given Tcl command after a certain number of
seconds have passed
this is non-blocking, meaning.. no it will not freeze the procedure

to fix this in your proc, just put the forach in a proc and call that proc with the utimer
Elen sila lúmenn' omentielvo
s
stammer
Voice
Posts: 31
Joined: Mon Mar 10, 2003 9:39 am
Location: Bulgaria

Post by stammer »

10x a lot :) for the help
Locked