mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2007
Posts: 31
J
Ameglian cow
OP Offline
Ameglian cow
J
Joined: Jan 2007
Posts: 31
Well I run a channel simply called #q, and a lot of people spam other channels causing users to mass join channels such as #a #b #c #d #e etc etc... I want to make a script that will kick ban users who join my channel and are found in other channels such as #a #b #c etc etc..
Heres what I was writing,,
Quote:

on *:join:#q:{
whois $nick
}
raw 319:*:{
if (#i isin $3-) || (#a isin $3-) || (#g isin $3-) || (#f isin $3-) ||(#z isin $3-) || (#v isin $3-) || (#u isin $3-) ||(#g isin $3-) || (#b isin $3-) || (#l isin $3-) || (#k isin $3-) || (#o isin $3-) || (#2m-clan isin $3-) (#m isin $3-)(#s isin $3-) || (#n isin $3-) || (#v isin $3-) {
ban #q $2
kick #q $2 This is a banned channel
}
}

Is does not work, instead when i right click to /whois people it bans them. I think it needs a check so it does not ban who ever i whois but i don't know how to do that.
This also bans anyone with #A, #b, #c in there chan names

Last edited by Justin_F; 29/06/09 03:16 AM.
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
my only guess is that you have another ON JOIN event in the same file causing the one you pasted to not trigger.

On a sidenote, I would advise against whois'ing every user that joins your channel.. it makes it extremely easy to flood you off with a mass join in your channel.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Jan 2007
Posts: 31
J
Ameglian cow
OP Offline
Ameglian cow
J
Joined: Jan 2007
Posts: 31
Originally Posted By: argv0
my only guess is that you have another ON JOIN event in the same file causing the one you pasted to not trigger.

On a sidenote, I would advise against whois'ing every user that joins your channel.. it makes it extremely easy to flood you off with a mass join in your channel.


It does trigger but it bans anyone i whois. Its only a small chan with about 10 people and no one really mass floods on the network im on so whois eveyone that joins it wont be a problem. This also bans anyone with #A, #b, #c in there chan names

Last edited by Justin_F; 29/06/09 03:14 AM.
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
The prob is that the channels of the $3- reply may or may not have a leading status prefix like "@". But isin won't help you here as for example "#b" is in "@#banned_from_Q".

Give this a try (untested):
Code:
raw 319:*: {
  if ($2 ison #q) {

    ; put blacklisted channel names here, separated by space, WITHOUT the chantype prefix
    var %ban = a b c 2m-clan

    ; this part sets a variable which has the status prefix (e.g. @) and the chantype-char (e.g. #) removed from $3-
    var %regex = $+(/,(?<=^|\40),$chr(40),[,$prefix,]?,[,$chantypes,],$chr(41),(?=\S+),/g)
    var %cleaned = $regsubex($3-,%regex,$null)

    ; loop the words of %cleaned...
    var %n = 1
    while ($gettok(%cleaned,%n,32)) {
      ; ...and check if the current word is a blacklisted channel of "%ban"
      ; if it is: kickban the user out of #q, stop the loop
      if ($istok(%ban,$v1,32)) {
        ban -k #q $2 You're on a banned channel 
        return
      }
      ; if not: continue with next word
      inc %n
    }
  }
}

Last edited by Horstl; 29/06/09 03:17 AM.
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
You need to put that particular raw into a group, and enable the group before performing the whois.
You will also need to add raw 318, and disable the group when that is received.
Quote:
This also bans anyone with #A, #b, #c in there chan names
which is the proper response for how the code reads.
If this isn't what you're wanting, you're going to have to clarify what it is you want, as the code you are using doesn't match what you think it should be doing.

Last edited by RusselB; 29/06/09 03:20 AM.
Joined: Jan 2007
Posts: 31
J
Ameglian cow
OP Offline
Ameglian cow
J
Joined: Jan 2007
Posts: 31
Works 100% thanks!

Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
|| (#2m-clan isin $3-) (#m isin $3-)(#s isin $3-) ||

Found this error in your original code.


Link Copied to Clipboard