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.

Auto Rehash

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
O
ORATEGOD
Voice
Posts: 39
Joined: Mon Jun 08, 2020 5:50 pm

Auto Rehash

Post by ORATEGOD »

Code: Select all

proc rehash { } {
	global chanlist

	foreach channel [array names chanlist] { 
	putquick "PRIVMSG $channel :Ejecutando Rehash Automatico" 
	}

	rehash 
}
settimer rehash 3600 rehash

I found this TCL but I can't get it to work, I hope someone can help me.


Thank you so much !
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

My first thought is that you are replacing the built in Eggdrop rehash command with one of your own that no longer rehashes the bot at all:)

...and settimer is not an eggdrop tcl command I'm aware of.
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
User avatar
Fire-Fox
Master
Posts: 289
Joined: Sat Sep 23, 2006 9:01 pm
Location: /dev/null

Post by Fire-Fox »

I thing you neeed

Code: Select all

utimer

Code: Select all

utimer <seconds> <tcl-command> [count [timerName]]
Description: executes the given Tcl command after a certain number of seconds have passed. If count is specified, the command will be executed count times with the given interval in between. If you specify a count of 0, the utimer will repeat until it’s removed with killutimer or until the bot is restarted. If timerName is specified, it will become the unique identifier for the timer. If timerName is not specified, Eggdrop will assign a timerName in the format of “timer<integer>”.

Returns: a timerName

Module: core
GreatZ
Fire-Fox | Denmark

Scripts: Relay | Store Text | TvMaze
User avatar
CrazyCat
Revered One
Posts: 1251
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

Don't touch the rehash native function, bind the pre-rehash

Code: Select all

bind evnt - prerehash nrehash
proc nrehash {type} {
   foreach channel [array names chanlist] {
      putquick "PRIVMSG $channel :Ejecutando Rehash Automatico"
   }
}
utimer 3600 rehash 0
Post Reply