Votekick script

By SenseiMan on Aug 05, 2009

Hello, this is a script I made that allows channel operators to call votes, to kick a certain person from the channel.

Remember to set %kickchan to the channel you want, and %kicktime to the amount of time you want to wait before the vote ends.

Functions are:

!votekick "name"
This calls a vote to kick someone from the channel.

!yes
Votes yes.

!no
Votes no.

The person will be kick from the channel if the number of yes votes are higher than no. The person will not be kicked if the votes are equal.

This script includes a hostname check, so people can't vote twice, or change their nick and revote.

Special thanks to Jertho_ and RusselB for helping me with some of this script.

alias -l firetimer {
  if (%up > %down) {
    msg %kickchan Vote passed! Yes: %up - No: %down
    kick %kickchan %nick
  }
  else {
    msg %kickchan Vote Failed! Yes: %up - No: %down
  }
}

on *:text:!votekick *:#: {
  set %kickchan #CHANNEL
  set %kicktime 15
  set %exceptions
  if (%voteon == on) {
    notice $nick A votekick is already taking place.
  }
  else {
    if ($nick isop %kickchan) {
      set %nick $$2
      set %voteon on
      if (%voteon == on) {
        .timer 1 %kicktime firetimer
        .timer 1 %kicktime set %voteon off
        .timer 1 %kicktime unset %voted
        .timer 1 %kicktime set %up 0
        .timer 1 %kicktime set %down 0
        set %voteon on
        msg %kickchan Voting to kick %nick has started. Type !yes or !no to vote.
      }
    }
    else {
      notice $nick You need to be a channel operator to call a votekick.
      halt
    }
  }
}

on *:text:!yes:#: {
  if ($istok(%voted,$address,32)) {
    notice $nick You have already voted.
    halt
  }
  if (%voteon == off) {
    notice $nick Voting is currently off.
    halt
  }
  else {
    %voted = $addtok(%voted,$address,32)
    inc %up 1
    msg %kickchan Yes: %up - No: %down
  }
}

on *:text:!no:#: {
  if ($istok(%voted,$address,32)) {
    notice $nick You have already voted.
    halt
  }
  if (%voteon == off) {
    notice $nick Voting is currently off.
    halt
  }
  if (%voteon == on) {
    %voted = $addtok(%voted,$address,32)
    inc %down 1
    msg %kickchan Yes: %up - No: %down
  }
}

Comments

Sign in to comment.
indkeys   -  Jan 15, 2010

Thank you for sharing this with us, I have been looking
for a script similar to this. I have a few questions though.

Are you able to install this on a bot ?

How would one change the script to enable any user to call for a vote ?
ie: User would type !Rule8 (nickhere) aye or nay as the case maybe.

I presume it is possible to incorporate this to kick/ban a user for a
period of time, ie: 3hours. with a change of wording.

Sorry for my ignorance but I am very new to scripting.

 Respond  
Master-Of-Death   -  Jan 05, 2010
alias -l firetimer {
  if (%up > %down) {
    msg %kickchan Vote passed! Yes: %up - No: %down
    kick %kickchan %nick
  }
  else {
    msg %kickchan Vote Failed! Yes: %up - No: %down
  }
}

on *:text:!votekick *:#: {
  set %kickchan #CHANNEL
  set %kicktime 15
  set %exceptions
  if (%voteon == on) {
    notice $nick A votekick is already taking place.
  }
  else {
    if ($nick isop %kickchan) {
      set %nick $$2
      set %voteon on
      if (%voteon == on) {
        .timer 1 %kicktime firetimer
        .timer 1 %kicktime set %voteon off
        .timer 1 %kicktime unset %voted
        .timer 1 %kicktime set %up 0
        .timer 1 %kicktime set %down 0
        set %voteon on
        msg %kickchan Voting to kick %nick has started. Type !yes or !no to vote.
      }
    }
    else {
      notice $nick You need to be a channel operator to call a votekick.
      halt
    }
  }
}

on *:text:!yes:#: {
  if ($istok(%voted,$address,32)) {
    notice $nick You have already voted.
    halt
  }
  if (%voteon == off) {
    notice $nick Voting is currently off.
    halt
  }
  else {
    %voted = $addtok(%voted,$address,32)
    inc %up 1
    msg %kickchan Yes: %up - No: %down
  }
}

on *:text:!no:#: {
  if ($istok(%voted,$address,32)) {
    notice $nick You have already voted.
    halt
  }
  if (%voteon == off) {
    notice $nick Voting is currently off.
    halt
  }
  if (%voteon == on) {
    %voted = $addtok(%voted,$address,32)
    inc %down 1
    msg %kickchan Yes: %up - No: %down
  }
}

Revised to be a game for channels.

 Respond  
SenseiMan   -  Aug 16, 2009

Either works fine. Also, I've updates it to fix something.

 Respond  
Bunterron   -  Aug 08, 2009

Nicee!!! to change the timer and chan is it /set %kickchan #here or do you have to go into script and change manualy

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.