This is a vote kicker for rooms that you own and are not always in. It can be useful for when people whisper all of the voiced people in the room, annoying them.
It's currently untested but it should work fine.
on *:text:!vote*:#:{
if ($2 !isin kick,ban,yes,no) || (($3) && (!$ial(* $+ $3 $+ *).nick)) {
msg $chan The voting commands are: !vote kick nick & !vote ban nick
}
if ($ial(* $+ $3 $+ *).nick isop $chan) { msg $chan No votes allowed regarding hosts }
if ($2 isin kick,ban) {
if (%votekick) { msg $chan A vote is currently in progress. Please wait for it to end. }
set %votekick $2 $ial(* $+ $3 $+ *).nick
set %voteyes 1 | set %voteno 0 | set %voted $nick
.timervote 1 60 $votekick($chan)
}
if ($2 == yes) && (%votekick) { set %voted %voted $+ , $+ $nick | inc %voteyes }
if ($2 == no) && (%votekick) { set %voted %voted $+ , $+ $nick | inc %voteno }
}
alias -l votekick {
msg $1 The results for $gettok(%votekick,2,32) are - yes: %voteyes & no: %voteno
if (%voteyes > %voteno) {
kick $1 $gettok(%votekick,2,32) Voted kick
$$iif($gettok(%votekick,1,32) == ban,access $1 add deny $ial($gettok(%votekick,2,32).addr))
}
if (%voteno > %voteyes) { msg $1 $gettok(%votekick,2,32) will not be kicked. }
if (%voteyes == %voteno) { msg $1 It is a tie. Therefore $gettok(%votekick,2,32) will not be kicked. }
unset %vote*
}
Known issues:
1. It doesn't have a minimum vote count so someone could win a vote with 1 vote.
2. The person being voted on can vote.
3. You can do the same vote again directly afterwards.
1. You can just add the following to the second line of the alias:
if ($calc(%voteyes + %voteno) <= 4) { msg $1 There are not enough votes. | halt }
2. Replace set %voted $nick with this:
set %votek $nick $+ , $+ $ial(* $+ $3 $+ *).nick
3. Add an extra variable that unsets after a certain amount of time or when you/the person leave(s) the room. Couldn't really be bothered with that one.
Ps: I reckon Ozzy should have something along those lines for the gorup chat as people often advertise using invite or other disruptive means. Either that or employ hosts.