mIRC Home    About    Download    Register    News    Help

Print Thread
#107944 15/01/05 05:16 AM
Joined: Jan 2005
Posts: 9
X
Xuxa Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
X
Joined: Jan 2005
Posts: 9
Hi everybody!

Sorry if this is a simplistic question but I'm new at this.

I have the script below to automatically kick/ban clones.

If I'm an op it will kick/ban a clone when it joins and it will echo the address and nicks.

If I'm not an op it obviously can't kick/ban but it also doesn't echo the address and nicks of a joining clone.

How can I make it echo the address and nicks of a joining clone if I'm not an op?

Thanks!

Code:
on @*:JOIN:#:{
  if ($ial == $false) .ial on
  if ($chan(#).ial == $false) { who # | return }
  var %total = $ialchan($wildsite,#,0)
  if (%total > 1) {
    ban # $nick 2
    var %i = 0
    while (%i < %total) {
      inc %i
      var %nick = $ialchan($wildsite,#,%i).nick
      var %all.nicks = $addtok(%all.nicks,%nick,32)
      if (%nick !isop #) {
        kick # %nick Clone detected from $wildsite ( $+ %total users)
      }
    }
    echo 14 -a Clone detected from $wildsite $+ : %all.nicks
  }
}

Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Ok, this is untested.
Code:
on *:JOIN:#: {
  if ($ial == $false) .ial on
  if ($chan(#).ial == $false) { who # | return }
  if ($me isop $chan) {
    var %total = $ialchan($wildsite,#,0)  
    if (%total > 1) {   
      ban # $nick 2  
      var %i = 0   
      while (%i < %total) { 
        inc %i      
        var %nick = $ialchan($wildsite,#,%i).nick    
        var %all.nicks = $addtok(%all.nicks,%nick,32)  
        if (%nick !isop #) {    
          kick # %nick Clone detected from $wildsite ( $+ %total users)   
        }  
      }    
      echo 14 -a Clone detected from $wildsite $+ : %all.nicks  
    }
  }
  else { 
    echo 14 -a Clone detected from $wildsite $+ : %all.nicks  
  }
}

Joined: Nov 2004
Posts: 332
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Nov 2004
Posts: 332
if your not a op on most servers you will get the masked version of their addy so you might want to account for that as it may throw your system off


The Kodokan will move you, one way or another.
Joined: Jan 2005
Posts: 9
X
Xuxa Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
X
Joined: Jan 2005
Posts: 9
Quote:
Ok, this is untested.

[code snipped]


It didn't quite work; it did echo but it failed to pick up the %all.nick variable.

I played around with it a bit and got some strange results but finally got it to work!

Thanks for your help! smile

Here's the code that worked...

Code:
on *:JOIN:#: {
  if ($ial == $false) .ial on
  if ($chan(#).ial == $false) { who # | return }
  var %total = $ialchan($wildsite,#,0)  
  if (%total > 1) {   
    ban # $nick 2  
    var %i = 0   
    while (%i < %total) { 
      inc %i      
      var %nick = $ialchan($wildsite,#,%i).nick    
      var %all.nicks = $addtok(%all.nicks,%nick,32) 
      if (%nick !isop #) {    
        kick # %nick Clone detected from $wildsite ( $+ %total users)   
      }  
    }    
    echo 14 -a Clone detected from $wildsite $+ : %all.nicks  
  }
  else if ($me isop $chan) {
    echo 14 -a Clone detected from $wildsite $+ : %all.nicks
 }
}


One thing has me puzzled though; doesn't else if ($me isop $chan) mean if I am an op? confused

It does however seem to work as I want.

Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Yes, if ($me isop $chan) checks whether you are an operator or not, the same way the @ prefix works.

Joined: Jan 2005
Posts: 9
X
Xuxa Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
X
Joined: Jan 2005
Posts: 9
Aha, I get it now; I didn't notice you removed the @ blush

I tried the original script minus the @ and it now echos but tries to kick/ban even when I'm not an op.

I should be able to sort things out from here by myself.

Thanks again for your help!

Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
You're welcome. smile

Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
You will never be an op when you join a channel, so if ($me isop $chan) will always be $false.


New username: hixxy
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
The on join event triggers when anyone joins the channel, not just you.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
I'm sure I saw an if ($nick == $me) in there, oh well.


New username: hixxy

Link Copied to Clipboard