Advertisement
kazmadan

saltybrett2.mrc

Jan 2nd, 2018
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.90 KB | None | 0 0
  1. set %pot1
  2. set %pot2
  3. set %pot_total
  4. set %winner
  5. set %loser
  6. set %betters
  7. set %odds
  8. !saltybrett on
  9. !saltybrett off
  10.  
  11. !saltybrett open
  12. -timer based
  13.  
  14. on *:TEXT:!saltybrett open:#: {
  15. if ($nick isop $chan) {
  16. set %betters ""
  17. msg # Salty Brett is now active for the next 60 seconds! Bet by typing !bet <1p / 2p> <amount>
  18. }
  19. .enable #saltybrett
  20. /timer 1 60 .disable #saltybrett
  21. /timer 1 60 Betting is now closed!
  22.  
  23. }
  24.  
  25.  
  26. on *:TEXT:!winner *:#: {
  27. if ($nick isop $chan) {
  28. if ($2 == 1p) {
  29.  
  30. %odds = $calc(%pot1 / %pot2)
  31. /msg # 1p was the winner. The odds returned are %odds
  32.  
  33. }
  34.  
  35. else if ($2 == 2p) {
  36. %odds = $calc(%pot2 / %pot1)
  37. /msg # 2p was the winner. The odds returned are %odds
  38.  
  39. }
  40.  
  41.  
  42. var %count = $numtok(%betters, 32)
  43. while (%count > 0) {
  44.  
  45. var %curName = $gettok(%betters,%count,32)
  46. /echo %curName bet $getvar(%curName,bet) dollars, odds were %odds giving back bet + $getvar(%curName,bet)*%odds)
  47. setvar %curName cash $calc($getvar(%curName,cash) + $getvar(%curName,bet) + $getvar(%curName,bet)*%odds)
  48.  
  49. dec %count
  50. /echo lowering count
  51.  
  52. }
  53. }
  54. }
  55.  
  56. on *:TEXT:!saltybrett odds:#: {
  57.  
  58. msg # $nick <- the odds are $calc(%pot2 / %pot1)
  59.  
  60. }
  61.  
  62. on *:TEXT:!saltybrett status:#: {
  63.  
  64. if ($getvar($nick,virgin) == 0) {
  65. msg # $nick <- $nick has $getvar($nick,cash) dollars. Currently a virgin. Currently betting $getvar($nick,bet) on $getvar($nick,beton).
  66. }
  67. else {
  68. msg # $nick <- $nick has $getvar($nick,cash) dollars. Currently betting $getvar($nick,bet) on $getvar($nick,beton). The pot is %pot1 and %pot2. .
  69. }
  70.  
  71. }
  72.  
  73. #saltybrett off
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80. #saltybrett off
  81.  
  82. /*
  83. on *:text:!like:#: {
  84. if ( %oldsong != %currentsong) {
  85. set %likers ""
  86. set %skipcount 0
  87. }
  88. ;//echo function evalutes to: $findtok(%likers, thebrett, 32)
  89. if ( $findtok(%likers, $nick, 32) != $null ) {
  90. ;//echo exists already
  91. ;//echo likers is now %likers
  92. msg # $nick -> You just used !like
  93. }
  94. else {
  95. set %likers %likers $nick
  96. ;//echo adding! likers is now %likers
  97. }
  98.  
  99. setvar %songlink like $calc($getvar(%songlink, like) + 1)
  100.  
  101. if ((%wait.ctime !isnum) || ((%wait.ctime isnum) && (%wait.ctime < $ctime))) {
  102. set %wait.ctime $calc($ctime + 10)
  103.  
  104. if ( %skipcount > 0) {
  105. msg # Processed multiple likes. This song has been liked $getvar(%songlink, like) times.
  106. }
  107. else {
  108. msg # This song has been liked $getvar(%songlink, like) times.
  109. }
  110. set %skipcount 0
  111.  
  112. }
  113. else {
  114. inc %skipcount 1
  115. }
  116. }
  117.  
  118. */
  119.  
  120.  
  121. when bet closes,
  122.  
  123. %winner
  124. %loser
  125. %odds winner/loser
  126.  
  127. payout = name_bet * %odds
  128.  
  129.  
  130. alias for {
  131. var %n = $1
  132. if (%n isnum) {
  133. while (%n != 0) {
  134. $2-
  135. dec %n
  136. }
  137. }
  138. else { for.error }
  139. }
  140.  
  141. alias try_for {
  142. $for($1,echo -s Hello World!!!)
  143. }
  144.  
  145. alias -l for.error { echo -s 4Error in For Loop }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement