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 

Auto rehash and auot restart

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


Joined: 10 Jan 2006
Posts: 139

PostPosted: Tue Mar 28, 2006 2:44 pm    Post subject: Auto rehash and auot restart Reply with quote

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?
Back to top
View user's profile Send private message
tessa1
Halfop


Joined: 18 Apr 2005
Posts: 49
Location: Germany

PostPosted: Tue Mar 28, 2006 4:17 pm    Post subject: Reply with quote

Code:

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
Back to top
View user's profile Send private message
starpossen
Op


Joined: 10 Jan 2006
Posts: 139

PostPosted: Tue Mar 28, 2006 5:20 pm    Post subject: Reply with quote

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:

[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.
Back to top
View user's profile Send private message
tessa1
Halfop


Joined: 18 Apr 2005
Posts: 49
Location: Germany

PostPosted: Tue Mar 28, 2006 6:59 pm    Post subject: Reply with quote

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

EDIT:

Code:

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
Back to top
View user's profile Send private message
starpossen
Op


Joined: 10 Jan 2006
Posts: 139

PostPosted: Tue Mar 28, 2006 7:11 pm    Post subject: Reply with quote

That did the trick, thanks again, hwo would I be able to use it in 2 channels?
Back to top
View user's profile Send private message
tessa1
Halfop


Joined: 18 Apr 2005
Posts: 49
Location: Germany

PostPosted: Tue Mar 28, 2006 7:18 pm    Post subject: Reply with quote

Set a Second Channel

Code:

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
Back to top
View user's profile Send private message
starpossen
Op


Joined: 10 Jan 2006
Posts: 139

PostPosted: Tue Mar 28, 2006 7:28 pm    Post subject: Reply with quote

And thank you once again, I will continue reading them doc's etc.
Back to top
View user's profile Send private message
De Kus
Revered One


Joined: 15 Dec 2002
Posts: 1361
Location: Germany

PostPosted: Tue Mar 28, 2006 8:06 pm    Post subject: Reply with quote

or
Code:
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...
Back to top
View user's profile Send private message MSN Messenger
starpossen
Op


Joined: 10 Jan 2006
Posts: 139

PostPosted: Tue Mar 28, 2006 8:36 pm    Post subject: Reply with quote

Both ways works, thanks to you both.

/me goes back to studying scripting.
Back to top
View user's profile Send private message
starpossen
Op


Joined: 10 Jan 2006
Posts: 139

PostPosted: Tue Apr 04, 2006 2:23 am    Post subject: Reply with quote

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

[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?
Back to top
View user's profile Send private message
halloaizq
Voice


Joined: 27 Aug 2007
Posts: 24

PostPosted: Mon Dec 03, 2007 3:02 am    Post subject: Reply with quote

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 :
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
BrewMaster
Voice


Joined: 07 Jul 2007
Posts: 34

PostPosted: Tue Dec 18, 2007 11:10 pm    Post subject: Reply with quote

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:
putquick "PRIVMSG @$::rchan :Scripts are rehashed..."


nice script!!

Thanks,
brew
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Wed Dec 19, 2007 9:35 am    Post subject: Reply with quote

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

_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
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