Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on @*:text:!contest *:#botmfishfood: {
- if ($nick isop #) {
- if ($2 == start && !%conteston) {
- 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
- 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
- set %conteston 1
- set %contestant 1
- set %contestcheck 0
- }
- elseif ($2 == result && $len($3) > 1 && $len($4) > 0 && !%conteston && %contestdone) {
- unset %contestdone
- set %contesti 1
- ;do fun variable stuff
- %contestant = %contestant - 1
- ;loop through all contestants
- if (%contestant > 0) {
- while (%contesti <= %contestant) {
- if (%contesti == 1) {
- %winnernum = 1
- ;weight the time difference
- set %ctemp1 %contest. [ $+ [ %contesti ] ]
- %timediff = $3 - %ctemp1
- set %timediff = $abs(%timediff)
- ;weight the flame difference
- set %ctemp2 %contest. [ $+ [ %contesti ] ] [ $+ .f ]
- %flamediff = $4 - %ctemp2
- %flamediff = $abs(%flamediff) * 2.2
- %contestweight = %contesti * 1.02
- %contestscore = %flamediff + %timediff
- %contestscore = %contestscore / 2
- %contestscore = %contestscore * %contestweight
- %winnertime = %contest. [ $+ [ %winnernum ] ]
- %winnerflame = %contest. [ $+ [ %winnernum ] ] [ $+ .f ]
- set %cwinner %contest. [ $+ [ %winnernum ] ] [ $+ .nick ]
- }
- else {
- ;weight the time difference
- set %ctemp1 %contest. [ $+ [ %contesti ] ]
- %timediff = $3 - %ctemp1
- set %timediff = $abs(%timediff)
- ;weight the flame difference
- set %ctemp2 %contest. [ $+ [ %contesti ] ] [ $+ .f ]
- %flamediff = $4 - %ctemp2
- %flamediff = $abs(%flamediff) * 2.2
- %contestweight = %contesti * 1.02
- %contestscore2 = %flamediff + %timediff
- %contestscore2 = %contestscore2 / 2
- %contestscore2 = %contestscore2 * %contestweight
- if (%contestscore > %contestscore2) {
- set %winnernum %contesti
- %contestscore = %contestscore2
- %winnertime = %contest. [ $+ [ %winnernum ] ]
- %winnerflame = %contest. [ $+ [ %winnernum ] ] [ $+ .f ]
- set %cwinner %contest. [ $+ [ %winnernum ] ] [ $+ .nick ]
- }
- }
- %contesti = %contesti + 1
- }
- msg $chan The winner is %cwinner with a time of %winnertime and a flame/loss count of %winnerflame $+ ! They win 5 rupees from Zeldobot.
- ;msg $chan degub: %contestscore
- timer 1 1 msg $chan !zdonate %cwinner 5
- set %contestk 1
- while (%contestk <= %contestant) {
- unset %contest. [ $+ [ %contestk ] ]
- unset %contest. [ $+ [ %contestk ] ] [ $+ .nick ]
- unset %contest. [ $+ [ %contestk ] ] [ $+ .f ]
- %contestk = %contestk + 1
- }
- }
- else {
- msg $chan No one entered the contest, so there are no winners. :(
- }
- }
- elseif ($2 == stop && %conteston) {
- unset %conteston
- set %contestdone 1
- msg $chan No more results will be taken in
- }
- elseif ($2 == result) {
- msg $chan Cannot take contest results right now.
- }
- elseif ($2 != help) {
- msg $chan Invalid command arguments.
- }
- }
- if ($2 == help) {
- msg $chan Dampe bets work on a scoring system designed by syphist, documentation can be found here: http://pastebin.com/4VLXVV8T
- }
- }
- on @*:text:!bet & &:#botmfishfood: {
- if (%conteston) {
- set %contestj 1
- set %contestcheck 0
- ;check if they have entered already
- while (%contestj <= %contestant) {
- if ($nick == %contest. [ $+ [ %contestj ] ] [ $+ .nick ]) {
- set %contestcheck 1
- break
- }
- %contestj = %contestj + 1
- }
- ;determine if new entry or not
- if (%contestcheck == 0) {
- ;Enters them into contest based on contestant number
- set %contest. [ $+ [ %contestant ] ] [ $+ .nick ] $nick
- set %contest. [ $+ [ %contestant ] ] $2
- set %contest. [ $+ [ %contestant ] ] [ $+ .f ] $3
- %contestant = %contestant + 1
- msg $chan Thank you $nick for entering the contest.
- }
- else {
- ;Enters them into contest based on contestant number
- set %contest. [ $+ [ %contestj ] ] $2
- set %contest. [ $+ [ %contestj ] ] [ $+ .f ] $3
- msg $chan $nick $+ , your entered time has been changed.
- }
- }
- else {
- msg $chan Sorry, there is no active contest at the moment.
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement