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.

Protection against slap attack

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
Z
Zircon
Op
Posts: 191
Joined: Mon Aug 21, 2006 4:22 am
Location: Montreal

Protection against slap attack

Post by Zircon »

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
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

# 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.
Last edited by Sir_Fz on Sat Jun 30, 2007 7:20 pm, edited 2 times in total.
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

Post by r0t3n »

Sir_Fz there is a typo in your post

fld:slp -> fld:slap
r0t3n @ #r0t3n @ Quakenet
Z
Zircon
Op
Posts: 191
Joined: Mon Aug 21, 2006 4:22 am
Location: Montreal

Post by Zircon »

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

Post by Sir_Fz »

Try the edited version.
Z
Zircon
Op
Posts: 191
Joined: Mon Aug 21, 2006 4:22 am
Location: Montreal

Post by Zircon »

Hello Sir_Fz

Ur script is just working PERFECT. Thanks vey much :D
S
Sydneybabe
Op
Posts: 106
Joined: Fri Apr 27, 2007 3:31 am
Location: Philippines

Post by Sydneybabe »

how about exempting Operator(@) on kickban sir Sir_Fz.. thanks in advance :D
Z
Zircon
Op
Posts: 191
Joined: Mon Aug 21, 2006 4:22 am
Location: Montreal

Post by Zircon »

They are already exempted if they have the +o flag on the bot.
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

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
Post Reply