on *:TEXT:!vote_chan*:#:{
if ($nick == goldberg266) {
set %votechan $2
notice $nick 12 Done 12
set %vote off
set %voted blank
set %yesvote 0
set %novote 0
set %votes 0
set %voteq blank
timer99 off
}
else halt
}
on *:TEXT:!votes:%votechan:{
msg %votechan 12 Total votes started: %votenr 12
}
on *:TEXT:!reset_vote:%votechan:{
if ($nick == goldberg266) {
set %votenr 0
notice $nick 12 Done 12
}
else halt
}
on *:TEXT:!vote*:%votechan:{
if (%vote == off) {
if ($2- == $null) { halt }
msg %votechan 12 $2- 12
msg %votechan 12 Type !yes or !no to vote 12
set %voteq $2-
set %vote on
set %votehost $nick
timer99 0 60 votee
}
elseif (%vote == on) {
notice $nick 12 A vote is already started! 12
}
else halt
}
on *:TEXT:!stopvote*:%votechan:{
if (%votehost == $nick) {
if (%vote == on) {
msg %votechan %12 Vote stopped by $nick 12
set %vote off
set %voted blank
set %yesvote 0
set %novote 0
set %votes 0
set %votehost blank
set %voteq blank
timer99 off
}
else halt
}
elseif ($nick == goldberg266) {
msg %votechan 12 Vote stopped by $nick 12
set %vote off
set %voted blank
set %yesvote 0
set %novote 0
set %votes 0
set %votehost blank
set %voteq blank
timer99 off
}
}
on *:TEXT:!yes:%votechan:{
if (%vote == on) {
if ($matchtok(%voted,$address($nick,1),0,32) == 0) {
inc %yesvote
notice $nick 12 Voted succesfully 12
/set %voted %voted $address($nick,1)
}
}
else notice $nick 12 You have already voted! 12
}
on *:TEXT:!no:%votechan:{
if (%vote == on) {
if ($matchtok(%voted,$address($nick,1),0,32) == 0) {
inc %novote
notice $nick 12 Voted succesfully 12
/set %voted %voted $address($nick,1)
}
}
else notice $nick 12 You have already voted! 12
}
alias votee {
set %votes %novote + %yesvote
inc %votenr
if (%votes > 0) {
if (%yesvote > %novote) {
msg %votechan 12 Vote result: %voteq -- YES win with %yesvote votes. || Vote num: %votenr 12 }
elseif (%novote > %yesvote) {
msg %votechan 12 Vote result: %voteq -- NO win with %novote votes. || Vote nr: %votenr 12 }
elseif (%yesvote == %novote) {
msg %votechan 12 This vote was a draw, Yes: %yesvote No: %novote $+ || Vote nr: %votenr 12 }
set %vote off
set %voted blank
set %yesvote 0
set %novote 0
set %votes 0
set %voteq blank
timer99 off
}
elseif (%votes < 1) {
msg %votechan 12 Not enough votes! 12
set %vote off
set %voted blank
set %yesvote 0
set %novote 0
set %votes 0
set %voteq blank
timer99 off
}
}