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.

Cycle every 15 minutes

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
G
GeneticBro
Voice
Posts: 3
Joined: Thu Jan 06, 2011 2:34 am

Cycle every 15 minutes

Post by GeneticBro »

Hello,

How to make bot cycle certain channel every 15 minutes?
User avatar
tomekk
Master
Posts: 255
Joined: Fri Nov 28, 2008 11:35 am
Location: Oswiecim / Poland
Contact:

Post by tomekk »

hmm,

'bind time' or some timer with:

Code: Select all

channel set $chan +inactive                                                               
channel set $chan -inactive 
should do the work
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

If you've got the 1.6.20 version of Eggdrop, then you could use the new "CRON" binding to achieve this:

Code: Select all

bind cron - {*/15 * * * *} cron:cycle

proc cron:cycle {minute hour day month weekday} {
channel set #channel +inactive
channel set #channel -inactive
}
Or if you wish to have it running in multiple channels by simplifying set/unset ('.chanset #channel +croncycle' to activate and '.chanset #channel -croncycle' to deactivate to disable it) a flag to the channel ('croncycle' in this case, but can be changed to whatever you wish as long as isn't used already) info then something like:

Code: Select all

setudef flag croncycle
bind cron - {*/15 * * * *} cron:cycle

proc cron:cycle {minute hour day month weekday} {
	foreach chan [channels] {
		if {![channel get $chan croncycle]} continue
		channel set $chan +inactive
		channel set $chan -inactive
	}
}
Once the game is over, the king and the pawn go back in the same box.
Post Reply