Advertisement
Guest User

Untitled

a guest
Feb 26th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 1.75 KB | None | 0 0
  1.   if ($1-2 == !set vote ) && ($nick isop $chan) && (%vote. [ $+ [ $chan ] ] == on) {
  2.     set -g %voteoptions. $+ $chan $lower($3-)
  3.     msg $chan your voting options are %voteoptions. [ $+ [ $chan ] ]
  4.   }
  5.   if ( $1 == !vote ) {
  6.     if ( $2 == on ) && ( $nick isop $chan ) {
  7.       msg $chan Voting has been turned on. !set vote option1 option2 option3 etc to set options. !vote to vote.
  8.       set -u7200 %vote. $+ $chan on
  9.     }
  10.     elseif ( $2 == off ) && ($nick isop $chan) {
  11.       msg $chan Voting has been turned off. Result:
  12.       unset %vote. $+ $chan
  13.     }
  14.     elseif ($2 == results) && ($3 == $null) {
  15.       ;code to find results and output BAD CODE NEEDS REPLACING
  16. ;msg $chan $sorttok(%voteoption.test1 %voteoption.test2 %voteoption.test3,32,rn)
  17.     ;tokenize 32 $sorttok($var(voteoption*),32,rn) | msg $chan Test 1: $1 Test 2: $2 Test 3: $3
  18.     set %x $numtok(%voteoptions. [ $+ [ $chan ] ],32)
  19.     ;set %totalvote test
  20.     while (%x > 0) {
  21.       echo $chan $var(%votechoice*,%x)
  22.       ;$addtok($var(%votechoice*,%x),%totalvote,32)
  23.       ;$instok($var(%votechoice*,%x).value,%totalvote,0,32)
  24.       %totalvote = %totalvote $var(%votechoice*,%x)
  25.       dec %x
  26.     }
  27.     echo $chan Totalvote = %totalvote
  28.     tokenize 32 $sorttok($var(%totalvote).value,32,rn) | msg $chan Test 1: $1 Test 2: $2 Test 3: $3
  29.     }
  30.     elseif ($2 != $null) {
  31.       ;checks to see if what they typed was an option, if it is, check to see if it exists. if no, make it and inc it. If it does, inc it
  32.       if ($istok(%voteoptions. [ $+ [ $chan ] ],$2,32)) {
  33.         if (%votechoice. [ $+ [ $lower($2) ] == $null) {
  34.           set -g %votechoice. $+ $2
  35.           inc %votechoice. $+ $2
  36.         }
  37.         else {
  38.           inc %votechoice. $+ $2
  39.         }
  40.       }
  41.     }
  42.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement