| View previous topic :: View next topic |
| Author |
Message |
Zircon Op
Joined: 21 Aug 2006 Posts: 191 Location: Montreal
|
Posted: Fri Jun 29, 2007 8:29 pm Post subject: Protection against slap attack |
|
|
Hi all
I d like to request a script that can punish some1 that abuse of slaps like these :
[10:50] Action: FreeStiliste slaps Goldquizz around a bit with a large trout
[10:50] Action: FreeStiliste slaps Anti-Flood around a bit with a large trout
It s very annoying. Unfortunately i cant use text protection, coz i run a quizz channel and players usualy lags and i dont want the bot to punish them. So i d like a script that let me specify how many slaps in how many seconds that trigger the punishment.
Thanks in advance |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Fri Jun 29, 2007 9:50 pm Post subject: |
|
|
| Code: | # kick after x slaps in y seconds
set slaplimit 3:10
bind ctcp - ACTION slap:prot
proc slap:prot {nick uhost hand chan kw arg} {
if {![validchan $chan]||[matchattr $hand +fmo|+fmo $chan]} {return 0}
foreach {o s} [split $::slaplimit :] {break}
if {[string match -nocase "slaps *" $arg]&&[fld:slap $uhost:$chan $s $o]} {
putserv "kick $chan $nick :Slap attack detected!"
pushmode $chan +b *!*@[lindex [split $uhost @] 1]
}
}
proc fld:slap {id s o} {
global slappers
if {![info exists slappers($id)]} {
set slappers($id) 0
utimer $s [list unset slappers($id)]
}
expr {[incr slappers($id)] >= $o}
} |
Edit: Fixed typo
Edit2: Fixed kick bug and added +fmo exempt. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts
Last edited by Sir_Fz on Sat Jun 30, 2007 7:20 pm; edited 2 times in total |
|
| Back to top |
|
 |
r0t3n Owner
Joined: 31 May 2005 Posts: 507 Location: UK
|
Posted: Sat Jun 30, 2007 12:41 pm Post subject: |
|
|
Sir_Fz there is a typo in your post
fld:slp -> fld:slap _________________ r0t3n @ #r0t3n @ Quakenet |
|
| Back to top |
|
 |
Zircon Op
Joined: 21 Aug 2006 Posts: 191 Location: Montreal
|
Posted: Sat Jun 30, 2007 4:17 pm Post subject: |
|
|
Thanks a lot Sir_Fz, ur script works fine, i just did a little of editing to replace kick $nick $chan by kick $chan $nick , so the Kick can be effetive, and also used putquick instead of putserv and pushmode, so it can react faster.
I have a request. Is it possible to make this script exempt users that have +f or +m or +o flags ?
Thanks in advance  |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
|
| Back to top |
|
 |
Zircon Op
Joined: 21 Aug 2006 Posts: 191 Location: Montreal
|
Posted: Mon Jul 02, 2007 12:30 am Post subject: |
|
|
Hello Sir_Fz
Ur script is just working PERFECT. Thanks vey much  |
|
| Back to top |
|
 |
Sydneybabe Op
Joined: 27 Apr 2007 Posts: 106 Location: Philippines
|
Posted: Wed Oct 31, 2007 7:01 am Post subject: |
|
|
how about exempting Operator(@) on kickban sir Sir_Fz.. thanks in advance  |
|
| Back to top |
|
 |
Zircon Op
Joined: 21 Aug 2006 Posts: 191 Location: Montreal
|
Posted: Wed Oct 31, 2007 11:39 am Post subject: |
|
|
| They are already exempted if they have the +o flag on the bot. |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Wed Oct 31, 2007 7:32 pm Post subject: |
|
|
It appears one makes an effort to search the Tcl Archive these days.
There are five anti trout slap scripts there. _________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
|