mIRC Homepage
Posted By: phillybob script for unacceptable channels - 10/07/10 03:21 PM
I've tried writing a script that would kick/ban someone who enters our room when he is also on an unacceptable channel. I've searched the postings and can't find anything. Can anyone help? I don't have much hair left to pull out.
Thanks!
Posted By: 5618 Re: script for unacceptable channels - 10/07/10 06:22 PM
You'd want to /whois the nick that joins the channel and then respond to the channels returned.
What you want to respond to is a raw numeric. To find out what numeric it is, you can use mIRC debug function, e.g. /debug @debug

Your script would then start like this.
Code:
raw 123:*:{ response code here }

123 is the example raw numeric here. The real numeric is *probably* 319
Posted By: RusselB Re: script for unacceptable channels - 10/07/10 07:46 PM
There are Blacklist scripts on Hawkee that do what is being requested.
Posted By: Tomao Re: script for unacceptable channels - 10/07/10 09:17 PM
Replace #chan1, #chan2, #chan3 etc..... with the bad channels
Code:
on @*:join:#:{
  $+(.timer,whois,#,$network,$nick) 1 1 whois $nick
}
raw 319:*: {
  var %b = #chan1 #chan2 #chan3 #chan4 #chan5 #chan6
  if ($istok(%b,$3,32)) {
    var %x = $comchan($2,0)
    while (%x) {
      if ($me isop $comchan($2,%x)) {
        ban -ku $v2 $2 2 unacceptable channel detected!
      }
      dec %x
    }
  }
}
Posted By: chacha Re: script for unacceptable channels - 12/07/10 02:58 PM
var %x $comchan($2,0).op
or directly on loop
Code:
raw 319:*:{
  var %b #chan1 #chan2 #chan3 #chan4 #chan5 #chan6
  if $istok(%b,$3,32) {
    var %x 1
    while $comchan($2,%x).op {
      ban -ku $v1 $2 2 unacceptable channel detected!
      inc %x
    }
  }
}
Posted By: Tomao Re: script for unacceptable channels - 12/07/10 05:23 PM
chacha, that's good to use $comchan($2,0) with the .op property. But you cannot use $v1 to have it returned as a channel. $comchan($2,0).op returns $true if the running client is opped. It'll become
Quote:
ban -k $true $2 2
and that won't work. You should have used:
Quote:
while $comchan($2,%x).op {
ban -k $comchan($2,%x) $2 2 unacceptable channel detected!
Yes, I accidentally put a -u switch there.
Posted By: Wims Re: script for unacceptable channels - 12/07/10 05:39 PM
His solution is still wrong, your orignal code was looping through all common chan and then checking, his code will stop whenever he isn't op on the channel
Posted By: Tomao Re: script for unacceptable channels - 12/07/10 07:33 PM
You meant to say the original code was correct then?
Posted By: Wims Re: script for unacceptable channels - 12/07/10 09:19 PM
yes
© mIRC Discussion Forums