| View previous topic :: View next topic |
| Author |
Message |
ultralord Master

Joined: 06 Nov 2006 Posts: 255
|
Posted: Sun Nov 18, 2007 8:39 pm Post subject: Vote for rehash |
|
|
| Hello how i can make one script.. and when 3 users type !vote in query of bot then bot will be rehashed.. if only 1-2 press !vote after 5 minites votes will be delete.. and when votes is 3 then bot rehashed.. can some know how i can make it? |
|
| Back to top |
|
 |
ultralord Master

Joined: 06 Nov 2006 Posts: 255
|
Posted: Thu Nov 22, 2007 2:12 pm Post subject: |
|
|
| anyone can help me with that? |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Thu Nov 22, 2007 10:02 pm Post subject: |
|
|
| quit bumping..obviously no one wants to bother. It's time you start learning tcl for yourself. |
|
| Back to top |
|
 |
tueb Halfop
Joined: 04 Oct 2007 Posts: 76 Location: #quiz.de @ irc.gamesurge.net
|
Posted: Fri Nov 23, 2007 7:34 am Post subject: |
|
|
hi,
i haven't tested this:
| Code: | bind pub - !rehash bot_rehash
#seconds until voting ends
variable utime 300
variable rehashcount 0
variable rehasher ""
variable rehashchan ""
proc bot_rehash {nick host handle channel text} {
global rehashcount rehasher rehashchan utime
if {[lsearch -exact $rehasher $host] != -1} {
puthelp "NOTICE $nick :You already voted!"
return
} else {
lappend rehasher $host
}
if {$rehashcount==0} {
utimer $utime timer_rehash
}
incr rehashcount
set rehashchan $channel
if {$rehashcount > 2} {
timer_rehash
}
}
proc timer_rehash {} {
global rehashcount rehashchan rehasher botnick
if {$rehashcount > 2} {
puthelp "PRIVMSG $rehashchan :\002$botnick will be rehashed.\002"
rehash
}
set rehashcount 0
set rehasher ""
} |
i overread the query-part. if it's important, i'll fix it. |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Fri Nov 23, 2007 11:37 am Post subject: |
|
|
Try
| Code: | bind msg - !vote vote:rehash
proc vote:rehash {nick uhost hand arg} {
if {[throttled vote 300] == 3} {
putlog "Rehashing after 3 rehash votes..."
set ::throttled(vote) 0
rehash
}
}
# user's throttled procedure with slight modification
proc throttled {id time} {
global throttled
if {[info exists throttled($id)]} {
incr throttled($id)
} {
set throttled($id) 1
utimer $time [list unset throttled($id)]
}
return $throttled($id)
} |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
ultralord Master

Joined: 06 Nov 2006 Posts: 255
|
Posted: Sat Nov 24, 2007 5:09 pm Post subject: |
|
|
nice job thnx is working...  |
|
| Back to top |
|
 |
halloaizq Voice
Joined: 27 Aug 2007 Posts: 24
|
Posted: Mon Dec 03, 2007 2:22 am Post subject: |
|
|
Hi... can someone help me how to auto rehash my eggdrop every 'x' minutes??example for every 5 minutes .. tq _________________ : halloaizq : |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Mon Dec 03, 2007 2:26 am Post subject: |
|
|
A simple forum search reveals all.
Auto rehash and auot restart _________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
halloaizq Voice
Joined: 27 Aug 2007 Posts: 24
|
Posted: Mon Dec 03, 2007 2:36 am Post subject: |
|
|
Tq bro ..  _________________ : halloaizq : |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Mon Dec 03, 2007 6:16 am Post subject: |
|
|
| halloaizq wrote: | Tq bro ..  |
No problem.  _________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
halloaizq Voice
Joined: 27 Aug 2007 Posts: 24
|
Posted: Thu Dec 06, 2007 4:40 am Post subject: |
|
|
ok bro ... my eggy now rehash every x minutes .. the problem now ... sometime my eggy rehash every minutes... so any idea what going on?also .. izit ok to my eggy or shell account?? _________________ : halloaizq : |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Thu Dec 06, 2007 3:55 pm Post subject: |
|
|
Could be because the time setting changed on your Eggdrop's machine. As to whether it's OK to rehash every x minutes, usually if a rehash is not needed then it's not recommended. Why do you want to rehash every 5 minutes? _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
|