mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Nov 2019
Posts: 32
A
An0o Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Nov 2019
Posts: 32
This script is for bad words in the channel.
I want him to banned the person out of the room
when he says badword, but I want someone
else to say banned
to banned the bad person out.

Example :
me user1 op in the channel
user2 : bad word(swear)
user3 : !banned
user1 banned user2 out the channel

Code
on @*:Text:*:*:{ 
  if ($nick !isop #) || ($nick !ishop #) {
    if ($read(badwords.txt,rn,/^(\Q $+ $replacecs($2-,\E,\E\\E\Q,$chr(32),\E|\Q) $+ \E)$/iS)) {
      var %s = $+(%,$cid,$site,#)
      inc -u3600 $(%s) 
      if ( $1 == !banned ) {
      ban -ku900 # $nick 2  out the channel
      halt
      }
    }
  }
}

what missing?

Last edited by An0o; 24/02/20 11:42 PM.
Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
It looks like you've gotten someone to help you with the regex, but didn't get them to complete this. Are they no longer able to help you?

Your event does nothing unless the nick is not an op, or the nick is not a halfop. This means it responds to all messages unless the nick is an op AND the nick is also a halfop.

The next thing it does is check if their message is a regex match to a bad word. This means it does nothing unless the person saying !banned includes a badword along with saying "!banned". If there is a match with the badword list, it bans the user of the badword only if the first word is !banned.

I'm guessing that what you really want is to take action against user2 using a badword is if they have no-status or are a voice? I also assume that you want to ban user2 only if user3 is a halfop or op? Can you also confirm that you want the match to be someone using the badword anywhere within their message? Right now, there's only a match if $2- is an exact match with the badword.

Joined: Nov 2019
Posts: 32
A
An0o Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Nov 2019
Posts: 32
Thank you for reply
I want if I am an op or hop or admin(user1) in the channel and someone(user2) spoke a bad word regex match in my badwords.txt, I do not banned him unless someone(user3) wrote inside the channel the word !BannedŲŒ In this case i (user1) banned the person(user2) who said a badword

Example :
Coock = badword in the badwords.txt
#Foo = #mychannel
Me op or hop or admin = user1
Someone bad = user2
Everyone in the channel = user3
_____
(user1) op in #foo
(user2) say : coock
(user1) don't banned him
if (user3) in #foo say :!banned
(user1) banned (user2) goes #foo


I don't care if it is the first or second bad word

I only care if someone says a bad word matching the badwords.txt
I don't expel him unless someone in the room says !Bannd . In this case, I ban him out of the room.

Last edited by An0o; 25/02/20 12:44 PM.

Link Copied to Clipboard