Advertisement
coinwalk

for 10 coin

May 14th, 2019
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.43 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.00001, nextbet = basebet, nbet = betAmount * 3, 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. }
  112. if (loseStreak == 40) {
  113. nextbet = betAmount *5;}
  114. console.clear();
  115. console.log(`balance: ${l.balance} ${$('#coin').val()}`);
  116. console.log(`profit: ${profit.toFixed(8)} ${$('#coin').val()}`);
  117. console.log(`speed: ${runSpeed} bet/s`);
  118. console.log(`run time: ${runDays}:${runHours}:${runMinutes}:${runSeconds}`);
  119. updateChart();
  120. dobet();
  121. }).fail(function (error) {
  122. dobet();
  123. });
  124. }
  125.  
  126. async function start() {
  127. drawChart().then(function () {
  128. startTime = new Date();
  129. dobet();
  130. }).catch(function () {
  131.  
  132. });
  133. }
  134.  
  135. randomizeSeed(start());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement