Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('#gameContainer').html('<div id="chart"></div>');
- $('#gameContainer').css('width', '1000px');
- $('#gameContainer').css('margin', 'auto');
- var basebet = 0.00000001, nextbet = basebet, nbet = betAmount * 2, chance = 49, bethigh = false;
- var dps = [], chart, bet = 0, win = 0, winStreak = 0, lose = 0, loseStreak = 0, profit = 0, balance = 0, color, startTime, runTime;
- var c = [0, 0, 0, 0], ch = [5, 25, 75, 95, 50], n = 1;
- function randomChance(min, max) {
- return Math.floor(Math.random() * (max - min + 1) ) + min;
- }
- function drawChart() {
- return new Promise(function (resolve, reject) {
- $.getScript('https://canvasjs.com/assets/script/canvasjs.min.js').done(function () {
- dps = [{
- x: 0,
- y: 0
- }];
- chart = new CanvasJS.Chart('chart', {
- theme: 'light2',
- axisX: {
- title: ''
- },
- axisY: {
- title: ''
- },
- title: {
- text: ''
- },
- data: [{
- type: 'line',
- dataPoints: dps
- }]
- });
- chart.render(resolve({ err: 0, msg: 'OK' }));
- }).fail(function (error) {
- reject({ err: 1, msg: 'ERROR' });
- });
- });
- }
- function updateChart() {
- dps.push({
- x: bet,
- y: profit,
- color: color
- })
- if (dps[dps.length - 2]) {
- dps[dps.length - 2].lineColor = color;
- }
- if (dps.length > 60) {
- dps.shift();
- }
- chart.render();
- }
- function dobet() {
- var betAmount = nextbet, prediction, direction;
- if (bethigh) {
- prediction = 49 - chance;
- direction = 'over';
- }
- else {
- prediction = chance;
- direction = 'under';
- }
- $.post('https://luckygames.io/play/', {
- game: 'dice',
- coin: $('#coin').val(),
- betAmount: betAmount,
- prediction: prediction,
- direction: direction,
- clientSeed: $('#clientSeed').val(),
- serverSeedHash: $('#serverSeedHash').text(),
- hash: user.hash
- }).done(function (response) {
- var l = JSON.parse(response);
- if (l.result) {
- bet += 1;
- profit += parseFloat(l.profit);
- var onTime = new Date().getTime();
- runTime = onTime - startTime;
- var runSeconds = Math.floor((runTime % (1000 * 60)) / 1000),
- runMinutes = Math.floor((runTime % (1000 * 60 * 60)) / (1000 * 60)),
- runHours = Math.floor((runTime % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)),
- runDays = Math.floor(runTime / (1000 * 60 * 60 * 24)),
- runSpeed = parseFloat((bet / runTime) * 1000);
- $('#serverSeedHash').text(l.serverSeedHash);
- $('#balance').val(l.balance);
- if ($('#myBets').hasClass('active')) {
- var e = $('#listContainer .table .tbody .tr:first-child');
- if (e.hasClass('full')) e.remove(), $('#listContainer .table .tbody').append(l.betHtml);
- else {
- e.before(l.betHtml);
- var t = $('#listContainer .table .tbody .tr').length;
- if (50 < t && (t = 40), 40 < t)
- for (var o = 0; o < t - 40; o++) $('#listContainer .table .tbody .tr:last-child').remove()
- }
- }
- if (l.gameResult == 'win') {
- win += 1;
- winStreak += 1;
- loseStreak = 0;
- color = 'green';
- nextbet = basebet;
- }
- else {
- lose += 1;
- loseStreak += 1;
- winStreak = 0;
- color = 'red';
- nextbet = betAmount * 2;}
- }
- if (loseStreak == 8) {
- nextbet = 0.00051;}
- console.clear();
- console.log(`balance: ${l.balance} ${$('#coin').val()}`);
- console.log(`profit: ${profit.toFixed(8)} ${$('#coin').val()}`);
- console.log(`speed: ${runSpeed.toFixed(2)} bet/s`);
- console.log(`run time: ${runDays}:${runHours}:${runMinutes}:${runSeconds}`);
- updateChart();
- dobet();
- }).fail(function (error) {
- dobet();
- });
- }
- async function start() {
- drawChart().then(function () {
- startTime = new Date();
- dobet();
- }).catch(function () {
- });
- }
- randomizeSeed(start());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement