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
}
}
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.
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.