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 hates FishFood and likes to troll him. So guess his dampe time with !bet. Do so by typing !bet <time> <flames>. Here is an example: !bet 51 1 Documentation on the scoring system can be found here: http://pastebin.com/P41dE3rq
- 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
- if (%timediff < 0) {
- %timediff = %timediff * -0.9
- }
- ;weight the flame difference
- set %ctemp2 %contest. [ $+ [ %contesti ] ] [ $+ .f ]
- %flamediff = $4 - %ctemp2
- if (%flamediff < 0) {
- %flamediff = %flamediff * -0.9
- }
- %flamediff = %flamediff * 2.5
- %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
- if (%timediff < 0) {
- %timediff = %timediff * -0.9
- }
- ;weight the flame difference
- set %ctemp2 %contest. [ $+ [ %contesti ] ] [ $+ .f ]
- %flamediff = $4 - %ctemp2
- if (%flamediff < 0) {
- %flamediff = %flamediff * 0.9
- }
- %flamediff = %flamediff * 2.5
- %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 count of %winnerflame $+ ! They win 5 rupees from Zeldobot.
- ;msg $chan degub: %contestscore
- timer 1 1 msg $chan !zdonate %cwinner 5
- set %contesti 1
- while (%contesti <= %contestant) {
- unset %contest. [ $+ [ %contesti ] ]
- unset %contest. [ $+ [ %contesti ] ] [ $+ .nick ]
- %contesti = %contesti + 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/P41dE3rq
- }
- }
- on @*:text:!bet & &:#botmfishfood: {
- if (%conteston) {
- set %contestj 1
- ;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