mIRC Homepage

Easy question

Posted By: LkL

Easy question - 22/01/04 05:44 PM

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?
Posted By: SS217

Re: Easy question - 22/01/04 05:51 PM

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.
Posted By: tidy_trax

Re: Easy question - 22/01/04 06:05 PM

else { halt } is not needed
Posted By: LkL

Re: Easy question - 22/01/04 08:39 PM

thank you so much! laugh laugh
Posted By: KingTomato

Re: Easy question - 23/01/04 12:36 AM

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.
Posted By: RuFy

Re: Easy question - 24/01/04 01:11 AM

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?
Posted By: Iori

Re: Easy question - 24/01/04 05:09 AM

Yep its an error all right. The way it is will cause an infinite loop. The "inc %p" line should be "inc %w"
Posted By: KingTomato

Re: Easy question - 24/01/04 03:54 PM

Err,. another half asleep script--sry. Thanks for catching the error. blush
Posted By: KG6NCL

Re: Easy question - 01/02/04 04:46 AM

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
© 2020 mIRC Discussion Forums