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.

[req] word x2 within 15 minutes = kick/ban

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
B
BIF
Voice
Posts: 12
Joined: Mon Jul 31, 2006 4:53 pm

[req] word x2 within 15 minutes = kick/ban

Post by BIF »

I need a script that will kick/ban a user for using a command " !stop "
in public chat

I would like for it to kick/ban the user on the 2nd " !stop " if its within a 15 minutes of the last time. it has to be per user. as in if 1 person does it and then someone else it wont kick .. but only if its the same *!*@IP
The ban should last 1440 minutes or 24 hours.
i have tried many different ways to get this to work, and i keep falling short. any help on this matter would greatly be appreciated thank you in advanced
User avatar
YooHoo
Owner
Posts: 939
Joined: Thu Feb 13, 2003 10:07 pm
Location: Redwood Coast

Post by YooHoo »

use an existing "bad word" script, and modify it accordingly.
bad word scripts
:mrgreen:
B
BIF
Voice
Posts: 12
Joined: Mon Jul 31, 2006 4:53 pm

Post by BIF »

been there tryed that.. everything kicks after 1 " bad word " im looking for a kick ban after 2 words within 15 minutes
User avatar
iamdeath
Master
Posts: 323
Joined: Fri Feb 11, 2005 2:32 pm
Location: *HeLL*
Contact:

Post by iamdeath »

I aint clear about what you want, I mean do you want a script to ban a user who types !stop 2 times within 15 minutes and the bot should ban him for 24 hours. If he types !stop onces the bot will do nothing right?
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 - !stop ban:stop

proc ban:stop {nick uhost hand chan arg} {
 if {[throttled [lindex [split $uhost @] 1] 900]} {
  putkick $chan $nick "!stop command abusement."
  newchanban $chan *!*@[lindex [split $uhost @] 1] !stop-abuse "!stop command abusement." 1440
 }
}

# 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
 }
}
B
BIF
Voice
Posts: 12
Joined: Mon Jul 31, 2006 4:53 pm

Post by BIF »

Thanks alot for that.. and yes iamdeath Thats extactly what i want
B
BIF
Voice
Posts: 12
Joined: Mon Jul 31, 2006 4:53 pm

Post by BIF »

Sir_Fz wrote:

Code: Select all

bind pub - !stop ban:stop

proc ban:stop {nick uhost hand chan arg} {
 if {[throttled [lindex [split $uhost @] 1] 900]} {
  putkick $chan $nick "!stop command abusement."
  newchanban $chan *!*@[lindex [split $uhost @] 1] !stop-abuse "!stop command abusement." 1440
 }
}

# 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
 }
}
Just Tested this.. Works Flawlessly .. How would i go about setting it not to kick +f or ops ?
User avatar
YooHoo
Owner
Posts: 939
Joined: Thu Feb 13, 2003 10:07 pm
Location: Redwood Coast

Post by YooHoo »

BIF wrote:Just Tested this.. Works Flawlessly .. How would i go about setting it not to kick +f or ops ?
use another if statement, utilizing matchattr
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 this line in the ban:stop proc:

Code: Select all

if {[matchattr $hand f|f $chan]} {return 0}
Post Reply