All pastes #108736 Raw Edit

Someone

public text v1 · immutable
#108736 ·published 2006-07-31 17:28 UTC
rendered paste body
on *:TEXT:!poll*:#:{ 
  if ($2 isnum) { 
    msg $chan $nick has started a poll: $3- for $2 minutes. 
    msg $chan Type !yes, or !no to count your vote. 
    set %yes 0 | set %no 0 
    /timerVOTE 1 $calc($2 * 60) signal -n results $chan 
  } 
  else { 
    msg $chan $nick has started a poll: $3- for 2 minutes. 
    msg $chan Type !yes, or !no to count your vote. 
    set %yes 0 | set %no 0 
    /timerVOTE 1 120 signal -n results $chan 
  } 
} 
on *:text:!yes:#:{ 
  .notice $nick Thank you for your vote, Yes has been counted! 
  inc %yes 1 
} 
on *:text:!no:#:{ 
  .notice $nick Thank you for your vote, No has been counted! 
  inc %no 1 
} 
on *:TEXT:!endpoll:#:{ 
  if (($timer(VOTE)) && ($nick isop $chan)) { 
    msg $chan The poll has been ended by $nick $+ .  The answer is $iif($(%yes,2) > $(%no,2),yes,$iif($(%yes,2) == $(%no,2),tie/no votes,no)) $+ 
    msg $chan Results: Yes: %yes $ceil($calc((%yes) /(%yes + %no) * 100)) $+ % 
    msg $chan No: %no $ceil($calc((%no) /(%yes + %no) * 100)) $+ % 
    timerVOTE off 
  } 
} 
on *:SIGNAL:results: { 
  /msg $1 The poll has ended. The answer is $iif($(%yes,2) > $(%no,2),yes,$iif($(%yes,2) == $(%no,2),It is a Tie votes,no)) $+ 
  Results: Yes: %yes $ceil($calc((%yes) /(%yes + %no) * 100)) $+ % 
  No: %no $ceil($calc((%no) /(%yes + %no) * 100)) $+ % 
  unset %yes | unset %no 
}