egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[ SOLVED ] Timed rehash

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
whittinghamj
Op


Joined: 21 May 2006
Posts: 103

PostPosted: Tue Mar 06, 2007 8:58 pm    Post subject: [ SOLVED ] Timed rehash Reply with quote

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

here is what i have so fare

Code:

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
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Tue Mar 06, 2007 9:57 pm    Post subject: Reply with quote

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

proc timed:rehash args {
 rehash
}

Quote:
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.

_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
whittinghamj
Op


Joined: 21 May 2006
Posts: 103

PostPosted: Tue Mar 06, 2007 10:33 pm    Post subject: Reply with quote

thank you fz - your da man with da plan who can.
Back to top
View user's profile Send private message
Elfriede
Halfop


Joined: 07 Aug 2007
Posts: 67

PostPosted: Wed Aug 15, 2007 8:25 am    Post subject: Reply with quote

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

Something like: <<Automated Rehash - Done>>

Hopefully someone can tell me Smile
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Wed Aug 15, 2007 10:29 am    Post subject: Reply with quote

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:
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, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
Elfriede
Halfop


Joined: 07 Aug 2007
Posts: 67

PostPosted: Wed Aug 15, 2007 11:49 am    Post subject: Reply with quote

Thanx a lot ! Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber