Untitled


SUBMITTED BY: Guest

DATE: Oct. 10, 2017, 2:46 a.m.

FORMAT: Text only

SIZE: 6.8 kB

HITS: 366

  1. var BetStart = 1; // 1.00000000 NXT
  2. var betCrashIncrements = 0.08;
  3. var betCrashStart = 2.1;
  4. var betCrashStop = 2.1;
  5. var SurviveCrashes = 25;
  6. var maxBet = 5;
  7. var failureStreak = 3; // number of failures before going to minimal bets
  8. var site = "nxtbubble";
  9. // nxtbubble -- https://nxt.tothemoon.me -- https://nxt-old.tothemoon.me
  10. // btctothemoon -- https://btc.tothemoon.me -- https://btc-old.tothemoon.me
  11. // bustabit -- https://www.bustabit.com
  12. // bustaclam -- https://bustaclam.com
  13. // DP -- may not be intended for public use, may still be under development
  14. // CR -- may not be intended for public use, may still be under development
  15. // shouldn't need to edit anything below here
  16. var currentCrash = betCrashStart*100;
  17. var lostBet = 0; // set to lost bet from previous round or 0 if new
  18. var betMultiplier = 1;
  19. var cashedout = false;
  20. var UserName = engine.getUsername();
  21. var minBet = 0; // minimum bet variable set below for specific sites
  22. var failureStreakCount = 0; // number of failures in a row
  23. //var lostBet = 10902.009998999587; // nxtbubble lost amount since start of this script - resetting to save for now
  24. if (site == "nxtbubble") {
  25. betMultiplier = 1;
  26. minBet = 0.01;
  27. } else if (site == "bustabit") {
  28. betMultiplier = 100;
  29. minBet = 1000;
  30. } else if (site == "bustaclam") {
  31. betMultiplier = 100;
  32. minBet = 1;
  33. } else if (site == "btctothemoon") {
  34. betMultiplier = 100;
  35. minBet = 1;
  36. } else if (site == "DP") {
  37. betMultiplier = 100;
  38. minBet = 1;
  39. } else if (site == "CR") {
  40. betMultiplier = 100;
  41. minBet = 1;
  42. }
  43. CalculateBet();
  44. engine.on('game_starting', function(info) {
  45. console.log('Last game status: ', engine.lastGamePlay());
  46. // if (engine.lastGamePlay() == "LOST") {
  47. if (lostBet > 0) {
  48. // lostBet += currentBet;
  49. currentCrash += betCrashIncrements*100;
  50. if (currentCrash > betCrashStop*100) {
  51. currentCrash = betCrashStop*100;
  52. }
  53. //figure out new bet (first calculate)
  54. currentBet = lostBet/(currentCrash/100-1)
  55. if (currentBet > maxBet) {
  56. currentBet = maxBet;
  57. }
  58. if (currentBet < BetStart) {
  59. currentBet = BetStart;
  60. }
  61. // figure out new bet (ignore calculation and go to minimum bet if on failure cooldown)
  62. if (failureStreakCount >= failureStreak && currentBet == maxBet) {
  63. currentBet = minBet;
  64. }
  65. // console.log(lostBet + " " + currentCrash + " " + currentBet);
  66. // rounding to divisible by 100 for bustabit / bustaclam
  67. if (site == "bustabit") {
  68. currentBet = Math.ceil(currentBet);
  69. } else if (site == "bustaclam") {
  70. currentBet = Math.ceil(currentBet);
  71. } else if (site == "btctothemoon") {
  72. currentBet = Math.ceil(currentBet);
  73. } else if (site == "DP") {
  74. currentBet = Math.ceil(currentBet);
  75. } else if (site == "CR") {
  76. currentBet = Math.ceil(currentBet);
  77. } else if (site == "nxtbubble") {
  78. currentBet = Math.ceil(currentBet*100)/100; // move the decimal 2 places to round the 2 decimal up then move back
  79. }
  80. if (currentBet*betMultiplier < engine.getBalance()) {
  81. engine.placeBet(currentBet*betMultiplier, Math.round(currentCrash), false);
  82. console.log('New bet will be ' + currentBet + ' and crash point will be ' + currentCrash);
  83. } else {
  84. console.log('OUT OF COINS - STOPPING');
  85. engine.stop();
  86. // ResetValues();
  87. // engine.placeBet(currentBet*betMultiplier, currentCrash, false);
  88. }
  89. } else { // last game won or starting new
  90. // console.log('Last Game was won or starting new :)');
  91. ResetValues();
  92. engine.placeBet(currentBet*betMultiplier, currentCrash, false);
  93. }
  94. // console.log('Game Starting in ' + info.time_till_start);
  95. });
  96. function CalculateBet() {
  97. // Calculate the new bet based on defined # of crashes to survive
  98. var simuNewTestBet = BetStart
  99. // slowly increase the value
  100. if (site == "nxtbubble") {
  101. simuNewTestBet += 0.01;
  102. } else if (site == "bustabit") {
  103. simuNewTestBet += 1;
  104. } else if (site == "bustaclam") {
  105. simuNewTestBet += 1;
  106. } else if (site == "btctothemoon") {
  107. simuNewTestBet += 1;
  108. }
  109. var simuNewBet = simuNewTestBet;
  110. var simulostBet = 0;
  111. var simuCurrentCrash = betCrashStart*100;
  112. for (var loop = 0; loop < SurviveCrashes; loop++) {
  113. simulostBet += simuNewBet;
  114. simuCurrentCrash += betCrashIncrements*100;
  115. if (simuCurrentCrash > betCrashStop*100) {
  116. simuCurrentCrash = betCrashStop*100;
  117. }
  118. //figure out new bet
  119. simuNewBet = simulostBet/(simuCurrentCrash/100-1)
  120. // rounding to divisible by 100 for bustabit / bustaclam
  121. if (site == "bustabit") {
  122. simuNewBet = Math.floor(simuNewBet) +1;
  123. } else if (site == "bustaclam") {
  124. simuNewBet = Math.floor(simuNewBet) +1;
  125. } else if (site == "btctothemoon") {
  126. simuNewBet = Math.floor(simuNewBet) +1;
  127. } else if (site == "nxtbubble") {
  128. simuNewBet = Math.ceil(simuNewBet*100)/100; // move the decimal 2 places to round the 2 decimal up then move back
  129. }
  130. // console.log('Loop run ' + loop );
  131. }
  132. if (simuNewBet*betMultiplier > engine.getBalance()) {
  133. //console.log('Not increasing bet: ' + simuNewBet);
  134. } else {
  135. console.log('** Increasing bet **' + simuNewBet);
  136. BetStart = simuNewTestBet;
  137. }
  138. }
  139. function ResetValues() {
  140. lostBet = 0;
  141. currentCrash = betCrashStart*100; // 124 = 1.24
  142. currentBet = BetStart;
  143. CalculateBet();
  144. }
  145. // testing...
  146. engine.on('game_started', function(data) {
  147. // console.log('Game started, showing data: ',data);
  148. // console.log('Game started, showing my bet?: ',data[UserName].bet);
  149. if (data[UserName] != "Undefined") {
  150. cashedout = false;
  151. lostBet += data[UserName].bet / betMultiplier;
  152. currentBet = data[UserName].bet / betMultiplier; // set here incase I manually place bet - want to know what was placed to calculate lostBet on cash_out
  153. console.log('Current amount to recover: ',lostBet);
  154. }
  155. // data[UserName].bet
  156. });
  157. engine.on('cashed_out', function(data) {
  158. // * @param {number} resp.amount - The amount the user cashed out
  159. // * @param {number} resp.stopped_at -The percentage at which the user cashed out
  160. if (data.username == UserName) {
  161. cashedout = true;
  162. console.log('Cashed out at: ',data.stopped_at);
  163. lostBet -= currentBet * (data.stopped_at / 100);
  164. console.log("DEBUG: Lost amount is now: ", lostBet);
  165. }
  166. });
  167. engine.on('game_crash', function(data) {
  168. if (data.game_crash < currentCrash) {
  169. failureStreakCount++;
  170. } else {
  171. failureStreakCount = 0;
  172. }
  173. });
  174. /*
  175. v6:
  176. - defined minimum bet variable for each game
  177. - to add: crash cooldown code to bet minimum bet during cooldown phase on failure steaks
  178. Notes:
  179. Calculations...
  180. balance *0.001 rounded becomes max bet
  181. max bet / 10 / 2 rounded down becomes base bet
  182. should survive about 12 rounds
  183. */

comments powered by Disqus