napa182 commented on a Page, Vote  -  Aug 10, 2008

you could make this without useing a ini file and just by useing vars maybe somthing like this to get you started.. this is one i tossed together. you have to be an op or a halfop to start a vote as well as to use the results and clear commands..

on *:text:*:#:{ 
  if ($strip($1) == Vote && $nick(#,$nick,oh)) {
    if (!%vote.on && $2-) { 
      set %vote.on on 
      set %vote.quset $2-
      msg $chan $nick Has Asked The Question: %vote.quset 
      msg $chan Type !yes to Vote yes Or Type !no to Vote no.
    }
    else { .notice $nick Sorry there is a Vote going on Now or You didnt add a question to Vote on. }
  }
  if ($istok(!yes !no,$strip($1),32)) {
    if (%vote.on && !$($+(%,vote,.,nick,$nick),2)) {
      $iif($strip($1) == !yes,inc %vote.yes 1,inc %vote.no 1)
      set $+(%,vote,.,nick,$nick) yes 
      .notice $nick $iif($strip($1) == !yes,You Have Voted Yes.,You Have Voted No.) 
    } 
    else { .notice $nick There is either no Vote or you already have casted ur Vote. }
  }
  if ($strip($1) == !results && $nick(#,$nick,oh)) {
    if (%vote.on) {
      msg $chan The Results of the Vote Question: %vote.quset are. 
      msg $chan Yes: $iif(!%vote.yes,0,%vote.yes) Vote\'s No: $iif(!%vote.no,0,%vote.no) Vote\'s
    }
    else { .notice $nick There Is No Vote Goin on. }
  }
  if ($strip($1) == !clearvote && $nick(#,$nick,oh)) {
    if (%vote.on) {
      unset %vote.*
      .notice $nick Results and vote have been cleared 
    }
    else { .notice $nick There is no vote or results to clear }
  }
}
 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.