All pastes #412557 Raw Edit

Miscellany

public text v1 · immutable
#412557 ·published 2007-03-27 19:39 UTC
rendered paste body
on *:text:!setpoll*:#: {
  if ($nick isop $chan) || ($nick ishop $chan) {
    set %poll $+ $chan $2-
    set %polls $+ $chan $nick
    set %polld $+ $chan $date
    set %polly $+ $chan 0
    set %polln $+ $chan 0
    /msg $chan 10New poll set by:4 $nick
    /msg $chan 10Poll date:4 $date
    /msg $chan 10Poll:4 $2-
    /msg $chan 10Type:4 !yes10 or4 !no10 :To vote!
    /msg $chan 10Type:4 !votes10 :To view current vote stats.
  }
}
on *:text:!yes*:#: {
  if ( $nick isin %voted [ $+ [ $chan ] ] ) {
    /notice $nick 10You have already voted!
  }
  else {
    inc %polly $+ $chan
    /notice $nick 10Vote counted.
    set %voted $+ $chan %voted [ $+ [ $chan ] ] $nick
  }
}
on *:text:!no*:#: {
  if ( $nick isin %voted [ $+ [ $chan ] ] ) {
    /notice $nick 10You have already voted!
  }
  else {
    inc %polln $+ $chan
    /notice $nick 10Vote counted.
    set %voted $+ $chan %voted [ $+ [ $chan ] ] $nick
  }
}
on *:text:!votes*:#: {
  /notice $nick 10Yes:4 %polly [ $+ [ $chan ] ] $chr(124) 10No:4 %polln [ $+ [ $chan ] ]
}
on *:text:!endpoll*:#: {
  if ($nick isop $chan) || ($nick ishop $chan) {
    /notice $nick 10Ending Poll...
    /msg $chan 10Poll ended...
    /msg $chan 10Poll set by:4 %polls [ $+ [ $chan ] ]
    /msg $chan 10Poll date:4 %polld [ $+ [ $chan ] ]
    /msg $chan 10Poll:4 %poll [ $+ [ $chan ] ]
    /msg $chan 10Couting votes...
    /msg $chan 10Yes:4 %polly [ $+ [ $chan ] ] $chr(124) 10No:4 %polln [ $+ [ $chan ] ]
    unset %poll $+ $chan 
    unset %polls $+ $chan 
    unset %polld $+ $chan 
    unset %polly $+ $chan 
    unset %polln $+ $chan 
    unset %voted $+ $chan
  }
}