mIRC Home    About    Download    Register    News    Help

Print Thread
script for unacceptable channels #222952 10/07/10 03:21 PM
Joined: Jul 2010
Posts: 3
P
phillybob Offline OP
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!

Re: script for unacceptable channels [Re: phillybob] #222954 10/07/10 06:22 PM
Joined: Jun 2007
Posts: 933
5
5618 Offline
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

Re: script for unacceptable channels [Re: phillybob] #222960 10/07/10 07:46 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
There are Blacklist scripts on Hawkee that do what is being requested.

Re: script for unacceptable channels [Re: phillybob] #222962 10/07/10 09:17 PM
Joined: Jul 2007
Posts: 1,129
T
Tomao Offline
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
    }
  }
}

Re: script for unacceptable channels [Re: Tomao] #223031 12/07/10 02:58 PM
Joined: Feb 2009
Posts: 133
C
chacha Offline
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
Re: script for unacceptable channels [Re: chacha] #223034 12/07/10 05:23 PM
Joined: Jul 2007
Posts: 1,129
T
Tomao Offline
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.

Re: script for unacceptable channels [Re: Tomao] #223035 12/07/10 05:39 PM
Joined: Jul 2006
Posts: 3,889
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,889
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
Re: script for unacceptable channels [Re: Wims] #223037 12/07/10 07:33 PM
Joined: Jul 2007
Posts: 1,129
T
Tomao Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
You meant to say the original code was correct then?

Re: script for unacceptable channels [Re: Tomao] #223041 12/07/10 09:19 PM
Joined: Jul 2006
Posts: 3,889
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,889
yes


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