mIRC Home    About    Download    Register    News    Help

Print Thread
#14185 05/03/03 07:30 AM
Joined: Dec 2002
Posts: 76
A
Babel fish
OP Offline
Babel fish
A
Joined: Dec 2002
Posts: 76
Need script like kick all clones if user same ip together, can you help me ?

#14186 05/03/03 07:34 AM
Joined: Dec 2002
Posts: 774
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 774
Code:
alias clonekick {
  if ( $1 ) {
    var %i = 1
    while ( $gettok($ialchan($address($1,2),#,%i),1,33) ) {
      kick # $ifmatch $2-
      inc %i
    }
  }
}


Use: /clonekick <nick>
Kicks all the users on channel with same host as <nick>

Last edited by theRat; 05/03/03 07:41 AM.

Code:
//if ( khaled isgod ) echo yes | else echo no
#14187 05/03/03 07:36 AM
Joined: Jan 2003
Posts: 148
K
Vogon poet
Offline
Vogon poet
K
Joined: Jan 2003
Posts: 148
mode $chan +b $wildsite

#14188 05/03/03 08:02 AM
Joined: Dec 2002
Posts: 76
A
Babel fish
OP Offline
Babel fish
A
Joined: Dec 2002
Posts: 76
Thanks for help

#14189 05/03/03 08:17 AM
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
$wildsite will be $null if you're not in an event that fills that identifier with data.

In order to save your loop from having to resolve the address mask each time through the loop, it would be better to use a variable to hold that data.
Code:

alias clonekick {
 
  var %reason = -CloneKick-                    | ; Kick reason template
                                               | ;  
  if #* iswm $1 &amp;&amp; $2 ison $1 {                | ; /clonekick #Channel CloneNick blah blah
    var %chan = $1                             | ;     %chan   = #Channel
    var %nick = $2                             | ;     %nick   = CloneNick
    %reason = %reason $3-                      | ;     %reason = (-CloneKick- blah blah)
  }                                            | ; 
  elseif $1 ison $active {                     | ; /clonekick CloneNick Begone, schizophrenic!
    var %chan = $active                        | ;     %chan   = active window
    var %nick = $1                             | ;     %nick   = CloneNick
    %reason = %reason $2-                      | ;     %reason = (-CloneKick- Begone, schizophrenic!)
  }                                            | ;  
  else return                                  | ; If no matching condition, halt
                                               | ;  
  var %wildsite = $address(%nick, 2)           | ; *!*@host.domain
  var %i = 1                                   | ; Loop index
                                               | ;  
  while $ialchan(%wildsite, %chan, %i).nick {  | ; While there are more clones
    kick %chan $ifmatch %reason                | ;     kick a clone
    inc %i                                     | ;     move on to the next one
  }
}

/clonekick #mIRC clonenick1 blah blah blah4
/clonekick clonenick1 Begone, you schizophrenic escapee!


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
#14190 05/03/03 08:26 AM
Joined: Dec 2002
Posts: 76
A
Babel fish
OP Offline
Babel fish
A
Joined: Dec 2002
Posts: 76
All that i need wink

#14191 05/03/03 08:52 AM
Joined: Dec 2002
Posts: 76
A
Babel fish
OP Offline
Babel fish
A
Joined: Dec 2002
Posts: 76
If me is in clones nick, how can i except me in clones list ?

#14192 05/03/03 11:40 AM
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
Replace this line -
Code:

kick %chan $ifmatch %reason

With:
Code:

if ($ifmatch isop %chan) { kick %chan $ifmatch %reason }

#14193 05/03/03 01:07 PM
Joined: Dec 2002
Posts: 143
A
Vogon poet
Offline
Vogon poet
A
Joined: Dec 2002
Posts: 143
Your example wouldn't work Hammer, simply because:

/clonekick CloneNick Begone, schizophrenic!

elseif $1 ison $active {

but $1 = Begone,

and if Begone is a nick, then he/she will not be targeted if you use the " , "

(Think I'm right!)

smirk


Aubs.
cool

#14194 05/03/03 02:04 PM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
First of all, I really like the way you comment your script with | ;comment, it looks very good. The fact that you didn't use ( ) brackets in your /if statements makes it even prettier too wink


if #* iswm $1 && $2 ison $1

Wouldn't a "if $2 ison $1" be enough? It can never be true if $1 isn't a channel. Furthermore, it wouldn't work on &channels (or any other type of channels supported by the server), although this would be a very rare occasion. You could overdo it by having something like "if $left($1,1) isin $chantypes" but I think just omitting the 1st condition is enough smile

You might wanna throw an "if $me !isop %chan" check in there too (right after "else return"), although somebody could have a higher mode (not @ - op) that would allow him to kick people, in which case you would probably need a
"if $nick(%chan,$me,$left($prefix,$pos($prefix,@)))"
but that's a bit far-fetched too :tongue:


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
#14195 05/03/03 05:20 PM
Joined: Dec 2002
Posts: 143
A
Vogon poet
Offline
Vogon poet
A
Joined: Dec 2002
Posts: 143
&Channels are modeless - doesn't that mean you can't kick anyone?


Aubs.
cool

#14196 05/03/03 05:48 PM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
&channels aren't modeless. Read section 1.3 of the IRC RFC, you'll see they are channels local to the server.

In any way, &channels was just an example, there are ircds that allow other channel prefixes and at least some of those are not modeless.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
#14197 06/03/03 08:00 AM
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
Aubs:
/clonekick CloneNick Begone, schizophrenic!

%chan == $active (not specified)
%nick == CloneNick ($1)
%reason == -CloneKick- Begone, schizophrenic! ($2-)

and if Begone is a nick, then he/she will not be targeted if you use the " , "

If Begone is the nick you are trying to kick, then the command would be /clonekick Begone Begon, schizophrenic!

#channel - normal channel
&channel - local channel (on $server only)
+channel - modeless channel

qwerty:
Wouldn't a "if $2 ison $1" be enough?

Yup, it certainly would be enough. I removed it from the elseif (condition) but forgot to remove it from the if (condition).

"if $me !isop %chan" <snip /> although somebody could have a higher mode (not @ - op) that would allow him to kick people

That's why I omitted that particular check + return. With new op-type modes/statuses coming out fairly regularly, I figured that the best way to deal with that is to simply let them get the error messages from the server if there is a problem and then let them correct the problem. cool



DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
#14198 06/03/03 01:20 PM
Joined: Dec 2002
Posts: 143
A
Vogon poet
Offline
Vogon poet
A
Joined: Dec 2002
Posts: 143
Yep, apologies Hammer... /me should have looked more closely!!

Sorry smile


Aubs.
cool

#14199 16/07/03 01:41 PM
Joined: Jun 2003
Posts: 68
D
Babel fish
Offline
Babel fish
D
Joined: Jun 2003
Posts: 68
Cant it be doen some easier?


Link Copied to Clipboard