mIRC Home    About    Download    Register    News    Help

Print Thread
Easy question #68921 22/01/04 05:44 PM
Joined: Jan 2004
Posts: 2
L
LkL Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
L
Joined: Jan 2004
Posts: 2
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?

Re: Easy question #68922 22/01/04 05:51 PM
Joined: Apr 2003
Posts: 25
S
SS217 Offline
Ameglian cow
Offline
Ameglian cow
S
Joined: Apr 2003
Posts: 25
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.

Re: Easy question #68923 22/01/04 06:05 PM
Joined: Nov 2003
Posts: 2,327
T
tidy_trax Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
else { halt } is not needed


New username: hixxy
Re: Easy question #68924 22/01/04 08:39 PM
Joined: Jan 2004
Posts: 2
L
LkL Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
L
Joined: Jan 2004
Posts: 2
thank you so much! laugh laugh

Re: Easy question #68925 23/01/04 12:36 AM
Joined: Jan 2003
Posts: 3,012
KingTomato Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
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.


-KingTomato
Re: Easy question #68926 24/01/04 01:11 AM
Joined: Nov 2003
Posts: 157
RuFy Offline
Vogon poet
Offline
Vogon poet
Joined: Nov 2003
Posts: 157
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?

Re: Easy question #68927 24/01/04 05:09 AM
Joined: Aug 2003
Posts: 1,831
I
Iori Offline
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Yep its an error all right. The way it is will cause an infinite loop. The "inc %p" line should be "inc %w"

Re: Easy question #68928 24/01/04 03:54 PM
Joined: Jan 2003
Posts: 3,012
KingTomato Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Err,. another half asleep script--sry. Thanks for catching the error. blush


-KingTomato
Re: Easy question #68929 01/02/04 04:46 AM
Joined: Jan 2004
Posts: 18
K
KG6NCL Offline
Pikka bird
Offline
Pikka bird
K
Joined: Jan 2004
Posts: 18
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


KG6NCL (Aaron)