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 and auot restart

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
s
starpossen
Op
Posts: 139
Joined: Tue Jan 10, 2006 1:08 am

Auto rehash and auot restart

Post by starpossen »

What I wish for, is a script that let's you add an auto rehash and/or auto restart, like this, I would set the timer to 24Hours and the the bot would rehash and make a channel message about it, would this be possible?
t
tessa1
Halfop
Posts: 49
Joined: Mon Apr 18, 2005 12:51 pm
Location: Germany

Post by tessa1 »

Code: Select all

set rchan "#yourchannelname"

timer 720 make_a_rehash

proc make_a_rehash {} {
      rehash
      putquick "PRIVMSG $rchan :Scripts are rehashed..."
      timer 720 make_a_rehash
      }
      if {[timerexists make_a_rehash]!=""} { killtimer [timerexists make_a_rehash] }
      timer 720 make_a_rehash
If you wish a restart, replace rehash with restart

Best regards
s
starpossen
Op
Posts: 139
Joined: Tue Jan 10, 2006 1:08 am

Post by starpossen »

Thanks alot, by the way, the 720 that's in minuttes right? sorry me asking but it's getting late here hehe..
*EDIT*
I can see it's rehashing but im getting this error when watching in dcc chat:

Code: Select all

[23:18] Rehashing...
[23:18] Tcl error in script for 'timer14':
[23:18] can't read "rchan": no such variable
It wont message the channel.
t
tessa1
Halfop
Posts: 49
Joined: Mon Apr 18, 2005 12:51 pm
Location: Germany

Post by tessa1 »

Yes... 720 is in Minutes = 12h - You should replace it with 1440 ;)

EDIT:

Code: Select all

set rchan "#yourchannelname"

timer 720 make_a_rehash

proc make_a_rehash {} {
      rehash
      putquick "PRIVMSG $::rchan :Scripts are rehashed..."
      timer 720 make_a_rehash
      }
      if {[timerexists make_a_rehash]!=""} { killtimer [timerexists make_a_rehash] }
      timer 720 make_a_rehash
Best regards
s
starpossen
Op
Posts: 139
Joined: Tue Jan 10, 2006 1:08 am

Post by starpossen »

That did the trick, thanks again, hwo would I be able to use it in 2 channels?
t
tessa1
Halfop
Posts: 49
Joined: Mon Apr 18, 2005 12:51 pm
Location: Germany

Post by tessa1 »

Set a Second Channel

Code: Select all

set rchan "#yourchannelname"
set secondchan "#secondchannelname"

timer 720 make_a_rehash

proc make_a_rehash {} {
      rehash
      putquick "PRIVMSG $::rchan :Scripts are rehashed..."
      putquick "PRIVMSG $::secondchan :Scripts are rehashed..."
      timer 720 make_a_rehash
      }
      if {[timerexists make_a_rehash]!=""} { killtimer [timerexists make_a_rehash] }
      timer 720 make_a_rehash
s
starpossen
Op
Posts: 139
Joined: Tue Jan 10, 2006 1:08 am

Post by starpossen »

And thank you once again, I will continue reading them doc's etc.
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

or

Code: Select all

set rchan "#yourchannelname,#secondchannelname"
if IRC server supports/allows it
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
s
starpossen
Op
Posts: 139
Joined: Tue Jan 10, 2006 1:08 am

Post by starpossen »

Both ways works, thanks to you both.

/me goes back to studying scripting.
s
starpossen
Op
Posts: 139
Joined: Tue Jan 10, 2006 1:08 am

Post by starpossen »

Hmm.. I dont know why, but i repeats it self:

Code: Select all

[07:54:01] <%RadioBot> Rehashing makes me feel soo good...
[08:04:01] <%RadioBot> Rehashing makes me feel soo good...
[08:04:01] <%RadioBot> Rehashing makes me feel soo good...
I Tested it with 10minuttes as interval, but hmm what could cause this?
h
halloaizq
Voice
Posts: 24
Joined: Mon Aug 27, 2007 5:01 am
Contact:

Post by halloaizq »

if i set like this ..

timer 5 make_a_rehash <-- rehash for every 5 minutes ..

this msg will appear in eggy but did not advertise in channel ..

Tcl error in script for 'timer247006':
can't read "rchan": no such variable <-- channel set already

but eggy still rehash for every 5 minutes ..
: halloaizq :
B
BrewMaster
Voice
Posts: 34
Joined: Sat Jul 07, 2007 8:26 am

Post by BrewMaster »

If I wanted to modify this script so that only the channel ops see the msg about the rehash would i do it like this?

Code: Select all

putquick "PRIVMSG @$::rchan :Scripts are rehashed..." 
nice script!!

Thanks,
brew
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

foreach n [chanlist $::rchan] {
 if {[isop $n $::rchan]} {
  puthelp "PRIVMSG $n :Scripts are rehashed..."
 }
}
Post Reply