Kick All Clones
#14185
05/03/03 07:30 AM
|
Joined: Dec 2002
Posts: 76
aZnLupin
OP
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 ?
|
|
|
Re: Kick All Clones
#14186
05/03/03 07:34 AM
|
Joined: Dec 2002
Posts: 774
theRat
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
|
|
|
Re: Kick All Clones
#14187
05/03/03 07:36 AM
|
Joined: Jan 2003
Posts: 148
Knappen
Vogon poet
|
Vogon poet
Joined: Jan 2003
Posts: 148 |
|
|
|
Re: Kick All Clones
#14188
05/03/03 08:02 AM
|
Joined: Dec 2002
Posts: 76
aZnLupin
OP
Babel fish
|
OP
Babel fish
Joined: Dec 2002
Posts: 76 |
|
|
|
Re: Kick All Clones
#14189
05/03/03 08:17 AM
|
Joined: Dec 2002
Posts: 1,321
Hammer
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
|
|
|
Re: Kick All Clones
#14190
05/03/03 08:26 AM
|
Joined: Dec 2002
Posts: 76
aZnLupin
OP
Babel fish
|
OP
Babel fish
Joined: Dec 2002
Posts: 76 |
All that i need
|
|
|
Re: Kick All Clones
#14191
05/03/03 08:52 AM
|
Joined: Dec 2002
Posts: 76
aZnLupin
OP
Babel fish
|
OP
Babel fish
Joined: Dec 2002
Posts: 76 |
If me is in clones nick, how can i except me in clones list ?
|
|
|
Re: Kick All Clones
#14192
05/03/03 11:40 AM
|
Joined: Dec 2002
Posts: 1,922
Online
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 }
|
|
|
Re: Kick All Clones
#14193
05/03/03 01:07 PM
|
Joined: Dec 2002
Posts: 143
Aubs
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.
|
|
|
Re: Kick All Clones
#14194
05/03/03 02:04 PM
|
Joined: Jan 2003
Posts: 2,523
qwerty
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
|
|
|
Re: Kick All Clones
#14195
05/03/03 05:20 PM
|
Joined: Dec 2002
Posts: 143
Aubs
Vogon poet
|
Vogon poet
Joined: Dec 2002
Posts: 143 |
&Channels are modeless - doesn't that mean you can't kick anyone?
Aubs.
|
|
|
Re: Kick All Clones
#14196
05/03/03 05:48 PM
|
Joined: Jan 2003
Posts: 2,523
qwerty
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
|
|
|
Re: Kick All Clones
#14197
06/03/03 08:00 AM
|
Joined: Dec 2002
Posts: 1,321
Hammer
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
|
|
|
Re: Kick All Clones
#14198
06/03/03 01:20 PM
|
Joined: Dec 2002
Posts: 143
Aubs
Vogon poet
|
Vogon poet
Joined: Dec 2002
Posts: 143 |
Yep, apologies Hammer... /me should have looked more closely!! Sorry
Aubs.
|
|
|
Re: Kick All Clones
#14199
16/07/03 01:41 PM
|
Joined: Jun 2003
Posts: 68
Dr4g0n
Babel fish
|
Babel fish
Joined: Jun 2003
Posts: 68 |
Cant it be doen some easier?
|
|
|
|
|