mIRC Homepage
Posted By: Justin_F Whois users on join and autoban - 29/06/09 02:03 AM
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
Posted By: argv0 Re: Whois users on join and autoban - 29/06/09 02:24 AM
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.
Posted By: Justin_F Re: Whois users on join and autoban - 29/06/09 02:28 AM
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
Posted By: Horstl Re: Whois users on join and autoban - 29/06/09 03:15 AM
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
    }
  }
}
Posted By: RusselB Re: Whois users on join and autoban - 29/06/09 03:17 AM
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.
Posted By: Justin_F Re: Whois users on join and autoban - 29/06/09 03:25 AM
Works 100% thanks!
Posted By: DJ_Sol Re: Whois users on join and autoban - 29/06/09 07:23 AM
|| (#2m-clan isin $3-) (#m isin $3-)(#s isin $3-) ||

Found this error in your original code.
© mIRC Discussion Forums