egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Protection against slap attack

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Zircon
Op


Joined: 21 Aug 2006
Posts: 191
Location: Montreal

PostPosted: Fri Jun 29, 2007 8:29 pm    Post subject: Protection against slap attack Reply with quote

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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Fri Jun 29, 2007 9:50 pm    Post subject: Reply with quote

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 Wink
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
View user's profile Send private message Visit poster's website
r0t3n
Owner


Joined: 31 May 2005
Posts: 507
Location: UK

PostPosted: Sat Jun 30, 2007 12:41 pm    Post subject: Reply with quote

Sir_Fz there is a typo in your post

fld:slp -> fld:slap
_________________
r0t3n @ #r0t3n @ Quakenet
Back to top
View user's profile Send private message MSN Messenger
Zircon
Op


Joined: 21 Aug 2006
Posts: 191
Location: Montreal

PostPosted: Sat Jun 30, 2007 4:17 pm    Post subject: Reply with quote

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 Smile
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sat Jun 30, 2007 7:21 pm    Post subject: Reply with quote

Try the edited version.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
Zircon
Op


Joined: 21 Aug 2006
Posts: 191
Location: Montreal

PostPosted: Mon Jul 02, 2007 12:30 am    Post subject: Reply with quote

Hello Sir_Fz

Ur script is just working PERFECT. Thanks vey much Very Happy
Back to top
View user's profile Send private message
Sydneybabe
Op


Joined: 27 Apr 2007
Posts: 106
Location: Philippines

PostPosted: Wed Oct 31, 2007 7:01 am    Post subject: Reply with quote

how about exempting Operator(@) on kickban sir Sir_Fz.. thanks in advance Very Happy
Back to top
View user's profile Send private message
Zircon
Op


Joined: 21 Aug 2006
Posts: 191
Location: Montreal

PostPosted: Wed Oct 31, 2007 11:39 am    Post subject: Reply with quote

They are already exempted if they have the +o flag on the bot.
Back to top
View user's profile Send private message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Wed Oct 31, 2007 7:32 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber