# Anti Trout Slap v1.1 By Dude [matt@snip.net]
# ICQ # 4516120
# Released on November 12, 1998
#
# REQUIREMENTS: eggdrop 1.3.x and up (tested on 1.3.19 with tcl 7.6)
#
# Thanks for downloading the latest release of my Anti Trout Slap TCL. If
# you have any questions, comments, suggestions, or bug reports then try
# contacting me in the following ways by either sending a email letter to
# matt@snip.net, a ICQ message to 4516120, or find me on IRC using the
# nick Dude on NewNet, Dalnet, or GalaxyNet. Also If you would like to try
# out other things i've released to the public such as other TCL Scripts,
# or mIRC Scripts, Bots, and Addons then visit http://dude.home.ml.org/
#
# THIS TCL DOES THE FOLLOWING:
#
# - Auto kicks or kickbans people who slaps other people or the bot
# with a trout (depending on what settings you have set in this tcl).
#
# This TCL should be able to respond to the *majority* of trout slaps.
# If you know of any other trout slaps that get past this TCL then
# please contact me via email or ICQ at the addresses above so I can
# make sure this TCL will respond to those trout slaps as well.
#
# TODO LIST:
#
# I hope to eventually get this TCL to respond to trout slaps that have a
# combination of bold, reverse, underline, and color codes mixed in them.
# It would be most helpful if someone could give a example, tcl or the
# location of where I can get a tcl that could strip out these codes.
#
# DISCLAIMER:
#
# By using this TCL you agree to hold Dude (the author) harmless of ANY
# claims that may arise from it's storage and use. If for some reason you
# disagree with this disclaimer then please delete this and *ALL* other
# versions of this TCL that you currently have in your possession.
#
# HISTORY:
#
# 1.0 - first release
#
# 1.1 - oops.. I found some serious bugs that *had* to be fixed right away
# so I made a quick update to this tcl and rereleased it.
#
# !!! AND NOW A WORD FROM OUR SPONSOR !!!
#
# GROUND ZERO NETWORK (G0NET) IS LOOKING FOR NEW BOTS TO LINK TO!
#
# If you are looking for a botnet to link to then try out g0net, a small
# but cool botnet with a average of 30 bots. If you would to like to link
# some bot(s) then visit our homepage at http://g0net.home.ml.org/ and be
# sure to subscribe to the g0net mailing list while your at it. You can
# also contact me at matt@snip.net to have your bots linked up in no time.
#
# what kick method do you want to use in response to trout slaps?
#
# 0 = kick people who slaps the bot with a trout.
# 1 = kick people who slaps anyone including the bot with a trout.
# 2 = kickban people who slaps the bot with a trout.
# 3 = kickban people who slaps anyone including the bot with a trout.
set troutkickmethod 1
# what kick/kickban reason do you want the bot to use?
set troutkickreason "Take your trout and go jump in a lake..."
# how long do you want bans to last (in minutes) because of trout slapping?
# (NOTE: this only applies if you set kickmethod to 2 or 3)
set troutbantime 12
######################################################
# !!!!!! DO NOT EDIT ANYTHING BELOW THIS LINE !!!!!! #
######################################################
bind ctcp - ACTION antitrout:ctcp:action
proc antitrout:ctcp:action {nick uhost hand dest keyword arg} {
global botnick troutkickmethod troutkickreason troutbantime
if { [validchan $dest] == 1 && ([string tolower [lindex $arg 0]] == "slaps" || [string tolower [lindex $arg 0]] == "slap") && [lsearch [string tolower $arg] trout] >= 2 && [string tolower $nick] != [string tolower $botnick] && [botisop $dest] == 1 } {
if { $troutkickmethod == 0 && [string tolower [lindex $arg 1]] == [string tolower $botnick] } {
putserv "kick $dest $nick :$troutkickreason"
}
if { $troutkickmethod == 1 } {
putserv "kick $dest $nick :$troutkickreason"
}
if { $troutkickmethod == 2 && [string tolower [lindex $arg 1]] == [string tolower $botnick] } {
scan [string tolower [getchanhost $nick $dest]] "%\[^@]@%s" host host
newchanban $dest *!*@$host $botnick "$troutkickreason" $troutbantime
}
if { $troutkickmethod == 3 } {
scan [string tolower [getchanhost $nick $dest]] "%\[^@]@%s" host host
newchanban $dest *!*@$host $botnick "$troutkickreason" $troutbantime
}
}
return 0
}
putlog "Anti Trout Slap v1.1 By Dude \002Loaded...\002"