mIRC Home    About    Download    Register    News    Help

Print Thread
#68921 22/01/04 05:44 PM
L
LkL
LkL
L
I am not using any mirc script or so but i have a problem i need a easy script and i dont know how to do it. I need a script that would say something in my channel if a word was written in it. Like a badword script... Do anyone know any script like that or maby someone could give me some info how to do it?

#68922 22/01/04 05:51 PM
S
SS217
SS217
S
Code:
  on *:TEXT:*:#yourchannel: { 
if (badword isin $1-) { commands here ex. msg or kick }
elseif (badword2 isin $1-) { commands here ex msg or kick }
else { halt }
}


Should work nicely for you, replace #yourchannel with the channel you want it to be for or # for all channels you join, replace badword with your own badwords and commands here ex.msg or kick with the command you want to send with someone says badword. You can add more by typing elseif (badwordgoeshere isin $1-) { commands you want }

Breaking down the script it means this when anyone says anything to channel #yourchan it looks to see if badword isin $1- $1- meaning parameter 1 or on if it isn't it goes to the elseif and checks for badword 2, if that isn't it goes to the else statement, which tells the script to stop running with the /halt command.

#68923 22/01/04 06:05 PM
T
tidy_trax
tidy_trax
T
else { halt } is not needed

#68924 22/01/04 08:39 PM
L
LkL
LkL
L
thank you so much! laugh laugh

#68925 23/01/04 12:36 AM
Joined: Jan 2003
Posts: 2,973
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Jan 2003
Posts: 2,973
Code:
on *:TEXT:*:#: {
  var %badwords = [color:Red]f--k sh-t a-s b-tch c-n-[/color]
  var %w = 1
  while ($gettok(%badwords, %w, 32)) {
    var %word = $ifmatch
    if ($istok($1-, %word, 32)) {
      [color:blue];/kick $chan $nick Swearing
      ;/mode $chan +bb $nick $address($nick, 11)
      ;/msg $chan $nick $+ : Do not swear in this channel[/color]
      return
    }
    /inc %p
  }
}


This is a little better, SS217

Original Poster:

Change the words in red to those you want to be filtered. Being this is a public forums, i self censored them already. Then, remove the ; before any of the sections in blue to do the command that fits. First one kicks, second bans, lat messages channel.

#68926 24/01/04 01:11 AM
R
RuFy
RuFy
R
I think that is an error.
var %w = 1
while ($gettok(%badwords, %w, 32))

If you don't increase the %w variable, the script check only first word of the string %badwords.
Is this correct?

#68927 24/01/04 05:09 AM
I
Iori
Iori
I
Yep its an error all right. The way it is will cause an infinite loop. The "inc %p" line should be "inc %w"

#68928 24/01/04 03:54 PM
Joined: Jan 2003
Posts: 2,973
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Jan 2003
Posts: 2,973
Err,. another half asleep script--sry. Thanks for catching the error. blush

#68929 01/02/04 04:46 AM
K
KG6NCL
KG6NCL
K
There is a much easier way if you dont want to see bad words in your channel. ..... If you have botserv which is the one to use I THINK its either botserv or chanserv if you have them, just do it using the BS bot... Go through /bs help which will tell you the way to get it setup, its very simple.... I cant double check myself right now because all i have here is a java client which isnt a normal mIRC client, but just check it out! that way you wont need to get a script on its own to blank out the badwords... if you need more help feel free to PM me


Link Copied to Clipboard