Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* yobit dice game autoplayer - only tested in chrome */
- /* inject into browser dev console */
- /* use betmachine.bet('0.00001'); to start the betting process */
- /* use betmachine.stop(); to end it. */
- var betmachine = {};
- //config vars
- betmachine.maxlosses = 15; //
- betmachine.whichButton = 1; // 1 = bet low, 2 = bet high.
- //system vars
- betmachine.started = false;
- betmachine.running = false;
- betmachine.origamount = 0;
- betmachine.origTotal = 0;
- betmachine.currentTotal = 0;
- betmachine.totalDifference = 0;
- betmachine.winCount = 0;
- betmachine.loseCount = 0;
- betmachine.prevWinLoss = '';
- betmachine.failureCount = 0;
- betmachine.stop = function() {
- betmachine.running = false;
- betmachine.started = false;
- };
- betmachine.getTotal = function() {
- return parseFloat($('body > div.wrapper > main > div > div.center_box > div > div.overview > div > div.create_new > table > tbody > tr > td:nth-child(1) > div > div > a > span').text().match(/-?(?:\d+(?:\.\d*)?|\.\d+)/)[0]);
- };
- betmachine.clearTable = function() {
- var dice_table = $($.fn.dataTable.tables()[1]).DataTable();
- dice_table.rows().remove().draw();
- };
- betmachine.reloadPage = function() {
- window.location = window.location;//+'?wc='+betmachine.winCount+'&lc='+betmachine.loseCount+'&ot='+betmachine.origTotal;
- };
- betmachine.getCurrentWinLossAmount = function() {
- return $('#DataTables_Table_0 > tbody > tr:nth-child(1) > td.green').text();
- };
- betmachine.checkReturn = function(amount,next) {
- if ((betmachine.getCurrentWinLossAmount()[0] == '-') && betmachine.prevWinLoss == betmachine.getCurrentWinLossAmount()) {
- //shit hasn't updated, possible problem.
- //wait 10 seconds for update and try again.
- betmachine.failureCount++;
- if (betmachine.failureCount > 3) {
- betmachine.stop();
- return false;
- } else {
- setTimeout(function(){
- next--;
- betmachine.checkReturn(amount,next);
- },5000);
- }
- } else {
- betmachine.currentTotal = betmachine.getTotal();
- betmachine.totalDifference = betmachine.currentTotal - betmachine.origTotal;
- if (betmachine.getCurrentWinLossAmount()[0] == '+') {
- // betmachine.whichButton = 1;
- betmachine.winCount++;
- betmachine.loseCount = 0;
- var message = (betmachine.currentTotal >= betmachine.origTotal) ? 'YOU ARE UP OR AHEAD: '+betmachine.totalDifference : 'YOU ARE DOWN: '+betmachine.totalDifference;
- console.log('WON! #'+betmachine.winCount+' ::: BETTING AGAIN :::' + message);
- betmachine.prevWinLoss = betmachine.getCurrentWinLossAmount();
- /*
- //reload page after x amount of wins.
- if (betmachine.winCount > 20) {
- betmachine.reloadPage();
- }
- */
- setTimeout(function(){
- if ($('#DataTables_Table_0 > tbody > tr:nth-child(1) > td.green').text() === "") {
- console.log('SHITS FUCKED, RESTARTING BEFORE BIG LOSSES');
- window.location = window.location;
- }
- // betmachine.clearTable();
- if (betmachine.running) betmachine.bet(betmachine.origamount,0);
- },Math.ceil(Math.random()*2000)+5000);
- } else {
- betmachine.loseCount++;
- var message = (betmachine.currentTotal >= betmachine.origTotal) ? 'YOU ARE UP OR AHEAD: '+betmachine.totalDifference : 'YOU ARE DOWN: '+betmachine.totalDifference;
- setTimeout(function(){
- // if (next >= 5)
- // betmachine.whichButton = 2;
- if (next < betmachine.maxlosses) {
- next++;
- console.log('LOST! #'+betmachine.loseCount+' trying again:'+next+' ::: '+message);
- //betmachine.whichButton = (next>=Math.floor(betmachine.maxlosses/2)) ? 2:1;
- var betamount = (amount*2) + betmachine.origamount;
- if ((next+1) > 3) betamount -= betmachine.origamount;
- console.log('next amount: ',betmachine.origamount,next,betamount);
- if (betmachine.running) betmachine.bet(betamount,next);
- } else {
- console.log('AW SHIT LOST TOO MANY! #'+betmachine.loseCount);
- if (betmachine.running) {
- betmachine.stop();
- // betmachine.reloadPage();
- }
- //betmachine.bet(betmachine.origamount,0);
- //betmachine.clearTable();
- }
- },2000);//(2000*next)+4000);
- }
- }
- };
- betmachine.bet = function(amount,next=0) {
- if (!betmachine.started) {
- betmachine.started = true;
- betmachine.running = true;
- betmachine.origamount = amount;
- betmachine.origTotal = betmachine.getTotal();
- betmachine.currentTotal = betmachine.origTotal;
- betmachine.totalDifference = 0;
- }
- if (!betmachine.running) {
- console.log('closing it down');
- return false;
- }
- document.title = '['+betmachine.winCount+']/['+betmachine.loseCount+']:['+betmachine.totalDifference+']';
- var addamount = 0;
- // if (next === 0 && Math.ceil(Math.random()*2) == 1) addamount = amount; //randomly double initial bet for fun.
- $('.poles .bet').val(amount+addamount);
- console.log('pressing: '+betmachine.whichButton);
- $('body > div.wrapper > main > div > div.center_box > div > div.overview > div > div.create_new > table > tbody > tr > td:nth-child(4) > input:nth-child('+betmachine.whichButton+')').click();
- if (betmachine.running)
- setTimeout(function(){betmachine.checkReturn(amount,next)},2000);
- };
- /*
- //if using a browser extension to auto inject the javascript you can have the plugin automagically restart betting.
- if (!document.getElementById('trade_market')) {
- setTimeout(function(){window.location = window.location;},5000);
- } else {
- $(function(){
- setTimeout(function(){
- betmachine.bet(0.2);
- },4000);
- });
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement