# chanctrl.tcl for netbots.tcl v3.15
# designed to work with eggdrop 1.5.2 or higher
# Johoho's Eggdrop Page - http://johoho.eggdrop.cx
# 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 v1.51.0, 18.03.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

# Todo:
# 
# - add a check for /part msg colours
# - add caps support
# - add a command for changing color status manually (?)
# - unify code, so I don't need to write extra proc for each color task

# thanks to dw and NML_375 for help. thanks slennox for netbots.tcl

Please note that this component is fully compatible with netbots.tcl by slennox

This component was designed to monitor one or more channels for colour usage.
If it detects somebody using colours the person will get first a warning message from the bot. After a second misdoing person will get kicked and warned again. If the person still doesn't stop this misbehaviour it will get banned for two days. Should this still doesn't work, the bot will set a permban on the offender.
Some people use colours in der quit msg when parting irc so this script remembers who did so and sends the person a note on the next join. After a second warning it will proceed the same way as if somebody typed colours in channel; it will ban first for two days and then set a perm ban.


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

## netset.tcl
# chanctrl.tcl
set nb_component(chanctrl) 1
set cc_chans ""
set cc_flag "f"
set cc_note ""
set cc_chan 1
set cc_quit 1
set cc_note_cfirst {
    "Please don't use colours in our channel"
    "This is an automatically generated message - no need to answer"
}
set cc_note_clevel1 {
    "You used colours in our channel *again*. Please stop this, otherwise you wont be just kicked, but banned for two days!"
}
set cc_note_clevel2 {
    "hmm, you don't learn it, do you? You're banned for two days for colour abuse!"
}
set cc_note_clevel3 {
    "Once again you used colours!"
    "This time it's over, you're banned forever"
}
set cc_note_qfirst "Your quit msg included colours. Please read the manuall of your irc client how to modify this behaviour."
set cc_note_qlevel1 "You still have colour in your quit msg. Do something against it!"
set cc_note_qlevel2 "hmm, your stolidity brought you a two day ban :-) have fun and change your quit msg"
set cc_note_qlevel3 "well, some people simply don't learn it. you're banned permanently now for colours in your quit msg."


## Settings Documentation:

cc_chans ""  (default: "")
  List of channels in which to activate limiting.
  Valid settings: one channel like "#donkeys", a list of channels like "#donkeys #cows #pigs", or "" to activate on all channels (except those listed in cl_echans).

cc_flag  (default: "f")
  Users with this flag (global / channel) won't be punished or reminded for colour abuse.
  Valid settings: every valid global or channel flag

cc_note ""  (default: "")
  Enter here a list of people who should be notified if somebody gots banned for colour abuse.
  Valid settings: One or more nicknames, seperated by a blank " ". Leave completely blank to disable.

cc_chan  (default: 1)
  This setting enables the channel check. Eggdrop will check every msg in the channel(s) for colour.
  Valid settings: 1 to enable, 0 to disable.

cc_quit  (default: 1)
  This setting enables the channel check. Eggdrop will check every quit msg for colour.
  Valid settings: 1 to enable, 0 to disable.

cc_note_cfirst  (default: { "Please don't use colours in our channel" "This is an automatically generated message - no need to answer" })
  The sentences in this array will be msged to the user on his first colour use in channel.
  Valid settings: an array of words or sentences enclosed by "". Enter "" to disable note function.

cc_note_clevel1  (default: { "You used colours in our channel *again*. Please stop this, otherwise you wont be just kicked, but banned for two days!" })
  The sentences in this array will be msged to the user on his second colour use in channel.
  Valid settings: an array of words or sentences enclosed by "". Enter "" to disable note function.

cc_note_clevel2  (default: { "hmm, you don't learn it, do you? You're banned for two days for colour abuse!" })
  The sentences in this array will be msged to the user on his third colour use in channel.
  Valid settings: an array of words or sentences enclosed by "". Enter "" to disable note function.

cc_note_clevel3  (default: { "Once again you used colours!" "This time it's over, you're banned forever" })
  The sentences in this array will be msged to the user on his fourth colour use in channel.
  Valid settings: an array of words or sentences enclosed by ""

cc_note_qfirst  (default: "Your quit msg included colours. Please read the manuall of your irc client how to modify this behaviour.")
  Set here the message that should be sent via a note to the victim.
  Valid settings: a sentence enclosed by "". Enter "" to disable note function.

cc_note_qlevel1  (default: "You still have colour in your quit msg. Do something against it!")
  Set here the message that should be sent via a note to the victim.
  Valid settings: a sentence enclosed by "". Enter "" to disable note function.

cc_note_qlevel2  (default: "hmm, your stolidity brought you a two day ban :-) have fun and change your quit msg")
  Set here the message that should be sent via a note to the victim.
  Valid settings: a sentence enclosed by "". Enter "" to disable note function.

cc_note_qlevel3  (default: "well, some people simply don't learn it. you're banned permanently now for colours in your quit msg.")
  Set here the message that should be sent via a note to the victim.
  Valid settings: a sentence enclosed by "". Enter "" to disable note function.
