mIRC Homepage

channel detection

Posted By: BatSaly

channel detection - 21/02/06 07:40 PM

Hi,
My problem is in that .. I can't create this bad channel detector:

on @!*:join:#: {
whois $nick
raw 319:*: {
if ([censored] isin $3-) || (utopia isin $3-) || (kotro isin $3-) || (aspirex isin $3-) {
ban -u60 $chan $2
kick $chan $2 Bad channel detect!
}
}
}


smirk
And is it some way to get forbidden channels from some list %forbidden
and this protection to be only for protected channels from %protectedchannels, or something like that?
Thanks smile
Posted By: h4z4rd

Re: channel detection - 21/02/06 08:32 PM

on @!*:join:#: {
whois $nick
set %kick.chan $chan
}
raw 319:*: {
if ([censored] isin $3-) || (utopia isin $3-) || (kotro isin $3-) || (aspirex isin $3-) {
ban -u60 %kick.chan $2
kick %kick.chan $2 Bad channel detect!
}
}

that should work, u cant put raws inside an event
Posted By: PhantasyX

Re: channel detection - 22/02/06 12:12 AM

Maybe a little more advance, but clear coding:
Code:
on @!*:join:#: {
  set %kick.chan $chan
  .whois $nick
}

; Set %bad.channels to:
; *#bad.channel.name *#anotherchannelname *#Hitler *#KillClowns
; the *'s are used for wildcards, can also use them for better things like #b*ad*chane*name*XDCC*someword*

raw 319:*:{
  ; $istok is alot better then a lot of "isin" operators.
  ; This will loop thru the channels in %bad.channels comparing each one with
  ; With the channels the user is in. I used $wildtok because I know on some network
  ; show user mode prefixes infront of the chan. (Eg: ~#channel, @#channel, etc.)
  ; There is probably a more efficient way of doing this. =p

  var %x = 1,%y = $gettok(%bad.channels,0,32)
  while (%x <= %y) {
    if ($wildtok($3-,$gettok(%bad.channels,%x,32),0,32) > 0) { 
      ban -u60 %kick.chan $2
      kick %kick.chan $2 Bad channel detect! (60s ban)
    }
    inc %x
  }
}
Posted By: Vinniej

Re: channel detection - 22/02/06 11:31 PM

I just did it with a vipscript:

Code:
raw 319:*:{
  if (%vipcheck) {
    var %vipchan = @/+#badchannel
    if ($istok($3-,%vipchan,32)) { mode %vipopchan +b $address($2,1)
    kick %vipopchan %vipnick You are not welcome here tbh! }
  }
  unset %vip*
}

on *:join:#chan: {
  set %vipcheck $true
  set %vipopchan $chan
  set %vipnick $nick
  whois $nick
}
  
Posted By: SladeKraven

Re: channel detection - 22/02/06 11:35 PM

Code:
on [color:red]@[/color]*:join:#chan: {


I'd put the @ to check whether or not your're an op. I'd also add a check to see if you're an op prior to kicking.

-Andy
© 2021 mIRC Discussion Forums