The below snippets will tell the user what the bad word was they said , kick the user from the channel and then ban them for 30 seconds when they use a badword ( your choice of words there ) in the channel as a regular text , an emote or a notice.
Update: There is now an " on CONNECT " and Alias to help in the setting of the vairable.
Update: Changed $nick to be $address($nick,2)
Update: Added two aliases that allow you to add and removes words from the variable %badwords
on *:CONNECT: if (!%badwords) { set %badwords put,words,here,seperated,by,commas }
echo -a %badwords has been set }
else { echo -a The badwords have already been set. }
}
alias bdwd {
if (!%badwords) { set %badwords put,words,here,seperated,by,commas }
echo -a %badwords has been set }
else { echo -a The badwords have already been set. }
}
---------------------------------
---------------------------------
*/
The below two aliases can add ( one or more words at a time ) and delete ( one word at a time ) words from the list.
*/
alias addword {
if (!$1) { echo Please specify something to be added. | halt }
var %i 1
while (%i <= $0) {
if ($istok(%badwords, $ [ $+ [ %i ] ] ,44)) { echo That word or words is already in the list | halt } | inc %i }
set %badwords $replace($addtok(%badwords,$1-,32),$chr(32),$chr(44))
echo The new list is --> %badwords
}
alias delword {
if (!$1) { echo Please specify something to be removed. | halt }
if (!$istok(%badwords,$1,44)) { echo That word is not in the list. | halt }
else {
set %badwords $remtok(%badwords,$1,44)
echo The new list is --> %badwords
}
}
---------------------------------
---------------------------------
on @*:text:*:#: {
var %i 1
while (%i <= $0) {
if ($istok(%badwords, $ [ $+ [ %i ] ] ,44)) { msg $chan Please do not use such language in $chan again. | timer 1 3 kick # $nick $nick $+ , To the curb with you gutter mouth! 30 Second ban. | timer 1 5 ban -u30 $chan $address($nick,2) | halt } | inc %i }
else { halt }
}
-----------------------------------
on @*:action:*:#: {
var %i 1
while (%i <= $0) {
if ($istok(%badwords, $ [ $+ [ %i ] ] ,44)) { msg $chan Please do not emote such language in $chan again. | timer 1 3 kick # $nick $nick $+ , To the curb with you gutter mouth! 30 Second ban. | timer 1 5 ban -u30 $chan $address($nick,2) | halt } | inc %i }
else { halt }
}
-------------------------------------
on @*:notice:*:#: {
var %i 1
while (%i <= $0) {
if ($istok(%badwords, $ [ $+ [ %i ] ] ,44)) { msg $chan Please do not notice such language in $chan again. | timer 1 3 kick # $nick $nick $+ , To the curb with you gutter mouth! 30 Second ban. | timer 1 5 ban -u30 $chan $address($nick,2) | halt } | inc %i }
else { halt }
}
ADDWORD Unknown command
got this first time i tried to do anything: here is my edit that still has a minor flaw and repeats the "word is already added"
on *:CONNECT: {
if (!%badwords) { set %badwords put,words,here,seperated,by,commas }
echo -a %badwords has been set {
else { echo -a The badwords have already been set. }
}
}
alias bdwd {
if (!%badwords) { set %badwords put,words,here,seperated,by,commas }
echo -a %badwords has been set {
else { echo -a The badwords have already been set. }
}
}
alias addword {
if (!$1) { echo Please specify something to be added. | halt }
var %i 1
while (%i <= $0) {
if ($istok(%badwords, $ [ $+ [ %i ] ] ,44)) { echo -a That word or words is already in the list | halt | inc %i }
set %badwords $replace($addtok(%badwords,$1-,32),$chr(32),$chr(44))
echo The new list is --> %badwords
}
}
alias delword {
if (!$1) { echo Please specify something to be removed. | halt }
if (!$istok(%badwords,$1,44)) { echo -a That word is not in the list. | halt }
else {
set %badwords $remtok(%badwords,$1,44)
echo The new list is --> %badwords
}
}
on @:text::#: {
var %i 1
while (%i <= $0) {
if ($istok(%badwords, $ [ $+ [ %i ] ] ,44)) { msg $chan Please do not use such language in $chan again. | timer 1 3 kick # $nick $nick $+ , To the curb with you gutter mouth! 30 Second ban. | timer 1 5 ban -u30 $chan $address($nick,2) | halt | inc %i }
else { halt }
}
}
on @:action::#: {
var %i 1
while (%i <= $0) {
if ($istok(%badwords, $ [ $+ [ %i ] ] ,44)) { msg $chan Please do not emote such language in $chan again. | timer 1 3 kick # $nick $nick $+ , To the curb with you gutter mouth! 30 Second ban. | timer 1 5 ban -u30 $chan $address($nick,2) | halt | inc %i }
else { halt }
}
}
on @:notice::#: {
var %i 1
while (%i <= $0) {
if ($istok(%badwords, $ [ $+ [ %i ] ] ,44)) { msg $chan Please do not notice such language in $chan again. | timer 1 3 kick # $nick $nick $+ , To the curb with you gutter mouth! 30 Second ban. | timer 1 5 ban -u30 $chan $address($nick,2) | halt | inc %i }
else { halt }
}
}
Added the below Aliases
alias addword {
if (!$1) { echo Please specify something to be added. | halt }
var %i 1
while (%i <= $0) {
if ($istok(%badwords, $ [ $+ [ %i ] ] ,44)) { echo That word or words is already in the list | halt } | inc %i }
set %badwords $replace($addtok(%badwords,$1-,32),$chr(32),$chr(44))
echo The new list is --> %badwords
}
alias delword {
if (!$1) { echo Please specify something to be removed. | halt }
if (!$istok(%badwords,$1,44)) { echo That word is not in the list. | halt }
else {
set %badwords $remtok(%badwords,$1,44)
echo The new list is --> %badwords
}
}
I think what Scakk is trying to do is establish a two second time difference on purpose. It doesn\'t effect the way the ban takes place, and I think a couple of you misunderstand the timer. It just gives a two second difference between the kick and the ban. At least that\'s what I assume.
Anyway, why do you include the ;sets in your events when you already have an alias to do so? It\'s also a hassle to filter the script with the badwords. How about using $$? and a $$! for confirmation and easier editing. Otherwise, neat script.
1) Yes. There were times where it would kick/ban the person before the message was sent and other times where the message was sent then the person was kick/ban.
2) I meant to remove the \" ;set \" when I added the Alias and on CONNECT parts
@mountaindew -- I will work on an Alias for adding and removing words and post it here when I get it finished.
I think what Scakk is trying to do is establish a two second time difference on purpose. It doesn\'t effect the way the ban takes place, and I think a couple of you misunderstand the timer. It just gives a two second difference between the kick and the ban. At least that\'s what I assume.
Anyway, why do you include the ;sets in your events when you already have an alias to do so? It\'s also a hassle to filter the script with the badwords. How about using $$? and a $$! for confirmation and easier editing. Otherwise, neat script.
does an on notice trigger a $chan? also, you may not be on the same channel as the nick so use /help $comchan
alias bdwd { set %badwords put,words,here,seperated,by,commas }
shouldnt it be
alias bdwd if (!$istok(%badwords,$1,44)) set %badwords $addtok(%baddwords,$1,44)
?
also, use ban -ku30 $chan $nick Dont use bad language blah blah blah...
You don\'t need the /kick seeing as you are using /ban -k which will both kick them and ban them. Another suggestiong would be to make the badwords list either a global variable or a .txt or .ini file and then have an on load event which would ask the user for an initial list of words as well as having an alias, a pop up, or a dialog for the user to enter new words.