Vote

By DragonFlare on Aug 10, 2008

i gotta a little help on this i wrote the basic someone else wrote the modified version

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 }
  }
}

Comments

Sign in to comment.
napa182   -  Aug 11, 2008

you didnt have to update it to the one i made i was just showing you a diff way to do that script without useing ini files.
remember these are ur snippets you dont have to do anything people tell you to do.

 Respond  
DragonFlare   -  Aug 10, 2008

its been updated napa182

 Respond  
napa182   -  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  
DaNzO   -  Aug 10, 2008

Get it to add the nicks that voted, into the vote.ini.

Then make it check if the nick\'s name or host has already voted.

Or create a login script, that requires the user to login before voting.

  • DaNzO
 Respond  
BlueThen   -  Aug 10, 2008
on *:text:!yes*:#:{  

and

on *:text:!no*:#:{  

should maybe be just

on *:text:!yes:#:{  

and

on *:text:!no:#:{  

because the wildcard is pretty much useless if there\'s no necessary additional text.

 Respond  
napa182   -  Aug 10, 2008

maybe make it so people can only cast 1 vote per question instead of flooding the vote, and maybe have it tell you to type !yes or !no, and have it tell you the out come of the vote and have it delete it after the voting is said and done...
as well as have it so there has to be a vote going on to use the !yes/!no command.

 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.