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.

[ SOLVED ] Timed rehash

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
w
whittinghamj
Op
Posts: 103
Joined: Sun May 21, 2006 4:50 pm

[ SOLVED ] Timed rehash

Post by whittinghamj »

Hi guys. Just a quickone I cannot get my head around.

here is what i have so fare

Code: Select all

proc timed:rehash { nick uhost hand chan text} {
rehash
}
I am not sure about the bind line to make it run on its own every 30 minutes.

Please could someone help?

Cheers

Quest
Last edited by whittinghamj on Tue Mar 06, 2007 10:34 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 »

Code: Select all

bind time - {00 *} timed:rehash
bind time - {30 *} timed:rehash

proc timed:rehash args {
 rehash
}
TIME (stackable)
bind time <flags> <mask> <proc>
proc-name <minute> <hour> <day> <month> <year>

Description: allows you to schedule procedure calls at certain
times. mask matches 5 space separated integers of the form:
"minute hour day month year". minute, hour, day, month have a
zero padding so they are exactly two characters long; year is
four characters. Flags are ignored.
w
whittinghamj
Op
Posts: 103
Joined: Sun May 21, 2006 4:50 pm

Post by whittinghamj »

thank you fz - your da man with da plan who can.
E
Elfriede
Halfop
Posts: 67
Joined: Tue Aug 07, 2007 4:21 am

Post by Elfriede »

Is ist possible to bind this event with a PRIVMSG on the Channel ?

Something like: <<Automated Rehash - Done>>

Hopefully someone can tell me :)
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Not sure wether you are asking to trigger the rehash using a public message, or simply like a notification about rehash being done in a channel..

Assuming the latter, you could use something like this (with a few bells'n'whistles such as rehash-time):

Code: Select all

bind evnt - rehash postRehash
bind evnt - prerehash preRehash
bind evnt - prerestart preRestart

set ppNotifyChannel "#theChannel"

proc postRehash {evnt} {
 puthelp "PRIVMSG $::ppNotifyChannel :Rehash completed in [expr [clock clicks -milliseconds] - $::ppRehashTime] milliseconds."
}

proc preRehash {evnt} {
 puthelp "PRIVMSG $::ppNotifyChannel :Rehashing..."
 set ::ppRehashTime [clock clicks -milliseconds]
}

proc preRestart {evnt} {
 puthelp "PRIVMSG $::ppNotifyChannel :Restarting, Be right back..."
}
NML_375
E
Elfriede
Halfop
Posts: 67
Joined: Tue Aug 07, 2007 4:21 am

Post by Elfriede »

Thanx a lot ! :)
Post Reply