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 <= %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
}
}