|
Joined: Dec 2002
Posts: 76
Babel fish
|
OP
Babel fish
Joined: Dec 2002
Posts: 76 |
Need script like kick all clones if user same ip together, can you help me ?
|
|
|
|
Joined: Dec 2002
Posts: 774
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 774 |
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.
//if ( khaled isgod ) echo yes | else echo no
|
|
|
|
Joined: Jan 2003
Posts: 148
Vogon poet
|
Vogon poet
Joined: Jan 2003
Posts: 148 |
|
|
|
|
Joined: Dec 2002
Posts: 76
Babel fish
|
OP
Babel fish
Joined: Dec 2002
Posts: 76 |
|
|
|
|
Joined: Dec 2002
Posts: 1,321
Hoopy frood
|
Hoopy frood
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.
alias clonekick {
var %reason = -CloneKick- | ; Kick reason template
| ;
if #* iswm $1 && $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
|
|
|
|
Joined: Dec 2002
Posts: 76
Babel fish
|
OP
Babel fish
Joined: Dec 2002
Posts: 76 |
All that i need
|
|
|
|
Joined: Dec 2002
Posts: 76
Babel fish
|
OP
Babel fish
Joined: Dec 2002
Posts: 76 |
If me is in clones nick, how can i except me in clones list ?
|
|
|
|
Joined: Dec 2002
Posts: 1,922
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,922 |
Replace this line -
kick %chan $ifmatch %reason With:
if ($ifmatch isop %chan) { kick %chan $ifmatch %reason }
|
|
|
|
Joined: Dec 2002
Posts: 143
Vogon poet
|
Vogon poet
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!)
Aubs.
|
|
|
|
Joined: Jan 2003
Posts: 2,523
Hoopy frood
|
Hoopy frood
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 if #* iswm $1 && $2 ison $1Wouldn'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 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
|
|
|
|
Joined: Dec 2002
Posts: 143
Vogon poet
|
Vogon poet
Joined: Dec 2002
Posts: 143 |
&Channels are modeless - doesn't that mean you can't kick anyone?
Aubs.
|
|
|
|
Joined: Jan 2003
Posts: 2,523
Hoopy frood
|
Hoopy frood
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
|
|
|
|
Joined: Dec 2002
Posts: 1,321
Hoopy frood
|
Hoopy frood
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 peopleThat'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.
DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
|
|
|
|
Joined: Dec 2002
Posts: 143
Vogon poet
|
Vogon poet
Joined: Dec 2002
Posts: 143 |
Yep, apologies Hammer... /me should have looked more closely!! Sorry
Aubs.
|
|
|
|
Joined: Jun 2003
Posts: 68
Babel fish
|
Babel fish
Joined: Jun 2003
Posts: 68 |
Cant it be doen some easier?
|
|
|
|
|