26.05.2000


chanctrl.tcl Component Documentation




# chanctrl.tcl for netbots.tcl v3.30
# designed to work with eggdrop 1.5.3 or higher
# Johoho's Eggdrop Page - http://johoho.tuts.net/eggdrop/
# chanctrl.tcl copyright (c) 1999,2000 by Johoho <johoho@hojo-net.de>
# netbots.tcl copyright (c) 1998-2000 by slennox <slennox@egghelp.org>

## chanctrl.tcl component script v3.06.0, 26.05.2000 ##

# History:
#
# v1.00.0, 01.02.2000 - initial release
# v1.50.0, 03.02.2000 - added quit msg check
# v1.51.0, 17.03.2000 - fixed wrong bans and quit msg check procedures
# v1.52.0, 19.03.2000 - added a comment on useradd
# v2.00.0, 01.04.2000 - complete rewrite of the code
# v2.10.0, 22.04.2000 - added action and part check (/me && [/leave || /part])
# v2.11.0, 19.05.2000 - fixed a bug - thanks ICU and _eCs_
# v3.00.0, 25.05.2000 - added noautorejoin and nochanhopper code
# v3.01.0, 25.05.2000 - fixed a matching bug
# v3.02.0, 25.05.2000 - cc_action bug fix
# v3.03.0, 25.05.2000 - added cc_clc_pubm, cc_clc_quit and cc_clc_part again
# v3.04.0, 25.05.2000 - added note notification on bans
# v3.05.0, 25.05.2000 - splitted cc_flag
# v3.06.0, 26.05.2000 - optimized chans and echans code, fixed an unlikely to appear bug

# Thanks to:

# NML_375 for some lessons in coding...
# Abraham for his ideas / suggestions, bug reports and countless tests
# ...
# and of course slennox for his netbots.tcl!

Please note that this component is fully compatible with netbots.tcl v3.10 - 3.30 by slennox

Index




Description

ChanCtrl is designed to monitor one or more channels for several types of abuse. At present there are three types supported by this script, Colour abuse, Auto-Rejoin and Channel Hopping.

