mIRC Home    About    Download    Register    News    Help

Print Thread
Kick random 5 #129586 07/09/05 07:45 PM
Joined: Jul 2005
Posts: 19
E
encom Offline OP
Pikka bird
OP Offline
Pikka bird
E
Joined: Jul 2005
Posts: 19
Hello all again wink

I need a random kick 5 script.
So it kicked's 5 random people.

Does anyone got it or got a link to it?

Thanks allot!

Re: Kick random 5 #129587 07/09/05 08:08 PM
Joined: Sep 2005
Posts: 116
I
Im2good4u Offline
Vogon poet
Offline
Vogon poet
I
Joined: Sep 2005
Posts: 116
omg your evil

Re: Kick random 5 #129588 07/09/05 08:15 PM
Joined: Sep 2005
Posts: 116
I
Im2good4u Offline
Vogon poet
Offline
Vogon poet
I
Joined: Sep 2005
Posts: 116
;$1 = nummer of nicks to kick
alias randomkick {
var i = 0
for(i=0;i<=$1;i++){
kick $chan $nick($chan,random(1,$nick($chan,0),a,o)
}
}
^^ dont ask ( i jsut wrote in like 1 min and didnt test laugh)

Re: Kick random 5 #129589 07/09/05 08:54 PM
Joined: Dec 2002
Posts: 1,245
M
MikeChat Offline
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
maybe this
Code:
alias kick5 {
  var %nicksall = $nick(#,0)
  var %i = 5
  var %kicknicks
  while (%i) {
    var %nicknow = $nick(#,$r(%i,%nicksall))
    if (%nicknow !isop $chan) { 
      if (%nicknow != $me) {
        if (%nicknow !isin %kicknicks) { 
          var %kicknicks = %kicknicks %nicknow  
        }
      }
    }
    dec %i
  }
  var %k = 1
  while (%k &lt;= 5) { 
    kick # $gettok(%kicknicks,%k,32) 
    inc %k
  }
}

Re: Kick random 5 #129590 07/09/05 09:03 PM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
There isn't a "for" command in mIRC. Also, use [[b][/b]code] tags around code, please. It makes it easier to read.

Code:
alias rk {
  if ($chan == $null || $me !isop $chan) { echo -a Error: You must be on the channel and opped to use this command. | return }
  var %i = 1
  var %x = $1
  if (%x == $null) { var %x = 5 }
  while (%i &lt;= %x) {
    var %nick = $nick($chan,$rand(1,$nick($chan,0)))
    while (%nick != $me) {
      var %nick = $nick($chan,$rand(1,$nick($chan,0)))
    }
    kick $chan %nick What bad luck... You have been randomly kicked.
    inc %i
  }
}


If you just type /rk in a channel, it will randomly kick 5 people. If you include a number after it, it will randomly kick that number of people. It will only work if you use it IN a channel and if you're opped (or it will give an error). It will also not kick you.

If you have questions, just ask.


Invision Support
#Invision on irc.irchighway.net
Re: Kick random 5 #129591 07/09/05 09:06 PM
Joined: Sep 2005
Posts: 116
I
Im2good4u Offline
Vogon poet
Offline
Vogon poet
I
Joined: Sep 2005
Posts: 116
yours to complicated laugh

Re: Kick random 5 #129592 07/09/05 09:11 PM
Joined: Apr 2003
Posts: 701
K
Kelder Offline
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
mIRC doesn't have a for loop...

It's probably a good way to get yourself flooded off, deopped, banned or K-lined, but suit yourself...
I also added some error checking and prevented choosing yourself as random target smile

Code:
; kick 3 random people in current channel: /randomkick 3
; kick 2 random people in given channel: /randomkick 2 #channelnamealias randomkick {
  var %i = $$iif($1 isnum 1-5,$1), %c = $$iif($2 ischan,$2,$chan)
  while ((%i) &amp;&amp; ($nick(%c,0) &gt; 1)) {
    if ($nick(%c,$rand(1,$v2)) == $me) continue
    kick %c $v1
    dec %i
  }
}


edit: ok apparently I type too slow, 3 replies during the time I type mine frown

Last edited by Kelder; 07/09/05 11:11 PM.
Re: Kick random 5 #129593 07/09/05 09:23 PM
Joined: Sep 2005
Posts: 116
I
Im2good4u Offline
Vogon poet
Offline
Vogon poet
I
Joined: Sep 2005
Posts: 116
Quote:
mIRC doesn't have a for loop...

It's probably a good way to get yourself flooded off, deopped, banned or K-lined, but suit yourself...
I also added some error checking and prevented choosing yourself as random target smile

oke mine doesnt kick ops so u wont targer tourself here is the non for ( ) version
Code:
;$1 = nummer of nicks to kick
alias randomkick {
  var i = 0
  while(i&lt;=$1){
    kick $chan $nick($chan,random(1,$nick($chan,0),a,o)
    i++
  }
}
easy laugh

Re: Kick random 5 #129594 07/09/05 10:47 PM
Joined: Dec 2002
Posts: 3,547
S
SladeKraven Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
You are joking right? That isn't easy nor is it correct.

Blue is correct.
Red is incorrect.

Code:
;$1 = nummer of nicks to kick
[color:blue]alias randomkick {[/color]
  [color:red]var i = 0[/color]
  [color:red]while(i&lt;=$1){[/color]
    [color:red]kick $chan $nick($chan,random(1,$nick($chan,0),a,o)[/color]
    [color:red]i++[/color]
  [color:red]}[/color]
[color:blue]}[/color]


Corrections to your code line by line.

[*]var %i = 1
[*]while (%i <= $1) {
[*]The KICK command definitely wouldn't have worked because there is no $random() identifier and you didn't include %i in the $nick() call.
[*]The main reason it wouldn't have worked is because you didn't incease the var. (i++[/color should be inc %i)

Points you may want to take note to:

[*]Spacing is vital in code so make sure you view the help file thouroughly.
[*]You may want to stick to the language you've been writing in..
[*]You may want to test the code before you post it.

You could also try something a little like:

Code:
alias randk {
  var %i = 1
  while (%i &lt;= $2) {
    if (($nick($1,%i) !isop $1) &amp;&amp; ($nick($1,%i) != $me)) {
      kick $1 $nick($1,%i) $3-
    }
    inc %i
  }
}


/randk <#channel> <Number of people> <Reason if you want>

-Andy

Re: Kick random 5 #129595 08/09/05 10:01 AM
Joined: Dec 2002
Posts: 2,984
Watchdog Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 2,984
The best way to help people is to smoke test any scripts you write before giving them to others. Also take the time to tell un-knowldgable people what each part of the script does, either by ;comments or by an explanation after the code is presented.

Quote:
^^ dont ask ( i jsut wrote in like 1 min and didnt test)


That is hardly any help at all.


Induced IRC
irc.induced.net
Re: Kick random 5 #129596 08/09/05 02:27 PM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
Please remember before posting code here to help people, that the the code should be mIRC's scripting language and not C++.

  • Variables must have a % in the name.
  • ++ doesn't increment and -- doesn't decrement in mIRC


Btw, my code wasn't "too complicated" ...

Code:
alias rk {
  [color:blue]; Give an error if called from a query or chat window instead of a channel window, or if you're not opped.[/color]
  if ($chan == $null || $me !isop $chan) { echo -a Error: You must be on the channel and opped to use this command. | return }
  [color:blue]; Set variables.  %i is the counter.  %x is the number to kick... it's set so that a default can be added[/color]
  var %i = 1
  var %x = $1
  [color:blue]; Allow 5 to be the default so that you don't have to type a number to kick[/color]
  if (%x == $null) { var %x = 5 }
  [color:blue]; Loop.[/color]
  while (%i &lt;= %x) {
    [color:blue]; Set %nick to a random nick in the channel[/color]
    var %nick = $nick($chan,$rand(1,$nick($chan,0)))
    [color:blue]; If %nick is $me, get a new random nick.  If not, continue.[/color]
    while (%nick != $me) {
      var %nick = $nick($chan,$rand(1,$nick($chan,0)))
    }
    [color:blue]; Kick nick with reason.[/color]
    kick $chan %nick What bad luck... You have been randomly kicked.
    inc %i
  }
}

Last edited by Riamus2; 08/09/05 02:34 PM.
Re: Kick random 5 #129597 08/09/05 02:29 PM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
Andy, your code isn't random. It just kicks the first X people in the channel, other than yourself. laugh


Invision Support
#Invision on irc.irchighway.net
Re: Kick random 5 #129598 08/09/05 04:50 PM
Joined: Sep 2005
Posts: 116
I
Im2good4u Offline
Vogon poet
Offline
Vogon poet
I
Joined: Sep 2005
Posts: 116
Quote:
You are joking right? That isn't easy nor is it correct.

Blue is correct.
Red is incorrect.

Code:
;$1 = nummer of nicks to kick
[color:blue]alias randomkick {[/color]
  [color:red]var i = 0[/color]
  [color:red]while(i&lt;=$1){[/color]
    [color:red]kick $chan $nick($chan,random(1,$nick($chan,0),a,o)[/color]
    [color:red]i++[/color]
  [color:red]}[/color]
[color:blue]}[/color]


Corrections to your code line by line.

[*]var %i = 1
[*]while (%i <= $1) {
[*]The KICK command definitely wouldn't have worked because there is no $random() identifier and you didn't include %i in the $nick() call.
[*]The main reason it wouldn't have worked is because you didn't incease the var. (i++[/color should be inc %i)

Points you may want to take note to:

[*]Spacing is vital in code so make sure you view the help file thouroughly.
[*]You may want to stick to the language you've been writing in..
[*]You may want to test the code before you post it.

You could also try something a little like:

Code:
alias randk {
  var %i = 1
  while (%i &lt;= $2) {
    if (($nick($1,%i) !isop $1) &amp;&amp; ($nick($1,%i) != $me)) {
      kick $1 $nick($1,%i) $3-
    }
    inc %i
  }
}


/randk <#channel> <Number of people> <Reason if you want>

-Andy
good atleast u give some real reason about whuts wrong

i have had to much C lol

i indeed forgot the % and i++ should have been inc %i`yes but the random does exist its jsut $rand instead of $random!!!! the eason i didnt incluse %i in the kick command is becase i dont need it i only use it to kick $1 nummer of ppl so the wile loop does it $1 nummer of times

bu sorry guys u where right i coded i to fast lol laugh i do know mirc scripts but after writing in dll's my mind was a litle on C grin
so i tink it should have been this
Code:
;$1 = nummer of nicks to kick
alias randomkick {
  var %i = 0
  while(%i &lt;= $1) {
    kick $chan $nick($chan,rand(1,$nick($chan,0),a,o)
    inc %i 1
  }
}

Re: Kick random 5 #129599 08/09/05 05:29 PM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
Btw, there is still a problem in there. You can't use $N in a while loop. It loses the value after the first time through, so you need to store it.


Invision Support
#Invision on irc.irchighway.net
Re: Kick random 5 #129600 08/09/05 05:36 PM
Joined: Apr 2003
Posts: 701
K
Kelder Offline
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
Since when can't you use $1 in a while loop?

/test 5 works just fine here (mIRC v6.16)
Code:
alias test {
  var %i = 1
  while (%i &lt; $1) {
    echo TEST: %i ; $1
    inc %i
  }
}

As for his script: $rand instead of rand, a space after the while and it might have worked...

Re: Kick random 5 #129601 08/09/05 05:36 PM
Joined: Sep 2005
Posts: 116
I
Im2good4u Offline
Vogon poet
Offline
Vogon poet
I
Joined: Sep 2005
Posts: 116
Quote:
Btw, there is still a problem in there. You can't use $N in a while loop. It loses the value after the first time through, so you need to store it.
ah oke i didnt know that laugh
so its
Code:
;$1 = nummer of nicks to kick
alias randomkick {
  var %nummerofkicks = $1
  var %i = 1
  while(%i &lt;= %nummerofkicks) {
    kick $chan $nick($chan,$rand(1,$nick($chan,0),a,o)
    inc %i 1
  }
}
:tongue:

oops i saw i forgot the $ whne i made $random to $rand frown

Last edited by Im2good4u; 08/09/05 05:39 PM.
Re: Kick random 5 #129602 08/09/05 05:37 PM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
Does it? I've tried in the past and had it lose the value. Hm. I'll have to go through and run some tests.

EDIT:
Hm... I can't seem to duplicate it on 6.16 and I don't have 6.14 right now... and I think that's where I had the issues. I'll have to try and remember to check it tonight.

Last edited by Riamus2; 08/09/05 05:43 PM.

Invision Support
#Invision on irc.irchighway.net
Re: Kick random 5 #129603 11/09/05 06:32 PM
Joined: Sep 2005
Posts: 3
D
DuNnoO Offline
Self-satisified door
Offline
Self-satisified door
D
Joined: Sep 2005
Posts: 3
witch of all this scrips is working now..
pls giv the rigth one !


greetz

Re: Kick random 5 #129604 12/09/05 01:11 PM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
My script, or Im2good4u's most recent script, should work fine. Mine does offer the ability to kick any users randomly rather than only non-ops. It also gives a default number of people to kick (with the ability to kick more or less) and error messages when doing something wrong.


Invision Support
#Invision on irc.irchighway.net