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 

Vote for rehash

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


Joined: 06 Nov 2006
Posts: 255

PostPosted: Sun Nov 18, 2007 8:39 pm    Post subject: Vote for rehash Reply with quote

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
View user's profile Send private message
ultralord
Master


Joined: 06 Nov 2006
Posts: 255

PostPosted: Thu Nov 22, 2007 2:12 pm    Post subject: Reply with quote

anyone can help me with that?
Back to top
View user's profile Send private message
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Thu Nov 22, 2007 10:02 pm    Post subject: Reply with quote

quit bumping..obviously no one wants to bother. It's time you start learning tcl for yourself.
Back to top
View user's profile Send private message
tueb
Halfop


Joined: 04 Oct 2007
Posts: 76
Location: #quiz.de @ irc.gamesurge.net

PostPosted: Fri Nov 23, 2007 7:34 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Fri Nov 23, 2007 11:37 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
ultralord
Master


Joined: 06 Nov 2006
Posts: 255

PostPosted: Sat Nov 24, 2007 5:09 pm    Post subject: Reply with quote

nice job thnx is working... Very Happy
Back to top
View user's profile Send private message
halloaizq
Voice


Joined: 27 Aug 2007
Posts: 24

PostPosted: Mon Dec 03, 2007 2:22 am    Post subject: Reply with quote

Hi... can someone help me how to auto rehash my eggdrop every 'x' minutes??example for every 5 minutes .. tq
_________________
: halloaizq :
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Mon Dec 03, 2007 2:26 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
halloaizq
Voice


Joined: 27 Aug 2007
Posts: 24

PostPosted: Mon Dec 03, 2007 2:36 am    Post subject: Reply with quote

Tq bro .. Smile
_________________
: halloaizq :
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Mon Dec 03, 2007 6:16 am    Post subject: Reply with quote

halloaizq wrote:
Tq bro .. Smile

No problem. Smile
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
halloaizq
Voice


Joined: 27 Aug 2007
Posts: 24

PostPosted: Thu Dec 06, 2007 4:40 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website Yahoo Messenger
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Thu Dec 06, 2007 3:55 pm    Post subject: Reply with quote

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
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