coinwalk

for 5k doge on lucky games

May 11th, 2019
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.52 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.0001, nextbet = basebet, nbet = betAmount * 2, chance = 49, 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 = 49 - 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. win += 1;
  103. winStreak += 1;
  104. loseStreak = 0;
  105. color = 'green';
  106. nextbet = basebet;
  107. }
  108. else {
  109. lose += 1;
  110. loseStreak += 1;
  111. winStreak = 0;
  112. color = 'red';
  113. nextbet = betAmount * 2;}
  114. }
  115. if (loseStreak == 8) {
  116. nextbet = 10;}
  117. console.clear();
  118. console.log(`balance: ${l.balance} ${$('#coin').val()}`);
  119. console.log(`profit: ${profit.toFixed(8)} ${$('#coin').val()}`);
  120. console.log(`speed: ${runSpeed.toFixed(2)} bet/s`);
  121. console.log(`run time: ${runDays}:${runHours}:${runMinutes}:${runSeconds}`);
  122. updateChart();
  123. dobet();
  124. }).fail(function (error) {
  125. dobet();
  126. });
  127. }
  128.  
  129. async function start() {
  130. drawChart().then(function () {
  131. startTime = new Date();
  132. dobet();
  133. }).catch(function () {
  134.  
  135. });
  136. }
  137.  
  138. randomizeSeed(start());
Add Comment
Please, Sign In to add comment