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.

Contdown: Topic and Command

Old posts that have not been replied to for several years.
Locked
F
FuE-
Halfop
Posts: 57
Joined: Sat Nov 27, 2004 3:46 pm

Contdown: Topic and Command

Post by FuE- »

Hi, i wonder if i could get some help asusal.....
If i write !Summer the bot will say its x Week x Days x Hours x Min to 9th Juny....
And every new day 00:00:01 the bot will channge topic to Summer: Its 59 Days to summer.... I hope you could understand....
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

Code: Select all

set summer "June 9 00:00:00 2005"

bind pub -|- !summer pub:summer
bind time - "00 00 * * *" topic:summer

setudef flag summer

proc pub:summer {nick uhost hand chan text} {
 if ![channel get $chan summer] return
 set usummer [clock scan $::summer]
 set sleft [expr $usummer-[clock seconds]]
 putserv "PRIVMSG $chan :There are [duration $sleft] days left until summer."
}

proc topic:summer {min hour day month year} {
 set usummer [clock scan $::summer]
 set dleft [expr ($usummer-[clock seconds])/86400]
 foreach c [channels] {
   if {[channel get $c summer]} {
     putserv "TOPIC $c :Summer: There are $dleft days left until summer."
   }
 }
}
Set the channels you want it active in to +summer
.chanset #channel +summer
*Edit* Fixed a typo.
Last edited by greenbear on Sun Mar 06, 2005 7:07 pm, edited 1 time in total.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

gb wrote:

Code: Select all

bind time - "00 * 00 * *" topic:summer
I guess this should be

Code: Select all

bind time - "00 % 00 *" topic:summer
since * matches all words and spaces.
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

Sir_Fz wrote:since * matches all words and spaces.
No, with bind time it simply mean that it can be any day month year, whatever field it is that's set to *... So the * is correct.
Think crontab.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Well, after your edit it makes sense to me. And it can also be "00 00 *".
F
FuE-
Halfop
Posts: 57
Joined: Sat Nov 27, 2004 3:46 pm

Post by FuE- »

tnx
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

np
Locked