Advertisement
Guest User

hi this is a contest

a guest
Sep 23rd, 2015
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 4.96 KB | None | 0 0
  1. on @*:text:!contest *:#botmfishfood: {
  2.   if ($nick isop #) {
  3.     if ($2 == start && !%conteston) {
  4.       msg $chan Dampe or the Goron Race hates FishFood and likes to troll him. So guess his dampe time and flames, or race losses for the goron race, with !bet. Do so by typing !bet <time> <flames/losses>. Here is an example: !bet 51 1 Documentation on the scoring system can be found here: http://pastebin.com/4VLXVV8T
  5.       msg $chan Also don't copy others, as if you guess the same as them, your bet will not win. (This stops people from copying eachother) :) b
  6.       set %conteston 1
  7.       set %contestant 1
  8.       set %contestcheck 0
  9.     }
  10.     elseif ($2 == result && $len($3) > 1 && $len($4) > 0 && !%conteston && %contestdone) {
  11.       unset %contestdone
  12.       set %contesti 1
  13.       ;do fun variable stuff
  14.  
  15.       %contestant = %contestant - 1
  16.  
  17.       ;loop through all contestants
  18.       if (%contestant > 0) {
  19.         while (%contesti <= %contestant) {
  20.           if (%contesti == 1) {
  21.             %winnernum = 1
  22.  
  23.             ;weight the time difference
  24.             set %ctemp1 %contest. [ $+ [ %contesti ] ]
  25.             %timediff = $3 - %ctemp1
  26.             set %timediff = $abs(%timediff)
  27.  
  28.             ;weight the flame difference
  29.             set %ctemp2 %contest. [ $+ [ %contesti ] ] [ $+ .f ]
  30.             %flamediff = $4 - %ctemp2
  31.             %flamediff = $abs(%flamediff) * 2.2
  32.  
  33.             %contestweight = %contesti * 1.02
  34.  
  35.             %contestscore = %flamediff + %timediff
  36.             %contestscore = %contestscore / 2
  37.             %contestscore = %contestscore * %contestweight
  38.  
  39.             %winnertime = %contest. [ $+ [ %winnernum ] ]
  40.             %winnerflame = %contest. [ $+ [ %winnernum ] ] [ $+ .f ]
  41.             set %cwinner %contest. [ $+ [ %winnernum ] ] [ $+ .nick ]
  42.           }
  43.           else {
  44.             ;weight the time difference
  45.             set %ctemp1 %contest. [ $+ [ %contesti ] ]
  46.             %timediff = $3 - %ctemp1
  47.             set %timediff = $abs(%timediff)
  48.  
  49.             ;weight the flame difference
  50.             set %ctemp2 %contest. [ $+ [ %contesti ] ] [ $+ .f ]
  51.             %flamediff = $4 - %ctemp2
  52.             %flamediff = $abs(%flamediff) * 2.2
  53.  
  54.             %contestweight = %contesti * 1.02
  55.  
  56.             %contestscore2 = %flamediff + %timediff
  57.             %contestscore2 = %contestscore2 / 2
  58.             %contestscore2 = %contestscore2 * %contestweight
  59.  
  60.             if (%contestscore > %contestscore2) {
  61.               set %winnernum %contesti
  62.               %contestscore = %contestscore2
  63.               %winnertime = %contest. [ $+ [ %winnernum ] ]
  64.               %winnerflame = %contest. [ $+ [ %winnernum ] ] [ $+ .f ]
  65.               set %cwinner %contest. [ $+ [ %winnernum ] ] [ $+ .nick ]
  66.             }
  67.           }
  68.  
  69.           %contesti = %contesti + 1
  70.         }
  71.  
  72.         msg $chan The winner is %cwinner with a time of %winnertime and a flame/loss count of %winnerflame $+ ! They win 5 rupees from Zeldobot.
  73.         ;msg $chan degub: %contestscore
  74.         timer 1 1 msg $chan !zdonate %cwinner 5
  75.  
  76.         set %contestk 1
  77.         while (%contestk <= %contestant) {
  78.           unset %contest. [ $+ [ %contestk ] ]
  79.           unset %contest. [ $+ [ %contestk ] ] [ $+ .nick ]
  80.           unset %contest. [ $+ [ %contestk ] ] [ $+ .f ]
  81.           %contestk = %contestk + 1
  82.         }
  83.       }
  84.       else {
  85.         msg $chan No one entered the contest, so there are no winners. :(
  86.       }
  87.     }
  88.     elseif ($2 == stop && %conteston) {
  89.       unset %conteston
  90.       set %contestdone 1
  91.       msg $chan No more results will be taken in
  92.     }
  93.     elseif ($2 == result) {
  94.       msg $chan Cannot take contest results right now.
  95.     }
  96.     elseif ($2 != help) {
  97.       msg $chan Invalid command arguments.
  98.     }
  99.   }
  100.   if ($2 == help) {
  101.     msg $chan Dampe bets work on a scoring system designed by syphist, documentation can be found here: http://pastebin.com/4VLXVV8T
  102.   }
  103. }
  104.  
  105. on @*:text:!bet & &:#botmfishfood: {
  106.   if (%conteston) {
  107.     set %contestj 1
  108.     set %contestcheck 0
  109.  
  110.     ;check if they have entered already
  111.     while (%contestj <= %contestant) {
  112.       if ($nick == %contest. [ $+ [ %contestj ] ] [ $+ .nick ]) {
  113.         set %contestcheck 1
  114.         break
  115.       }
  116.       %contestj = %contestj + 1
  117.     }
  118.  
  119.     ;determine if new entry or not
  120.     if (%contestcheck == 0) {
  121.       ;Enters them into contest based on contestant number
  122.       set %contest. [ $+ [ %contestant ] ] [ $+ .nick ] $nick
  123.       set %contest. [ $+ [ %contestant ] ] $2
  124.       set %contest. [ $+ [ %contestant ] ] [ $+ .f ] $3
  125.       %contestant = %contestant + 1
  126.       msg $chan Thank you $nick for entering the contest.
  127.     }
  128.     else {
  129.       ;Enters them into contest based on contestant number
  130.       set %contest. [ $+ [ %contestj ] ] $2
  131.       set %contest. [ $+ [ %contestj ] ] [ $+ .f ] $3
  132.       msg $chan $nick $+ , your entered time has been changed.
  133.     }
  134.   }
  135.   else {
  136.     msg $chan Sorry, there is no active contest at the moment.
  137.   }
  138. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement