Advertisement
coinwalk

i think i nailed it

May 14th, 2019
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.39 KB | None | 0 0
  1. $('#gameContainer').html('<div id="chart"></div>');
  2. $('#gameContainer').css('width', '1000px');
  3. $('#gameContainer').css('margin', 'auto');
  4.  
  5. var basebet = 0.0000001, nextbet = basebet, nbet = betAmount * 25, chance = 01, bethigh = false;
  6. var dps = [], chart, bet = 0, win = 0, winStreak = 0, lose = 0, loseStreak = 0, profit = 0, balance = 0, color, startTime, runTime;
  7. var c = [0, 0, 0, 0], ch = [5, 25, 75, 95, 50], n = 1;
  8.  
  9. function randomChance(min, max) {
  10. return Math.floor(Math.random() * (max - min + 1) ) + min;
  11. }
  12.  
  13. function drawChart() {
  14. return new Promise(function (resolve, reject) {
  15. $.getScript('https://canvasjs.com/assets/script/canvasjs.min.js').done(function () {
  16. dps = [{
  17. x: 0,
  18. y: 0
  19. }];
  20. chart = new CanvasJS.Chart('chart', {
  21. theme: 'light2',
  22. axisX: {
  23. title: ''
  24. },
  25. axisY: {
  26. title: ''
  27. },
  28. title: {
  29. text: ''
  30. },
  31. data: [{
  32. type: 'line',
  33. dataPoints: dps
  34. }]
  35. });
  36. chart.render(resolve({ err: 0, msg: 'OK' }));
  37. }).fail(function (error) {
  38. reject({ err: 1, msg: 'ERROR' });
  39. });
  40. });
  41. }
  42.  
  43. function updateChart() {
  44. dps.push({
  45. x: bet,
  46. y: profit,
  47. color: color
  48. })
  49. if (dps[dps.length - 2]) {
  50. dps[dps.length - 2].lineColor = color;
  51. }
  52. if (dps.length > 60) {
  53. dps.shift();
  54. }
  55. chart.render();
  56. }
  57.  
  58. function dobet() {
  59. var betAmount = nextbet, prediction, direction;
  60. if (bethigh) {
  61. prediction = 01 - chance;
  62. direction = 'over';
  63. }
  64. else {
  65. prediction = chance;
  66. direction = 'under';
  67. }
  68. $.post('https://luckygames.io/play/', {
  69. game: 'dice',
  70. coin: $('#coin').val(),
  71. betAmount: betAmount,
  72. prediction: prediction,
  73. direction: direction,
  74. clientSeed: $('#clientSeed').val(),
  75. serverSeedHash: $('#serverSeedHash').text(),
  76. hash: user.hash
  77. }).done(function (response) {
  78. var l = JSON.parse(response);
  79. if (l.result) {
  80. bet += 1;
  81. profit += parseFloat(l.profit);
  82. var onTime = new Date().getTime();
  83. runTime = onTime - startTime;
  84. var runSeconds = Math.floor((runTime % (1000 * 60)) / 1000),
  85. runMinutes = Math.floor((runTime % (1000 * 60 * 60)) / (1000 * 60)),
  86. runHours = Math.floor((runTime % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)),
  87. runDays = Math.floor(runTime / (1000 * 60 * 60 * 24)),
  88. runSpeed = parseFloat((bet / runTime) * 1000);
  89. $('#serverSeedHash').text(l.serverSeedHash);
  90. $('#balance').val(l.balance);
  91. if ($('#myBets').hasClass('active')) {
  92. var e = $('#listContainer .table .tbody .tr:first-child');
  93. if (e.hasClass('full')) e.remove(), $('#listContainer .table .tbody').append(l.betHtml);
  94. else {
  95. e.before(l.betHtml);
  96. var t = $('#listContainer .table .tbody .tr').length;
  97. if (50 < t && (t = 40), 40 < t)
  98. for (var o = 0; o < t - 40; o++) $('#listContainer .table .tbody .tr:last-child').remove()
  99. }
  100. }
  101. if (l.gameResult == 'win') {
  102. loseStreak = 0;
  103. color = 'green';
  104. nextbet = basebet;
  105. }
  106. else {
  107. lose += 1;
  108. loseStreak += 1;
  109. winStreak = 0;
  110. color = 'red';}
  111. if (loseStreak == 95) {
  112. nextbet = betAmount *5;}
  113. else nextbet = betAmount;
  114. if (loseStreak == 140) {
  115. nextbet = betAmount *5;}
  116. else nextbet = betAmount;
  117. if (loseStreak == 180) {
  118. nextbet = betAmount *5;}
  119. else nextbet = betAmount;
  120. if (loseStreak == 135) {
  121. nextbet = betAmount *5;}
  122. else nextbet = betAmount;
  123. if (loseStreak == 170) {
  124. nextbet = betAmount *5;}
  125. else nextbet = betAmount;
  126. if (loseStreak == 220) {
  127. nextbet = betAmount *5;}
  128. else nextbet = betAmount;
  129. if (loseStreak == 300) {
  130. nextbet = betAmount *5;}
  131. else nextbet = betAmount;
  132. if (loseStreak == 350) {
  133. nextbet = betAmount *5;}
  134. else nextbet = betAmount;
  135. if (loseStreak == 400) {
  136. nextbet = betAmount *5;}
  137. else nextbet = betAmount;
  138. if (loseStreak == 450) {
  139. nextbet = betAmount *5;}
  140. else nextbet = betAmount;
  141. if (loseStreak == 500) {
  142. nextbet = betAmount *5;}
  143. else nextbet = betAmount;
  144. if (loseStreak == 550) {
  145. nextbet = betAmount *5;}
  146. else nextbet = betAmount;
  147. if (loseStreak == 600) {
  148. nextbet = betAmount *5;}
  149. else nextbet = betAmount;}
  150. console.clear();
  151. console.log(`balance: ${l.balance} ${$('#coin').val()}`);
  152. console.log(`profit: ${profit.toFixed(8)} ${$('#coin').val()}`);
  153. console.log(`speed: ${runSpeed} bet/s`);
  154. console.log(`run time: ${runDays}:${runHours}:${runMinutes}:${runSeconds}`);
  155. updateChart();
  156. dobet();
  157. }).fail(function (error) {
  158. dobet();
  159. });
  160. }
  161.  
  162. async function start() {
  163. drawChart().then(function () {
  164. startTime = new Date();
  165. dobet();
  166. }).catch(function () {
  167.  
  168. });
  169. }
  170.  
  171. randomizeSeed(start());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement