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.

problem with timer

Old posts that have not been replied to for several years.
Locked
M
Majesticc

Post by Majesticc »

Hello,
I have an timer that doesnt want work it only run once but i want to repeat the call all 10 seconds here my tcl script:

Code: Select all

set our_chan "#channel"
bind pub - engage status
proc status {nick uhost hand chan text} {
	utimer 10 [
	global our_chan  
	putserv "privmsg $our_chan :TOPIC DISPLAYER LOADED READY FOR TOPICS"
	if [catch {open /usr/local/httpd/cgi-bin/majesticc/data r+} datafile ] {
		putserv "privmsg $our_chan : sorry my data file dont work: $datafile"
	}
	
	#putserv "privmsg $chan :[split [read $datafile] "n"]"  
	foreach line [split [read $datafile] n] {
		#putserv "privmsg $our_chan :$line"
		foreach col [split $line {;;}] {
			if {$col != ""} { 
			putserv "privmsg $our_chan :$col"
			}	
		}
		
	}
	#putserv "privmsg $our_chan :" 
	close $datafile
	if [catch {open /usr/local/httpd/cgi-bin/majesticc/data w+} datafile ] {
		putserv "privmsg $our_chan : sorry my data file dont work: $datafile"
	}	
	close $datafile	
	]
}
greets
Majesticc
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

The timer command doesn't do repeats, it only waits so many second then calls the commands specified in the timer command.

Ya have to setup the timer again at this point if you wish for it to repeat.

You will need to make check to see if an existing timer is running, you will also need to make sure it only does it 10 times.
W
Wcc
Master
Posts: 278
Joined: Sun Oct 28, 2001 8:00 pm
Location: USA
Contact:

Post by Wcc »

Eggdrop 1.8 will support repeating timers. :smile:
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Note to users that wish to know about all these wonderful features eggdrop will have added in 1.8 (will have to see on the version number).

This version is a long way off, and things could change, again and again. So there is no ppint in making scripts compatible.
Locked