mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jul 2010
Posts: 3
P
Self-satisified door
OP Offline
Self-satisified door
P
Joined: Jul 2010
Posts: 3
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!

Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
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

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
There are Blacklist scripts on Hawkee that do what is being requested.

Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
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
    }
  }
}

Joined: Feb 2009
Posts: 133
C
Vogon poet
Offline
Vogon poet
C
Joined: Feb 2009
Posts: 133
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
    }
  }
}


WorldDMT
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
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.

Joined: Jul 2006
Posts: 4,187
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,187
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


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
You meant to say the original code was correct then?

Joined: Jul 2006
Posts: 4,187
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,187
yes


#mircscripting @ irc.swiftirc.net == the best mIRC help channel

Link Copied to Clipboard