on *:TEXT:!vote*:#: { if (%votestatus == 1) {
notice $nick A vote has already in progress.
halt
}
if (!$2) {
notice $nick You must specify a question.
halt
}
else {
set %vote $2-
set %votestatus [ 1 ]
msg $chan A vote has been started, type !vyes or !vno to vote, the vote will last 30 seconds.
msg $chan The question is: %vote
timer 1 30 msg $chan 4 The results of the vote %vote are: $results
timer 1 30 set %votestatus [ 0 ]
timer 1 31 set %vyes 0
timer 1 31 set %vno 0
}
}
on *:TEXT:!vyes:#: { if (%votestatus == 1) {
inc %vyes 1
notice $nick Thank you, your vote has been placed.
}
elseif (%votestatus == 0) {
notice $nick There is no vote, if you would like to start one type !vote <question>
}
}
on *:TEXT:!vno:#: { if (%votestatus == 1) {
inc %vno 1
notice $nick Thank you, your vote has been placed.
}
elseif (%votestatus == 0) {
notice $nick There is no vote, if you would like to start one type !vote <question>
}
}
alias results { return Yes: %vyes No: %vno }