Bad word kick/ban ( text , emote , notice )

By Scakk on Aug 13, 2007

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 }
}

Comments

Sign in to comment.
Annihiluz   -  Jul 18, 2012

ADDWORD Unknown command

ADDWORD Unknown command

ADDWORD Unknown command

ADDWORD Unknown command

ADDWORD Unknown command

ADDWORD Unknown command

ADDWORD Unknown command

ADDWORD Unknown command

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 }
}
}

 Respond  
Annihiluz   -  Jul 18, 2012

this has absolutely horrible bracket matching
took me 2 mins to track down why it wasnt doing ANYTHING

 Respond  
Scakk   -  Oct 05, 2007

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
  }
}
 Respond  
Scakk   -  Oct 04, 2007

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.

  • RubixCube

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.

 Respond  
guest598594   -  Oct 04, 2007

maybe like

alias addword if (!$istok(%words,$$?=\"Word?\",32)) set %words $addtok(%words,$!,32)

and then like $remtok to remove

 Respond  
guest598594   -  Oct 04, 2007

ah yes i misunderstood the timers, sorry bout that

 Respond  
RubixCube   -  Oct 04, 2007

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.

  • RubixCube
 Respond  
guest598594   -  Oct 04, 2007

but u should still do ban -k

 Respond  
Scakk   -  Oct 04, 2007

@mountaindew - I changed the $nick to be $address($nick,2) and changed the alias & on connect parts.

 Respond  
guest598594   -  Oct 04, 2007

*make that

ban -ku30 $chan $address($nick,2) Dont use bad language blah blah blah...
 Respond  
guest598594   -  Oct 04, 2007

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...

 Respond  
Roy_   -  Oct 01, 2007

Ugh, in my last comment just remove the use in the first sentence, it\'s a bit late over in here.

--Roy

 Respond  
Roy_   -  Oct 01, 2007

Interesting approach to this, but why not use add a warning? It seems a bit harsh to directly kban, even though it\'s for 30 seconds. Also, why not use ban -ku30? I don\'t think there is a need for the timer, other than giving a two second interval. Nice job on this I like it.

--Roy

 Respond  
Scakk   -  Aug 18, 2007

@Anti - With +G they will see the badword and others will not. They will also not know that it is a \" badword \" unless they are told so. With this script they will know it is a \" badword \" and there are consequences if one uses them.

 Respond  
Anti   -  Aug 14, 2007

mode +G? :P

 Respond  
Scakk   -  Aug 13, 2007

Forgot these.

 on *:CONNECT: { set %badwords put,words,here,seperated,by,commas } 
 alias bdwd { set %badwords put,words,here,seperated,by,commas } 
 Respond  
Scakk   -  Aug 13, 2007

Comments: 33

Posted: Aug 13, 2007 10:03 pm


I changed the

 /ban -ku30 

to be

 /ban -u30 

.

I have also changed the

var %badwords Put,words,here,seperated,by,commas

into

 set %badwords put,words,here,seperated,by,commas

so it will be a global variable.

 Respond  
Olliegod   -  Aug 13, 2007

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.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.