And what will trigger this warning?MrBeta wrote:Hi, I was looking for a simple tcl that warn the user not to use any action /me in the channel
Code: Select all
# July 23, 2019
# http://forum.egghelp.org/viewtopic.php?p=107714#107714
#
#
###
# This section will cause bot to react to /me in channel
# You must edit it. Substitute your channel name for #your_chan_here
#
###
bind ctcp - "ACTION" saw_me_in_chan
proc saw_me_in_chan {nick uhost handle dest keyword text} {
putserv "privmsg #your_chan_here :Hey $nick ! No channel wide CTCP's in this channel, ok?"
}
###
###
###
###
# This section will cause bot to do an announcement in the channel, on a schedule.
# You must edit it.
# First, visit: https://crontab.guru/ if you are not already familiar with how to configure the
# timing of crontab. It will help.
# Edit the bind cron line. The part that is currently, "* * * * *" must be edited.
# As it is now, it will announce every minute.
#
# Next, substitute your channel name for #your_chan_here
#
bind cron - "* * * * *" announce_ctcp_warning
proc announce_ctcp_warning {min hour day month weekday} {
putserv "privmsg #your_chan_here :No channel CTCP's in this channel, please"
}
###
Correct.MrBeta wrote: ...
Maybe there may be the problem for those who ignore the message, leading the bot to make a flood of repetitions, ...
Check out AllProtection script. Links to its location can be found in posts by Sir_Fz or Opposing, here: http://forum.egghelp.org/viewtopic.php? ... start=1335... a kick after 2 warnings could be a future solution, as well as exempt from recalls other bots and operators,...
You are welcome.but for the moment thank you for the help
Code: Select all
################################################################################
################################################################################
## INITIAL INFO ################################################################
putlog "...Initialyse action flood protection. Please wait."
################################################################################
##### This script made by toHands.org work for #nouveau-brunswick on Efnet #####
##### #####
##### CREATED BY AcADIeN #####
################################################################################
## VARIABLE ###################################################################
set count 2
set seconds 1200
set allow ""
set channels "#chann"
## INFO ########################################################################
putlog "...Loaded protection ($channels) action permission ($count action in $seconds secs)"
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
## DO NOT EDIT AFTER THIS LINE ###########################################
################################################################################
################################################################################
## START SCRIPT ##############################################
# BIND FOR ALL ACTION
bind ctcp - ACTION floodprot
# PROC FLOODPROT TO PROTECT AGAINST LAMER
proc floodprot { nick uhost hand chan key arg } {
global botnick livesaver actionflood allow channels seconds count
if {$nick == $botnick} {return 0}
if {[lsearch -exact $channels $chan] == -1} {return 0}
if {[isop $nick $chan]} {return 0}
lappend livesaver($uhost:$chan) 1
utimer $seconds "expire livesaver($uhost:$chan)"
if {[llength $livesaver($uhost:$chan)] >= $count} {
putserv "KICK $chan $nick :!"
}
}
# PROC EXPIRE TO REMOVE A LAMER IN THE LIST
proc expire var_exp {
upvar $var_exp var_pointer
if {[llength $var_pointer] > 1} {
set var_pointer [lrange $var_pointer 1 end]
} else {
unset var_pointer
}
}
## END SCRIPT ################################################
################################################################################
## LOADED ######################################################################
putlog "Loaded Lamer's action flood protection by toHands.org"
################################################################################
################################################################################
################################################################################
################################################################################
## Copyright 2004 by toHands.org ######
################################################################################
Code: Select all
Code:
#Badwords
set swearwords {
"*bad*"
}
#Time until reset warnings
set brd "30"
#max warning
set maxwarning "5"
###########Code############
setudef flag ctswear
bind pubm - * ctswear:pub
proc ctswear:pub {nick host hand chan text} {
global swearwords brd maxwarning warn
if {[channel get $chan ctswear]} {
foreach badword $swearwords {
if {[string match -nocase $badword $text]} {
incr warn($host) +1
if {![$warn($host) == $maxwarning]} {
putserv "NOTICE $nick :Warning! Do not Swear on $chan, cease immediately or else"
utimer $brd {incr warn($host) -1 }
} else {
putserv "kick $nick $chan Kickbanned from $chan : Reason: Use of swear word $badword"
set warn($host) "0"
}
}
}
}
}
Code: Select all
[00:22:35] Tcl error [ctswear:pub]: invalid command name "1"
Code: Select all
# Set max warnings before Punishment
set warn(max) "4"
# Set X time before timer undo's warning amount (in seconds)
set warn(reset) "60"
# Set Kick Reason
set warn(reason) "Abusage of /me"
######################
bind CTCP - ACTION action:avoid
proc action:avoid {nick host hand chan key text} {
global warn
if {[isbotnick $nick]} return
if {[matchattr $hand "ofmn|ofmm"]} return
if {[isop $nick $chan]} return}
incr warn($host) 1
if {$warn($host) > $warn(max)} {
putquick "MODE $chan +b $host"
putquick "KICK $chan $nick $warn(reason)"
set warn($host) "0"
} else {
putserv "PRIVMSG $chan :Warning $warn($host)"
utimer $warn(reset) {incr warn($host) -1 }
}
}
Code: Select all
if {$nick == $::botnick} {return 0
} elseif {[isop $nick $chan]} {return 0
} elseif {[matchattr [nick2hand $nick] ofmn|ofmm ]} {return 0}
Code: Select all
if {[isbotnick $nick]} return
if {[matchattr $hand "ofmn|ofmm"]} return
if {[isop $nick $chan]} return