| View previous topic :: View next topic |
| Author |
Message |
BIF Voice
Joined: 31 Jul 2006 Posts: 12
|
Posted: Sat Apr 28, 2007 10:54 pm Post subject: [req] word x2 within 15 minutes = kick/ban |
|
|
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 |
|
| Back to top |
|
 |
YooHoo Owner

Joined: 13 Feb 2003 Posts: 939 Location: Redwood Coast
|
|
| Back to top |
|
 |
BIF Voice
Joined: 31 Jul 2006 Posts: 12
|
Posted: Sun Apr 29, 2007 2:32 pm Post subject: |
|
|
| been there tryed that.. everything kicks after 1 " bad word " im looking for a kick ban after 2 words within 15 minutes |
|
| Back to top |
|
 |
iamdeath Master

Joined: 11 Feb 2005 Posts: 323 Location: *HeLL*
|
Posted: Sun Apr 29, 2007 4:42 pm Post subject: |
|
|
| 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? |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sun Apr 29, 2007 6:04 pm Post subject: |
|
|
| Code: | 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
}
} |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
BIF Voice
Joined: 31 Jul 2006 Posts: 12
|
Posted: Sun Apr 29, 2007 9:04 pm Post subject: |
|
|
| Thanks alot for that.. and yes iamdeath Thats extactly what i want |
|
| Back to top |
|
 |
BIF Voice
Joined: 31 Jul 2006 Posts: 12
|
Posted: Sun Apr 29, 2007 9:29 pm Post subject: |
|
|
| Sir_Fz wrote: | | Code: | 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 ? |
|
| Back to top |
|
 |
YooHoo Owner

Joined: 13 Feb 2003 Posts: 939 Location: Redwood Coast
|
Posted: Sun Apr 29, 2007 10:11 pm Post subject: |
|
|
| 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 _________________
Johoho's TCL for beginners
 |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Mon Apr 30, 2007 12:11 pm Post subject: |
|
|
You can add this line in the ban:stop proc:
| Code: | | if {[matchattr $hand f|f $chan]} {return 0} |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
|