rendered paste bodyon *:text:!poll *:#: {
set %gpoll on
amsg Global Poll started by $nick $+ . $$2- $+ ? Type !yes to answer yes and !no to answer no.
timer 1 60 amsg Global Poll Results: %pollyes Yes's and %pollno No's.
unset %pollyes
unset %pollno
unset %gpoll
}
on *:text:!yes *:#: {
if (%poll == on) {
if (%pollnick. [ $+ [ $nick ] ] != yes) {
set %pollnick. [ $+ [ $nick ] ] yes
inc %pollyes 1
notice $nick Thank you $nick for your vote.
unset %pollnick. [ $+ [ $nick ] ]
}
else {
notice $nick Please refrain from voting twice.
}
}
}
on *:text:!no *:#: {
if (%gpoll == on) {
set %pollnick. [ $+ [ $nick ] ] no
if (%pollnick. [ $+ [ $nick ] ] != no) {
inc %pollno 1
notice $nick Thank you $nick for you vote.
unset %pollnick. [ $+ [ $nick ] ]
}
else{
notice $nick Please refrain from voting twice..
}
}