| View previous topic :: View next topic |
| Author |
Message |
starpossen Op
Joined: 10 Jan 2006 Posts: 139
|
Posted: Tue Mar 28, 2006 2:44 pm Post subject: Auto rehash and auot restart |
|
|
| 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 |
|
 |
tessa1 Halfop
Joined: 18 Apr 2005 Posts: 49 Location: Germany
|
Posted: Tue Mar 28, 2006 4:17 pm Post subject: |
|
|
| 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 |
|
 |
starpossen Op
Joined: 10 Jan 2006 Posts: 139
|
Posted: Tue Mar 28, 2006 5:20 pm Post subject: |
|
|
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 |
|
 |
tessa1 Halfop
Joined: 18 Apr 2005 Posts: 49 Location: Germany
|
Posted: Tue Mar 28, 2006 6:59 pm Post subject: |
|
|
Yes... 720 is in Minutes = 12h - You should replace it with 1440
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 |
|
 |
starpossen Op
Joined: 10 Jan 2006 Posts: 139
|
Posted: Tue Mar 28, 2006 7:11 pm Post subject: |
|
|
| That did the trick, thanks again, hwo would I be able to use it in 2 channels? |
|
| Back to top |
|
 |
tessa1 Halfop
Joined: 18 Apr 2005 Posts: 49 Location: Germany
|
Posted: Tue Mar 28, 2006 7:18 pm Post subject: |
|
|
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 |
|
 |
starpossen Op
Joined: 10 Jan 2006 Posts: 139
|
Posted: Tue Mar 28, 2006 7:28 pm Post subject: |
|
|
| And thank you once again, I will continue reading them doc's etc. |
|
| Back to top |
|
 |
De Kus Revered One

Joined: 15 Dec 2002 Posts: 1361 Location: Germany
|
Posted: Tue Mar 28, 2006 8:06 pm Post subject: |
|
|
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 |
|
 |
starpossen Op
Joined: 10 Jan 2006 Posts: 139
|
Posted: Tue Mar 28, 2006 8:36 pm Post subject: |
|
|
Both ways works, thanks to you both.
/me goes back to studying scripting. |
|
| Back to top |
|
 |
starpossen Op
Joined: 10 Jan 2006 Posts: 139
|
Posted: Tue Apr 04, 2006 2:23 am Post subject: |
|
|
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 |
|
 |
halloaizq Voice
Joined: 27 Aug 2007 Posts: 24
|
Posted: Mon Dec 03, 2007 3:02 am Post subject: |
|
|
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 |
|
 |
BrewMaster Voice
Joined: 07 Jul 2007 Posts: 34
|
Posted: Tue Dec 18, 2007 11:10 pm Post subject: |
|
|
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 |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Wed Dec 19, 2007 9:35 am Post subject: |
|
|
| 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 |
|
 |
|