All pastes #162439 Raw Edit

Pol's script

public text v1 · immutable
·published 2006-09-06 14:47 UTC
rendered paste body
on *:text:!setpoll*:#shinzaki:{
  if (%pollquestion [ $+ [ $chan ] ] == $null ) { /notice $nick There is a poll running }  
  else {
    if (($nick isop $chan) && (%pollquestion != $null)) {
      /set %pollquestion [ $+ [ $chan ] ] $2-
      /msg $chan 7 A new Poll has been started. The current question is 5 $2-. 7To see the poll again, and your options for voting, type !poll
    }
  }
}
on *:text:!poll:#shinzaki:{
  notice $nick %pollquestion [ $+ [ $chan ] ]
  notice $nick If you vote yes, please type !vote yes
  notice $nick If you vote no, please type !vote no
}
on *:text:!vote*:#shinzaki:{
  if ( %pollvote. [ $+ [ $nick$chan ] ] == $null ) {
    If (($2 == yes) || ($2 == no)) { /set %poll [ $+ [ $chan ] ] [ $+ vote  ] [ $+ [ $nick ] ] $2 }
    if ($2 == yes) { 
      /inc %poll [ $+ [ $chan ] ] yes
      notice $nick Your answer has been registerd. You voted $2
    }
    if ($2 == no ) { 
      /inc %pollno [ $+ [ $chan ] ]
      notice $nick Your answer has been registerd. You voted $2
    }
  }
  else /notice $nick You have already voted in this Poll
}

on *:text:!stoppoll:#shinzaki:{
  if ($nick isop $chan) {
    msg $chan These where the results of the Poll: Yes ( %pollyes [ $+ [ $chan ] ] ) No ( %pollno [ $+ [ $chan ] ] )
    /unset %poll [ $+ [ $chan ] $+ ]
  }
}
on *:text:!pollresults:#shinzaki: { 
  msg $chan 13These are the current results of the running poll (Current pol: 7 $(%pollquestion))
  if (%pollyes == $null) { msg $chan 13 Number of 'Yes' answers: 70 }
  else msg $chan 13Number of 'Yes' answers: 7 $(%pollyes)
  if (%pollno == $null) { msg $chan 13 Number of 'No' answers: 70 }
  else msg $chan 13Number of 'No' answers: 7 $(%pollno)
  if ($nick isop $chan) {
    notice $nick To stop the running Poll, type !stoppoll
  }
}