mIRC Home    About    Download    Register    News    Help

Print Thread
Vote Script #135703 15/11/05 05:08 PM
Joined: Nov 2005
Posts: 2
D
Darkgusgus Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
D
Joined: Nov 2005
Posts: 2
Sup all, ok i am out of time and i need the help of the pros :X
I need to make up a Bot script that will take votes, but not only
yes and no's but different choices, for my case it is a nomination of the
best games.
The bot will take the votes in private window and will count each
the users can vote for one game per catagory, there are 4 games per catagory
I need this for at least next week :X

thank you very much

Re: Vote Script #135704 15/11/05 08:02 PM
Joined: Dec 2002
Posts: 3,547
S
SladeKraven Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Try:

Code:
alias vote {
  if ($active ischan) {
    if ($hget(vote)) hfree vote | hmake vote 10
    tokenize 35 $1-
    if ($1 == on) {
      if ($2 isnum) {
        if ($3) {
          .enable #vote
          set %vote.chan $active
          set %vote.t $2
          set %vote.q $3-
          msg $active Vote is now on $+($chr(40),$3-,$chr(41))
          msg $active You have $duration($2) to answer.
          msg $active PM me with !vote <Your vote>
          if ($timer(vote)) {
            .timervote off
          }
          .timervote 1 $2 voteoff
        }
      }
    }
    if ($1 == off) {
      s
    }
  }
}

alias voteoff {
  msg %vote.chan Vote is now off $+($chr(40),%vote.q,$chr(41))
  if ($hget(vote,0).item > 0) {
    msg %vote.chan here is the results..
    var %x = $hget(vote,0).item
    while (%x) {
      msg %vote.chan $hget(vote,%x).item casted vote: $hget(vote,%x).data
      dec %x
    }
  }
  else { msg %vote.chan No one voted.. }
}
#vote on
On *:Text:!vote &:?: {
  if (%vote.t) {
    if (!$hget(vote)) hmake vote 10
    if (!$hget(vote,$nick)) {
      hadd vote $nick $replace($2,$chr(32),$chr(95))
      msg $nick Your vote $+($chr(40),$2,$chr(41)) has been cast.
    } 
    else { msg $nick You voted already. }
  }
  else { msg $nick Vote no longer on. }
}
#vote end



To start it type:
/vote on#<Time Limit>#<Question>
Example: /vote on#60#Which came first the chicken or the egg?

It will look something like:

[12:59] <Andy> Vote is now on (Which came first the chicken or the egg?)
[12:59] <Andy> You have 1min to answer.
[12:59] <Andy> PM me with !vote <Your vote>

Then private message the bot with !vote <Yes|No|Maybe|Who cares> etc..

Alternatively, click search at the top there'll be alot of vote scripts in the past expand your search to 5 years and browse scripts&popups forum. smile

-Andy