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.

!help once every 5 mins

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
t
tersayang
Voice
Posts: 3
Joined: Wed Apr 18, 2007 7:03 am

!help once every 5 mins

Post by tersayang »

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

Post by Sir_Fz »

Code: Select all

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
 }
}
t
tersayang
Voice
Posts: 3
Joined: Wed Apr 18, 2007 7:03 am

!help timer

Post by tersayang »

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
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

tersayang: Please edit your post and enclose the code in

Code: Select all

 tags.
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

You can add

Code: Select all

if {[matchattr $hand n|n $chan]} {return 0}
in the help:user proc. This way it'll exempt owners.
Post Reply