All pastes #592458 Raw Edit

Mine

public text v1 · immutable
#592458 ·published 2007-06-27 19:41 UTC
rendered paste body
on *:TEXT:!setpoll*:#:{ if ($nick isop $chan) || ($readini(staff.ini,click,$nick)) || ($readini(admin.ini,click,$nick)) { poll $chan $2

alias poll {
set %poll on
set %pollquestion $$2-
set %polltime $3
set %pollchan $1
set %pollnick $nick
set %halftime $calc($3 / 2)
msg %pollchan Poll started by %pollnick $+ . %pollquestion $+ ? Type !yes to answer yes and !no to answer no.
timer 1 %halftime There are %halftime Seconds left of the poll. %pollpeople people have voted so far.
timer 1 $3 msg $chan Poll results are: %pollyes Yes's and %pollno No's.

on $*:TEXT:!votes:#:{ if %poll != on { notice $nick There is no poll currently on! | halt } 
    msg %pollchan %votesyes people have said yes. 
    msg %pollchan %votesno people have said no. 

on *:text:!yes *:#: {
  if (%poll == on) {
    if (%pollnick. [ $+ [ $nick ] ] != yes) {
      set %pollnick. [ $+ [ $nick ] ] yes 
      inc %pollyes 1
inc %pollpeople 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
inc %pollpeople 1
      notice $nick Thank you $nick for you vote.
      unset %pollnick. [ $+ [ $nick ] ]
    }
    else{
    notice $nick Please refrain from voting twice..
  }
}