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.

Vote for rehash

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
User avatar
ultralord
Master
Posts: 255
Joined: Mon Nov 06, 2006 6:52 pm

Vote for rehash

Post by ultralord »

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?
User avatar
ultralord
Master
Posts: 255
Joined: Mon Nov 06, 2006 6:52 pm

Post by ultralord »

anyone can help me with that?
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

quit bumping..obviously no one wants to bother. It's time you start learning tcl for yourself.
t
tueb
Halfop
Posts: 76
Joined: Thu Oct 04, 2007 6:09 am
Location: #quiz.de @ irc.gamesurge.net
Contact:

Post by tueb »

hi,

i haven't tested this:

Code: Select all

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.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Try

Code: Select all

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) 
}
User avatar
ultralord
Master
Posts: 255
Joined: Mon Nov 06, 2006 6:52 pm

Post by ultralord »

nice job thnx is working... :D
h
halloaizq
Voice
Posts: 24
Joined: Mon Aug 27, 2007 5:01 am
Contact:

Post by halloaizq »

Hi... can someone help me how to auto rehash my eggdrop every 'x' minutes??example for every 5 minutes .. tq
: halloaizq :
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

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
h
halloaizq
Voice
Posts: 24
Joined: Mon Aug 27, 2007 5:01 am
Contact:

Post by halloaizq »

Tq bro .. :)
: halloaizq :
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

halloaizq wrote:Tq bro .. :)
No problem. :)
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
h
halloaizq
Voice
Posts: 24
Joined: Mon Aug 27, 2007 5:01 am
Contact:

Post by halloaizq »

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 :
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

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?
Post Reply