While using the script below;
1. The bot kicks anyone who join and got Chanserv access on the channel with the "set kr_remove(reason)" + deleting him/her.
2. It's enabling the script in all channels which the bot is in.
Code: Select all
##########################################################
# Kick Remove Script #
# Version 1.0 #
# Pahlwaan <Gondals@Msn.com> #
##########################################################
# This script will deop and remove ChanServ access from a user if they kick the bot.
# The bot must have SOp access for this script to work.
# Channel Founders and SOp's are ignored, only AOp's are affected.
# DALnet only script.
# For use in Eggdrop 1.6.17 and upwards *only*.
##
# Commands
##
#
# chanset <#channel> <+/->kr.remove
# This enables (+) or disables (-) the script for the particular channel.
# Command console: Dcc
##
#########################################################################
# Settings - alter this section of the script #
#########################################################################
# Message to send via notice to offender.
# Alter text to suite.
set kr_remove(notice) "You tit head, you just lost access!"
# Reason given when offender is kicked from the channel.
# Alter text to suite. Setting kr_remove(reason) to "" disables.
set kr_remove(reason) "Kicking Me Won't Get You Anywhere."
#########################################################################
##################### DO NOT EDIT BELOW THIS LINE!! #####################
#########################################################################
# Full name of channel services
set chanserv "chanserv@Services.dal.net"
setudef flag kr.remove
bind kick - * kick:remove
bind notc - "*Identification to the nickname *" check:verify
proc kick:remove {nick uhost hand chan targ rsn} {
if {$targ == $::botnick} {
if {[channel get $chan kr.remove]} {
putserv "PRIVMSG $::chanserv :why $chan $nick" -next
}
}
}
proc check:verify {nick host hand arg {dest ""}} {
set msg [stripcodes b $arg]
if {[string equal $dest $::botnick]} {
# Parse ChanServ's message.
set offender [lindex [split $msg] 0]
set aop [string tolower [lindex [split $msg] 2]]
set chan [string trim [lindex [split $msg] 5] .]
set opnick [string trim [lindex [split $msg] end] .]
# Only an AOp can be punished.
if {![string match $aop "aop"]} {return}
# Delete access, remove op & kick with appropriate message.
putquick "PRIVMSG $::chanserv :aop $chan del $opnick" -next
putquick "MODE $chan -o $offender" -next
if {$::kr_remove(reason) == ""} {set $::kr_remove(reason) $::botnick}
putquick "KICK $chan $offender :$::kr_remove(reason)" -next
putquick "notice $offender :$::kr_remove(notice)"
# Check and see if the offender is in the bots' user list
# If so, delete them!
set thehand [findhand $offender [getchanhost $offender]]
if {$offender != "" && $thehand != "*"} {
deluser $thehand
putcmdlog "Deleted !$offender! from the user database."
save
}
}
}
# findhand - tries to find a handle
proc findhand {nick host} {
if {[validuser $nick]} {
return $nick
} else {
set thehand [nick2hand $nick]
if {[validuser $thehand]} {
return $thehand
}
set thehand [finduser $host]
return $thehand
}
}
### End ###
set kr(version) " 1.0"
set kr(script_name) "Kick Remove"
putlog "TCL \002loaded\002: $kr(script_name)$kr(version) by Pahlwaan."
##
# History
##
# v1.2 (24.08.04)
# Replaced "ctrl:filter" proc with new
# internal command: stripcodes <strip-flags> <string>
# v1.1 (12.05.04)
# Added <+/->kr.remove DCC command.
# Added kick.
# Added configurable message/notice text.
##