All pastes #340519 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-02-04 21:01 UTC
rendered paste body
on *:TEXT:!vote*:#: {
  if ($2 !isnum 1-999) { .notice $nick you must specify a length }
  else {
    if ($nick !isreg $chan) {
      set %channelz $chan
      set %vote $3-
      .msg $chan Poll started. Will remain active for $2 minutes
    }
  }
  /timer1 1 $calc($2 *60) /unset %vote 
  if ($calc(%yes > %no)) { .msg $channelz poll closed. Winning vote: Yes} 
    if ($calc(%yes < %no)) { .msg $channelz poll closed. Winning vote: No} 
    }
  }
}
on *:TEXT:!yes:#: {
  if ($nick !isreg $chan) {
    /inc %yes 1
    .notice $nick ty for voting. There are now %yes yes'.
  }
}

on *:TEXT:!no:#: {
  if ($nick !isreg $chan) {
    /inc %no 1
    .notice $nick for voting. There are now %no no's.
  }
}


on *:TEXT:!poll:#: {
  if ($nick !isreg $chan) {
    if (%vote) {
      .notice $nick current poll: %vote
      else {
        .notice $nick There are no polls set. Type !vote Time Questions to start one.
      }
    }
  }
}