Voting Script

By WacKy- on Jan 22, 2005

Simple Voting Script, , only for YES or NO , ie : ' !vote Is Wacky pr0 ? , type !yes or !no to vote ' , :)

;commands;
;!vote <anything you want here;
;!yes to vote yes;
;!no to vote no;
;!stopvote to stop vote;
;!vote on to turn it on;
;!vote off to turn it off
;!status < will tell u the current status of the vote.

on 1:TEXT:*!vote on*:#:{
  if (%voting == ON) { msg $chan Voting Is Allready Enabled $nick $+ .
  }
  elseif ($readini(level-100.ini,$nick,$address($nick,2) == 100)) {
    set %voting ON
    unset %vote*
    /remini voted.ini VOTED
    msg $chan Voting Is Now Enabled.
  }
}

on 1:TEXT:*!vote off*:#:{
  if (%voting == OFF) { msg $chan Voting Is Allready Disabled $nick $+ .
  }
  elseif ($readini(level-100.ini,$nick,$address($nick,2) == 100)) {
    set %voting OFF
 unset %vote*
    /remini voted.ini VOTED
    msg $chan voting Is Now Disabled.
  }
}

on 1:TEXT:!vote *:#:{
  if (%voting == OFF) { msg $chan Voting Is Disabled $nick $+ .
  }
  elseif ($readini(level-100.ini,$nick,$address($nick,2) == 100)) {
    if (%vote) { msg $chan Vote In Progress $nick $+ .
    }
    else {
      set %vote $2-
      set %vote.chan $chan
      set %vote.yes 0
      set %vote.no 0
      timervote 1 300 votedone
      msg %vote.chan [- Vote Started Timer $+ : 5 Minutes ! -]
      msg %vote.chan [- Question $+ : %vote -]
      msg %vote.chan [- Use !Yes Or !No  To Vote! -]
    }
  }
}

on 1:TEXT:*!stop vote*:#:{
  if (%voting == OFF) { msg $chan Voting Is Disabled $nick $+ .
  }
  elseif ($readini(level-100.ini,$nick,$address($nick,2) == 100)) {
 unset %vote*
    /remini voted.ini VOTED
    msg $chan [- Vote Has Been Stopped -]
    /timers off
  }
}

on 1:TEXT:*!Yes*:#:{
  if (%voting == OFF) { msg $chan Voting Is Disabled $nick $+ .
  }
  elseif ($readini(voted.ini,VOTED,$address($nick,2) == VOTED)) { msg $chan you Can Only vote Once $nick .
  }
  else {
    writeini voted.ini VOTED $address($nick,2) VOTED
    inc %vote.yes
    msg $chan [- You're vote Has Been Counted.! -]
  }
}

on 1:TEXT:*!No*:#:{
  if (%voting == OFF) { msg $chan Voting Is Disabled $nick $+ .
  }
  elseif ($readini(voted.ini,VOTED,$address($nick,2) == VOTED)) { msg $chan you Can Only vote Once $nick 
  }
  else {
    writeini voted.ini VOTED $address($nick,2) VOTED
    inc %vote.no
    msg $chan [- You're Vote Has Been Counted.! -]
  }
}

on 1:TEXT:*!status*:#:{
  if (%voting == OFF) { msg $chan Voting Is Disabled $nick $+ .
  }
  elseif ($readini(level-100.ini,$nick,$address($nick,2) == 100)) {
    msg $chan [- Current Status Is -]
    msg $chan [- Question $+ : %vote -]
    msg $chan [- YES = %vote.yes -]
    msg $chan [- NO = %vote.no -]
  }
}

alias votedone {  
  if (%vote.yes > %vote.no) {
    set %vote.end %vote.yes
    /timers off
    msg %vote.chan [- Voting Has Now Finished ! -]
    msg %vote.chan [- Question $+ : %vote -]
    msg %vote.chan [- ( Yes ) Won With %vote.end Votes -]
    msg %vote.chan [- Yes = %vote.yes \/ No = %vote.no -]
    /remini voted.ini VOTED
 unset %vote*
    set %voting OFF
  }
  elseif (%vote.no > %vote.yes) {
    set %vote.end %vote.no
    /timers off
    msg %vote.chan [- Voting Has Now Finished ! -]
    msg %vote.chan [- Question $+ : %vote -]
    msg %vote.chan [- ( No ) Won With %vote.end Votes -]
    msg %vote.chan [- Yes = %vote.yes \/ No = %vote.no -]
    /remini voted.ini VOTED
 unset %vote*
    set %voting OFF
  }
  elseif (%vote.yes == %vote.no) {
    /timers off
    msg %vote.chan [- Voting Has Now Finished ! -]
    msg %vote.chan [- Question $+ : %vote -]
    msg %vote.chan [- The Vote Was A Tie With -]
    msg %vote.chan [- Yes = %vote.yes \/ No = %vote.no -]
    /remini voted.ini VOTED
  unset %vote*
    set %voting OFF
  }
}

Comments

Sign in to comment.
WacKy-   -  Jan 22, 2005

cool daemon , ill update it now =]

 Respond  
xDaeMoN   -  Jan 22, 2005

You can also minimize a few lines when using the unset command. Use \"unset vote*\". =)

 Respond  
WacKy-   -  Jan 22, 2005

k, well it works fine so no point in changing it hehe

 Respond  
DarthReven   -  Jan 22, 2005

($readini(voted.ini,VOTED,$address($nick,2) == VOTED)) should be ($readini(voted.ini,VOTED,$address($nick,2)) == VOTED)

 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.