Author Topic: Ban on bad words...  (Read 4437 times)

Cobi

  • Guest
Ban on bad words...
« on: November 17, 2003, 07:21:47 PM »
a script to kick/ban ppl that use badwords

in a channel:
Code: [Select]
Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)

dim numwords
dim word
dim counter
numwords = GetIniFile("<Path to ini file>","badwords","num","0")
for counter = 1 to numwords
word = GetIniFile("<Path to ini file>","badwords","word" & counter,"")
if instr(lcase(message), lcase(word)) then
if lcase(Channel) = "<Your Channel>" then
SendCommand "/mode " & Channel & " +b " & Nickname,ServerNumber
SendCommand "/kick " & Channel & " " & Nickname & " you used the bad word: " & word,ServerNumber
elseif lcase(Channel) = "<another channel>" then
SendCommand "/Msg " & Channel & "  4,1 I WOULD LIKE TO REMIND EVERYONE THAT THIS ROOM IS AN
ALL AGES ROOM! PLEASE CHAT ACCORDINGLY: NO CURSEING NO BAD LANGUAGE NO SEX OR PORN RELATED CHATTING!!",ServerNumber
end if
end if
next
End Sub
And the code for the INI

file:
Code: [Select]
[badwords]
num=5
word1=darn
word2=ass
word3=heck
word4=stuff
word5=!

testing-bad-words
You can add more to this ini file just makesure that the

num= key is how many bad words you have...
and for each

additional word you would do it like
Code: [Select]
word6=<your word here>
word7=<your word here>
word8=<your word here>
etc...
but remember to change the

num= to
Code: [Select]
num=<how many bad words you have>
like if you had 10 bad wirds you would

put:
Code: [Select]
num=10
« Last Edit: August 03, 2005, 07:42:16 AM by Snerf »