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 

!help once every 5 mins

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


Joined: 18 Apr 2007
Posts: 3

PostPosted: Sun May 13, 2007 3:59 am    Post subject: !help once every 5 mins Reply with quote

Hi there,

I have help bot, so when user type !help bnc the bot will respon and display the help contents. !help command only for user who have +v

Is it any other option some how, after the bot displayed help contents the bot will devoice the user and if the user type !help command again before 5 minutes the bot will message the nick " you can only use help command every 5 minutes" and the bot ignore that nick for 5 minutes.

thanks

Edit: Split this reply from Tcl Faq to this topic due to irrelevance. (Sir_Fz)
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sun May 13, 2007 7:55 am    Post subject: Reply with quote

Code:
bind pub - !help help:user

proc help:user {nick uhost hand chan arg} {
 if {![isvoice $nick $chan]} {return 0}
 if {![throttled $uhost:$chan 300]} {
  # You can help $nick now
  pushmode $chan -v $nick
 } {
  puthelp "notice $nick :you can only use help command every 5 minutes"
 }
}

# user's throttled proc
proc throttled {id time} {
 global throttled
 if {[info exists throttled($id)]} {
  return 1
 } {
  set throttled($id) [clock sec]
  utimer $time [list unset throttled($id)]
  return 0
 }
}

_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
tersayang
Voice


Joined: 18 Apr 2007
Posts: 3

PostPosted: Mon May 21, 2007 1:07 am    Post subject: !help timer Reply with quote

Sir_Fz wrote

bind pub - !help help:user

proc help:user {nick uhost hand chan arg} {
if {![isvoice $nick $chan]} {return 0}
if {![throttled $uhost:$chan 300]} {
# You can help $nick now
pushmode $chan -v $nick
} {
puthelp "notice $nick :you can only use help command every 5 minutes"
}
}

# user's throttled proc
proc throttled {id time} {
global throttled
if {[info exists throttled($id)]} {
return 1
} {
set throttled($id) [clock sec]
utimer $time [list unset throttled($id)]
return 0
}
}


thanks Sir, it's work for all user, one thing how to give an exception to bot owner. let say the bot owner nick is "tersayang"

thanks
Back to top
View user's profile Send private message
Alchera
Revered One


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

PostPosted: Mon May 21, 2007 11:22 am    Post subject: Reply with quote

tersayang: Please edit your post and enclose the code in [code] tags.
_________________
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
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Tue May 22, 2007 4:12 am    Post subject: Reply with quote

You can add
Code:
if {[matchattr $hand n|n $chan]} {return 0}

in the help:user proc. This way it'll exempt owners.
_________________
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