Colour abuse
This sub-component monitors a given channel for colour use in public chatter (including actions), part and quit messages. If it detects colours, it adds the offender (if it's not already added) to the user file and warns him (either by note or message on irc). On second abuse, the user gets warned a second time, if it was a public colour offense, the user gets kicked additionally. On third colour use the user gets banned for a given period of time. On any further abuse the offender gets banned for an other configurable period of time (cc_clc_bantime2).

no Auto-Rejoin
The no Auto-Rejoin sub-component monitors the channel for kicks and notices when somebody re joins too quickly (configurable). If that's the case, the script bans and kicks the user for a given amount of time.

no Chan Hopping
Channel Hopping is a very evil way to check if something is going on in the channel or if somebody is on (join, look, say nothing and part). This script detect such behaviour and warns the user on first time (offender gets also added to user file). If such a behaviour repeats, the user gets banned from the channel for a given amount of time. If the offender continues the behaviour, he gets banned for longer time.


Please note that this script uses channel flags to dynamically switch each sub-component on and off. The three flags are +/-colourcontrol, +/-noautorejoin and +/-nochanhopper. You can use them just like every other channel flag (type on partyline: .chanset #lamest +nochanhopper +noautorejoin -bitch).


Installation

netset.tcl

To install this component properly you have to copy it to your netbots directory and add these lines to your netset.tcl conf:

# chanctrl.tcl settings
set nb_component(chanctrl) 1
set cc_msgtype "NOTICE"

set cc_colourcontrol 1
set cc_clc_chans ""
set cc_clc_echans ""
set cc_clc_flag "f|f"
set cc_clc_bantime1 2880
set cc_clc_bantime2 0
set cc_clc_note "$owner"
set cc_clc_part 1
set cc_clc_pubm 1
set cc_clc_quit 1
set cc_clc_text {
"Your Part-MSG contained colours. Please disable that"
"That's the 2nd Time you used colours in your Part-MSG. Stop that please !"
"That was the last time for you to use colours here. Come back in 2 days!"
"Ok... we're done.. stay OUT!"
"Please don't use colours in this channel"
"Stop colours or we'll ban you"
"You don't want to listen, want you?? Two day ban!"
"You're out!"
"Your Quit-MSG contrained colours. Please disable that"
"That's the 2nd Time you used colours in your Quit-MSG. Stop that please!"
"You're banned for 2 days for your colour Quit-MSG"
"Quit somewhere else with colours...not here!"
}

set cc_noautorejoin 1
set cc_nar_chans ""
set cc_nar_echans ""
set cc_nar_flag "m|-"
set cc_nar_seconds 4
set cc_nar_bantime 1
set cc_nar_bantype 2
set cc_nar_msg "no autorejoin - banned for a minute"

set cc_nochanhopper 1
set cc_nch_chans ""
set cc_nch_echans ""
set cc_nch_flag "f|f"
set cc_nch_seconds 6
set cc_nch_bantime1 4320
set cc_nch_bantime2 14400
set cc_nch_msg1 "No Channel hopping please !"
set cc_nch_msg2 "We know you as channel hopper ! Banned for 2 days!"
set cc_nch_msg3 "Channel hopping again ? Banned for 10 days !"

Settings Documentation

cc_msgtype (default: "NOTICE")
Define here how you want the bot to talk to the users, by message (/msg) or by notice (/notice).
Valid settings: NOTICE or PRIVMSG (case sensitive)
 
 
cc_colourcontrol (default: 1)
Do you want to load colour control support?
Valid settings: 1 to enable, 0 to disable.
 
cc_clc_chans (default: "")
List of channels you want your script to set +colourcontrol as a default.
Valid settings: one channel like "#donkeys", a list of channels like "#donkeys #cows #pigs", or "" to activate on all channels (except those listed in cc_clc_echans), "none" to deactivate on all channels
 
cc_clc_echans (default: "")
List of channels in which you want the script to set -colourcontrol as a default.
Valid settings: one channel like "#donkeys", a list of channels like "#donkeys #cows #pigs", or "" to switch this off.
 
cc_clc_flag (default: "f|f")
The flags for users who are allowed to use colours. Please note that permanent owner are always allowed to use colours.
Valid settings: set in globalflags|chanflags format (e.g. "f|f" means global OR channel friends, "f|-" means global friends only"), or set to "" to specify that no users are allowed to channel hop.
 
cc_clc_bantime1 (default: 2880)
How long should a user get banned for third colour use?
Valid settings: x minutes or 0 to make it a permban
 
cc_clc_bantime2 (default: 0)
How long should a user get banned for fourth and any further colour use?
Valid settings: x minutes or 0 to make it a permban
 
cc_clc_note (default: "$owner")
Enter here a list of people who should be notified if the script bans somebody?
Valid settings: One or more handles, seperated by a blank " ". Leave completely blank to disable.
 
cc_clc_part (default: 1)
Should the bot trigger on PART colour messages?
Valid settings: 1 to enable, 0 to disable.
 
cc_clc_pubm (default: 1)
Should the bot trigger on PUBLIC (including ACTIONs) colour messages?
Valid settings: 1 to enable, 0 to disable.
 
cc_clc_quit (default: 1)
Should the bot trigger on QUIT colour messages?
Valid settings: 1 to enable, 0 to disable.
 
cc_clc_text (default: {"" "" ... "" ""})
This variable stores all the messages which will be send via irc or note to the offending user. The sheme of this array is pretty simple: First, the 4 part messages are stored, then the 4 messages for public chatter are stored. The last 4 entries are for quit msg. These actually get delivered via the bot's note system to the user.
An example would look like this:
set cc_clc_text {"PART1" "PART2" "PART3" "PART4" "PUBM1" "PUBM2" "PUBM3" "PUBM4" "QUIT1" "QUIT2" "QUIT3" "QUIT4"}
Valid settings: An array containing 12 lists, for each colour type 4.
 
 
cc_noautorejoin (default: 1)
Do you want to load no auto-rejoin support?
Valid settings: 1 to enable, 0 to disable.
 
cc_nar_chans (default: "")
List of channels you want your script to set +noautorejoin as a default.
Valid settings: one channel like "#donkeys", a list of channels like "#donkeys #cows #pigs", or "" to activate on all channels (except those listed in cc_nar_echans), "none" to deactivate on all channels
 
cc_nar_echans (default: "")
List of channels in which you want the script to set -noautorejoin as a default.
Valid settings: one channel like "#donkeys", a list of channels like "#donkeys #cows #pigs", or "" to switch this off.
 
cc_nar_flag (default: "m|-")
The flags for users who are allowed to auto-rejoin. Please note that permanent owner are always allowed to auto-rejoin.
Valid settings: set in globalflags|chanflags format (e.g. "f|f" means global OR channel friends, "f|-" means global friends only"), or set to "" to specify that no users are allowed to channel hop.
 
cc_nar_seconds (default: 6)
How long does a user have to stay off channel after being kicked before he can return savely without being punished for auto-rejoin?
Valid settings: x seconds
 
cc_nar_bantime (default: 1)
How long should a user get banned for auto-rejoin?
Valid settings: x minutes or 0 to make it a permban
 
cc_nar_bantype (default: 2)
You can use three different ban types in this script. You may ban either the user by nick (type 0, nick!*@*), by provider (type 1, *!ident@*.isp.com) or by his full qualified host mask (type 2, *!ident@port37.isp.com)
Valid settings: 0, 1 or 2
 
cc_nch_msg1 (default: "No Channel hopping please !")
Set here the second notice to the user.
Valid settings: A string enquoted by "
 
 
cc_nochanhopper (default: 1)
Do you want to load no channel hopper support?
Valid settings: 1 to enable, 0 to disable.
 
cc_nch_chans (default: "")
List of channels you want your script to set +nochanhopper as a default.
Valid settings: one channel like "#donkeys", a list of channels like "#donkeys #cows #pigs", or "" to activate on all channels (except those listed in cc_nch_echans), "none" to deactivate on all channels
 
cc_nch_echans (default: "")
List of channels in which you want the script to set -nochanhopper as a default.
Valid settings: one channel like "#donkeys", a list of channels like "#donkeys #cows #pigs", or "" to switch this off.
 
cc_nch_flag (default: "f|f")
The flags for users who are allowed to channel hop. Please note that permanent owner are always allowed to channel hop.
Valid settings: set in globalflags|chanflags format (e.g. "f|f" means global OR channel friends, "f|-" means global friends only"), or set to "" to specify that no users are allowed to channel hop.
 
cc_nch_seconds (default: 6)
How long does a user have to stay on channel before he may leave and wont be considered as a channel hopper?
Valid settings: x seconds
 
cc_nch_bantime1 (default: 4320)
How long should a ban on seconds offense be active?
Valid settings: x minutes or 0 to make it a permban
 
cc_nch_bantime2 (default: 14400)
How long should a ban on third and any further offense be active?
Valid settings: x minutes or 0 to make it a permban
 
cc_nch_msg1 (default: "No Channel hopping please !")
Set here the second notice to the user.
Valid settings: A string enquoted by "
 
cc_nch_msg2 (default: "We know you as channel hopper ! Banned for 2 days!")
Set here the second notice to the user.
Valid settings: A string enquoted by "
 
cc_nch_msg3 (default: "Channel hopping again ? Banned for 10 days !")
Set here the third and last notice to the user. It will be redisplayed on all further offenses, too.
Valid settings: A string enquoted by "



FAQ

Q:  What about CAPS support? It should be included, too. Will it be?
A:  Hell yes, you're not the first to ask that. But since I don't need CAPS-Support I'm not likely to hurry up with its support. If you add it yourself, please send me the modified code so I can include it in the main distribution.
 
Q:  I have a question, but it's not listed here.
A:  Feel free to contact the author at johoho@hojo-net.de!



Contact

You can contact me via E-Mail at johoho@hojo-net.de, at ICQ 2499577 (tell me who you are and what you want or I'll ignore you) or catch me on irc usually around 18-24 UTC+1 in #eggdrop. (IrcNET)


DISCLAIMER

chanctrl.tcl is provided 'as is' and without warranty of any kind.



©2000 by Johoho@IrcNET, 26 May 2000. CONTACT