Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name drinkmorecoffee's Martingale Bot
- // @namespace none
- // @author Original script by Gray, modifications by drinkmorecoffee
- // @version 2.0.0
- // @include https://just-dice.com/*
- // @grant none
- // ==/UserScript==
- /* Version 2 change notes [drinkmorecoffee]
- *
- * To use:
- *
- * * See Gray's installation notes below. One additional step, find the variable "userID"
- * and update it to reflect your account's uid value.
- *
- * Current known issues:
- *
- * * If betting is stopped using "stop" or "stop on win", the page must be reloaded
- * in order to resume operation. "Start" has no effect and "Resume" will lock up the script.
- *
- * * When reloading, the script will pull the starting bet from the server's init message.
- * This means that the initial bet may miss either a double down or reset to your initial bet.
- * The effect is usually trivial, but still worth mentioning as it could be noticeable if the site
- * resets after a large loss streak (when bet values are large).
- *
- * BACKGROUND:
- *
- * In its original state (Gray, v1.1), this script would crash almost immediately on just-dice.com,
- * with the server asking if the user was betting from multiple locations. While the Martingale
- * math looked solid, the script just didn't work reliably on that page. This may be due to
- * server side changes, because this script was well known when I was first searching for a tool like this.
- * If it were simply unreliable, it wouldn't have been so popular.
- *
- * To fix it, the script was modified to rely less heavily on header messages to determine
- * things like wins and losses, opting instead to directly monitor real-time visual status of relevant page elements.
- *
- * This approach more closely mimics the behavior of a human player who, for example, would spot a win by noticing
- * that the win counter changed (and more accurately, increased). Further, bet amounts are read directly
- * from (and written directly to) page elements, ensuring that the script always performs math on the correct values.
- * Tracking these elements solely within the script can be problematic given this site's
- * nontrivial lag times; it's very possible that the script values may not match the current state of the site.
- *
- * Please note that I did not create this script.
- * All credit for the idea and initial implementation go to Gray, and his donation address is maintained below.
- * If you like the script at all, please remember to toss a few Satoshis his way.
- *
- * If you appreciate my work on the functional alterations and feel inclined to tip, buy me a beer!
- * 1GSbiUPeASc6X78TPzohGfVquvtG2Soqow
- *
- * CYA:
- *
- * As always, use of this script is done at your own risk. By using it you agree that no one but yourself will be held liable
- * for any losses incurred through the use of this tool or any others like it.
- * This was created as a learning project and is intended to be used solely for entertainment.
- * Never risk more than you can afford to lose, you know the drill.
- *
- **/
- /* How would you go about using this?
- *
- * Install Greasemonkey plugin for Firefox
- * Install Firebug plugin for Firefox (It's better than the builtin console.)
- *
- * Make a new script with Greasemonkey
- * Type whatever you want into the form
- * Then paste this whole file into the editor
- *
- * Adjust to your needs.
- * Run.
- *
- * Other things you can do:
- *
- * That's it!
- *
- * Made a profit and feel like tipping people without seeing their genitals?
- *
- * Go ahead: 1Gray1ZsWo3kKBaCYdigiyPkD1pUnBqPxo
- *
- * Now go have fun with this... thing!
- **/
- $('<script>').attr({
- src: 'http://d3js.org/d3.v3.min.js',
- charset: 'UTF-8'
- }).appendTo(document.body);
- $(function() {
- var markup = '<div class="bot-controls"><fieldset><div class="row"><p class="llabel">bet start</p><input id="gb_bet" value="0.00001"><p class="rlabel">BTC</p></div><div class="row"><p class="llabel">chance</p><input id="gb_chance" value="50"><p class="rlabel">%</p></div></fieldset><fieldset><div class="row"><p class="llabel">bet multiplier</p><input id="gb_multiplier" value="2"><p class="rlabel" title="The bet gets multiplied by [mutiply factor] every [interval] steps.">x</p></div><div class="row"><p class="llabel">interval</p><input id="gb_interval" value="1"><p class="rlabel" title="The bet gets multiplied by [mutiply factor] every [interval] steps."> </p></div></fieldset><fieldset><div class="row"><p class="llabel">bet stop</p><input id="gb_betstop" value="0.01"><p class="rlabel">BTC</p></div><div class="row"><p class="llabel">profit stop</p><input id="gb_stopprofit" value="0.1"><p class="rlabel">BTC</p></div></fieldset><div class="clear"></div><div class="button_group"><button class="button_label action_toggle">start</button><div class="actions button_inner_group"><button id="gba_start">start</button><button id="gba_resume">resume</button><button id="gba_roll">roll</button><button id="gba_autorecover">autorecover</button></div></div><div class="button_group"><button class="button_label action_toggle">halt</button><div class="actions button_inner_group"><button id="gba_stop">stop</button><button id="gba_stoponwin">stop on win</button></div></div><div class="button_group"><button class="button_label action_toggle">roll</button><div class="actions button_inner_group"><button id="gba_rollhi">hi</button><button id="gba_rolllo">lo</button><button id="gba_rollrand" title="Grabs random bytes from random.org">random</button><button id="gba_rollswitch">switch on loss</button></div></div><div class="button_group"><button class="button_label action_toggle">chaos</button><div class="actions button_inner_group"><button id="gba_chaos">go</button></div><div class="clear"></div></div><div class="bot-stats"><div class="statspanel"><h2>Bot Stats</h2><div class="slabel">Status:</div><span id="gbs_status">Halted</span><span id="gbs_statusmessage"></span><div class="clear"></div><div class="slabel">Bets placed:</div><span id="gbs_bet">0</span><div class="clear"></div><div class="slabel">Bets won:</div><span id="gbs_betwin">0</span><div class="clear"></div><div class="slabel">Bets lost:</div><span id="gbs_betlost">0</span><div class="clear"></div><div class="slabel">Longest streak:</div><span id="gbs_streak">0</span><div class="clear"></div></div><div class="statspanel"><h2>More Stats</h2><div class="slabel">Rollmode:</div><span id="gbs_rollmode">random</span><span id="gbs_rollmodecurrent">lo</span><div class="clear"></div><div class="slabel">Wagered:</div><span id="gbs_wagered">0</span><div class="clear"></div><div class="slabel">Profit:</div><span id="gbs_myprofit">0</span><div class="clear"></div><div class="slabel">Stop at profit:</div><span id="gbs_stopprofit">none</span><div class="clear"></div><div class="slabel">Autorecover after server restart:</div><span id="gbs_autorecover">no</span></div></div><div class="clear"></div><div class="bot-foot">Made a nice profit? Tips are welcome!</div><div class="bot-foot">1Gray1ZsWo3kKBaCYdigiyPkD1pUnBqPxo (Gray, original script)</div><div class="bot-foot">1GSbiUPeASc6X78TPzohGfVquvtG2Soqow (drinkmorecoffee, v2)</div>';
- $panelWrapper = $('<div>').attr('id','dmcbot').css({display: 'none'}).insertAfter('#faq'),
- $panel = $('<div>').addClass('panel').append(markup).appendTo($panelWrapper),
- $bal = $("#pct_balance"),
- $in_bet = $('#gb_bet'),
- $in_chance = $('#gb_chance'),
- $in_multiplier = $('#gb_multiplier'),
- $in_interval = $('#gb_interval'),
- $in_betstop = $('#gb_betstop'),
- $in_stopprofit = $('#gb_stopprofit'),
- $a_start = $('#gba_start'),
- $a_resume = $('#gba_resume'),
- $a_roll = $('#gba_roll'),
- $a_stop = $('#gba_stop'),
- $a_stoponwin = $('#gba_stoponwin'),
- $a_rollhi = $('#gba_rollhi'),
- $a_rolllo = $('#gba_rolllo'),
- $a_rollrand = $('#gba_rollrand'),
- $a_rollswitch = $('#gba_rollswitch'),
- $a_chaos = $('#gba_chaos'),
- $a_autorecover = $('#gba_autorecover'), /* added in v2, [drinkmorecoffee] */
- $s_status = $('#gbs_status'),
- $s_statusmessage = $('#gbs_statusmessage'),
- $s_bet = $('#gbs_bet'),
- $s_betwin = $('#gbs_betwin'),
- $s_betlost = $('#gbs_betlost'),
- $s_streak = $('#gbs_streak'),
- $s_rollmode = $('#gbs_rollmode'),
- $s_rollmodecurrent = $('#gbs_rollmodecurrent'),
- $s_wagered = $('#gbs_wagered'),
- $s_myprofit = $('#gbs_myprofit'),
- $s_autorecover = $('#gbs_autorecover'),
- $s_stopprofit = $('#gbs_stopprofit');
- /* System stuff */
- this.initialized = false;
- this.auto = false;
- this.manual = false;
- this.stoponwin = false;
- this.stoponprofit = false;
- this.bet = 0;
- this.streak = 0;
- this.statusmessage = "";
- this.lastbetOutcome = null;
- /* Stats */
- this.stats = {
- won: 0,
- lost: 0,
- maxStreak: 0,
- currentProfit: 0,
- wagered: 0
- }
- /* win/los stats for current round */
- var total_wins = "0";
- var total_losses = "0";
- var streakLimit = 12; /* Change bet strategy after this many losses. See this.isLoss(). */
- /* win/loss stats for previous round. Used to determine outcome of last round. */
- /* This is a sort of built in delay, since the next round won't start
- until the page reports the outcome of the previous round. */
- var last_total_wins = "0";
- var last_total_losses = "0";
- /* win/loss transition flag, indicating the outcome of last round */
- var waiting_for_result = false;
- /* should prevent multiple messages stacking up and confusing the server */
- var socket_busy = false;
- /* semaphore to block the bet button press event, should only happen once per bet. */
- var bet_in_progress = false;
- /* time stamp of last bet. Used to track page performance and recover from server resets, etc. */
- var timestamp = 0;
- /* Maximum time to wait before reloading the page and starting over. Units: milliseconds */
- var serverLagTimeout = 60 * 1000;
- /* another autorecover attempt */
- var autorecover_status = false;
- var delay_ms = 0;
- /* more experimental timeout stuff */
- var time_last_good_response_received = 0;
- var time_since_last_good_response = 0;
- var right_now = 0;
- var response_lag = 0;
- /* Parameters */
- /* [drinkmorecoffee] the "initial bet" value below is actually specified by this script in the code above (see definition for var markup).
- I believe it's still more consistent to read it like the other values, but you may want to change it
- to suit your coding style. */
- this.initialBet = document.getElementById('gb_bet').value;
- this.maxBet = parseFloat(localStorage.getItem('gb_maxBet')) || 0.01;
- this.initialBalance = 0;
- this.currentBalance = 0;
- this.profitStop = parseFloat(localStorage.getItem('gb_profitStop')) || 0;
- this.multiplyFactor = parseFloat(localStorage.getItem('gb_multiplyFactor')) || 2; // Current bet is multiplied by [multiplyFactor] every [interval] rolls
- this.interval = parseFloat(localStorage.getItem('gb_interval')) || 1;
- this.chance = parseFloat(localStorage.getItem('gb_chance')) || 49.5;
- this.hi_lo = "hi";
- this.rollRandom = true;
- this.rollSwitch = false;
- this.byteLock = false;
- this.byteCount = 0;
- this.byteOffset = 0;
- /* [drinkmorecoffee] The below variable seems to have no effect whatsoever. */
- this.delay = 4000; // Wanna go slower or faster? Set this. Milliseconds.
- var last_bet = 0;
- var current_bet = "0";
- /* your account's UID - required for proper script operation! */
- var userID = "";
- /* [drinkmorecoffee] Bet control buttons */
- var double_button = document.getElementById('b_double');
- var half_button = document.getElementById('b_half');
- var bet_hi_button = document.getElementById('a_hi');
- this.init = function() {
- if(this.initialized) {
- return;
- }
- this.initialized = true;
- // Bind events
- /*socket.on("wins", this.isWin);
- socket.on("losses", this.isLoss);
- socket.on("jderror", this.isError); //*/
- socket.on("result", this.setBalance);
- socket.on("init", this.setBalance);
- $in_bet.val(tidy(this.initialBet));
- $in_chance.val(this.chance);
- $in_multiplier.val(this.multiplyFactor);
- $in_interval.val(this.interval);
- $in_betstop.val(tidy(this.maxBet));
- $in_stopprofit.val(tidy(this.profitStop));
- this.getNewRand();
- this.updateStats();
- }
- /* The following routine will execute once the page has completely loaded.
- This is necessary because the this.start() routine pulls from page element data,
- and if those elements haven't yet loaded, it will return null and crash the script.
- Note, the setTimeout functionality seems to work nicely here;
- I have no idea why it fails elsewhere in this script. */
- $(window).bind("load", function() {
- /* [drinkmorecoffee] Check the autorecover flag to see if we should begin automatically.
- If set, this will allow the system to start after auto-reloading following a server reset. */
- autorecover_status = localStorage.getItem('autorecover');
- if(autorecover_status == 'true')
- {
- window.setTimeout(function() {console.log("Automatically started after page load.");MG.start();}, 4000);
- }
- });
- /* If enabled, this feature will automatically begin betting on page load.
- The site lag monitor feature down in this.setBalance will reload the page if the server resets.
- If this feature is enabled, the result is that your betting continues (i.e., through the night)
- without interruption or user input. */
- this.autoRecover = function() {
- autorecover_status = localStorage.getItem('autorecover');
- if (autorecover_status == 'true')
- {
- localStorage.setItem('autorecover', 'false');
- document.getElementById('msg').innerHTML = "Script will NOT automatically reload the page and begin betting in the event of server reset.";
- }
- else
- {
- localStorage.setItem('autorecover', 'true');
- document.getElementById('msg').innerHTML = "Script will reload the page and automatically begin betting in the event of server reset.";
- }
- this.updateStats();
- };
- this.setBalance = function(data) {
- /* [drinkmorecoffee] This section will monitor the time lag between the last network response
- to one of our bets and the most recent network response to anyone else's bet. In short,
- it's monitoring website lag. If the server resets, our bet will be lost and it won't report
- a win/loss, so the script will wait infinitely. This routine waits for the site's bet log to
- start rolling again, monitoring the time since our last bet result was received.
- When the lag is great enough, the script determines that the site has reset
- and reloads the page. If the "autorecover" feature is enabled, betting will continue without
- user input. */
- if (this.auto === true) /* only perform this timestamp checking if we're actually betting */
- {
- if(data['uid'] === userID) /* this message is intended for us */
- {
- time_last_good_response_received = new Date().getTime(); /* time stamp of current message */
- }
- else /* this message is NOT intended for us */
- {
- right_now = new Date().getTime(); /* get current time */
- response_lag = right_now - time_last_good_response_received; /* this is the server lag time */
- }
- /* Time out event. Page took too long to load. Reload it.
- Note, the extra check for 100x timeout is to help with the initial launch.
- On page load, the first check is (current time - zero), which is huge. Disregard this value. */
- if ((response_lag > serverLagTimeout) && (response_lag < (100 * serverLagTimeout)))
- {
- if (localStorage.getItem('autorecover') === 'true') /* Only proceed if autorecover is enabled */
- {
- /* Reload the page. */
- window.location.reload(true);
- }
- }
- }
- /* process the site's win/loss report */
- if(data.uid == uid && data.balance) {
- var bal = parseFloat(data.balance);
- this.currentBalance = bal;
- if(this.initialBalance===0) {
- this.initialBalance = bal;
- }
- if(data['win'] === true) {
- this.isWin(data);
- } else if(data['win'] === false) {
- this.isLoss(data);
- }
- }
- }
- this.setBalance = this.setBalance.bind(this);
- this.start = function() {
- this.auto = true;
- this.manual = false;
- this.statusmessage = "";
- this.bet = this.initialBet;
- this.stats.currentProfit = 0;
- total_wins = document.getElementById('wins').firstChild.data;
- total_losses = document.getElementById('losses').firstChild.data;
- waiting_for_result = false;
- this.roll();
- };
- this.stop = function(stoponwin) {
- if(stoponwin) {
- this.stoponwin = true;
- } else {
- this.auto = false;
- }
- /* [drinkmorecoffee] Allow betting to resume using "start" or "resume" buttons.
- Note, this doesn't work. No idea why. If you stop or stop-on-win,
- you have to reload the page to begin again.*/
- bet_in_progress = false;
- this.updateStats();
- };
- this.resume = function() {
- /* [drinkmorecoffee] Note, this feature is still a little buggy. Not sure what's going on. */
- this.auto = true;
- this.roll();
- };
- this.getNewRand = function() {
- this.byteLock = true;
- $.get("http://www.random.org/integers/?num=256&min=0&max=1024&col=2&base=2&format=plain&rnd=new", function(bytes) {
- bytes = bytes.replace(/[^01]/g,'');
- MG.bytes = bytes;
- MG.byteCount = bytes.length;
- MG.byteOffset = 0;
- MG.byteLock = false;
- MG.setHiLo();
- });
- }
- this.setHiLo = function() {
- if(this.rollRandom) {
- this.hi_lo = (this.bytes[this.byteOffset++] === '1') ? 'hi' : 'lo';
- if(this.byteOffset === this.byteCount) {
- this.getNewRand();
- }
- } else if(this.rollSwitch) {
- }
- }
- this.roll = function() {
- /* [drinkmorecoffee] This function was causing problems in Gray's original code,
- as it would place bets far too quickly. Even the hard-coded delays
- used in the window.setTimeout function below didn't help because
- the site itself introduces inconsistent and nontrivial delays between bets.
- This method will check the visual display elements, waiting for the site itself
- to report a win or loss, just like you would do if playing manually. */
- while(waiting_for_result)
- {
- /* capture previous win/loss count */
- last_total_wins = total_wins;
- last_total_losses = total_losses;
- /* get updated win/loss count */
- total_wins = document.getElementById('wins').firstChild.data;
- total_losses = document.getElementById('losses').firstChild.data;
- /* Look for a change, clear the wait flag */
- /* This whole loop is just a basic delay to ensure the site is ready for
- the next bet. */
- if ((total_wins > last_total_wins) || (total_losses > last_total_losses))
- {
- waiting_for_result = false;
- bet_in_progress = false;
- /* When did this occur? */
- timestamp = new Date().getTime();
- }
- else
- {
- /* page has not yet reported a win/loss. See how long it's taken so far. */
- var currentTime = new Date().getTime;
- var serverLag = currentTime - timestamp;
- alert("Site took " + serverLag + " milliseconds to report that result.");
- /* Specify the maximum time to wait for a win/loss report.
- This should be a long delay, maybe 30-60 seconds. It's intended to catch server resets. */
- if (serverLag > serverLagTimeout)
- {
- /* reload the page */
- window.location.reload(true);
- }
- }
- }
- /* [drinkmorecoffee] Note, the setTimeout function doesn't seem to honor the specified delays.
- As such we had to implement the while loop below, using Date().getTime() to determine delay timouts.
- It's ugly, but stable. */
- /* Note also that this delay method may not be required, given that we're already waiting for the
- visual page elements to report a win/loss. It's included here for completeness, but you might
- want to experiment with removing it. */
- /* We're about to place a bet - this flag will force the above wait loop to execute next time. */
- waiting_for_result = true;
- //short delay
- //wait_ms(250);
- //window.setTimeout(this.placeBet, this.delay);
- this.placeBet();
- };
- this.placeBet = function() {
- if(this.auto || this.manual)
- {
- if (bet_in_progress == false)
- {
- bet_hi_button.click();
- bet_in_progress = true;
- }
- /* [drinkmorecoffee] Commented in favor of the above code, which interacts with website elements directly.
- socket.emit("bet", csrf, {
- chance: "" + this.chance,
- bet: this.bet.toFixed(8),
- which: this.hi_lo
- });
- */
- }
- if(this.rollRandom && this.byteLock) {
- window.setTimeout(this.placeBet, this.delay);
- return;
- } else {gtre
- this.setHiLo();
- }
- };
- this.placeBet = this.placeBet.bind(this);
- this.isWin = function(data) {
- this.streak = 0;
- this.stats.won++;
- this.stats.wagered += this.bet;
- this.lastbetOutcome = true;
- /* reset the bet to original amount */
- document.getElementById('pct_bet').value = this.initialBet;
- if(this.stoponprofit && (this.currentBalance-this.initialBalance) > this.profitStop) {
- this.auto = false;
- this.stoponprofit = false;
- this.statusmessage = "profit limit";
- } else if(this.stoponwin) {
- this.auto = false;
- this.stoponwin = false;
- this.statusmessage = "stop on win";
- } else if(this.auto) {
- this.roll();
- }
- this.updateStats();
- };
- this.isWin = this.isWin.bind(this);
- this.isLoss = function(data) {
- this.streak++;
- this.stats.lost++;
- this.stats.wagered += this.bet;
- this.lastbetOutcome = false;
- /* [drinkmorecoffee]
- Martingale is all about taking appropriate action in the event of a loss. If done right,
- you can come away with a small but consistent profit even though you'll lose just over half the time.
- Problem is, a long streak can wipe you out. You have to have a plan to deal with this eventuality.
- This section checks the current loss streak, and takes appropriate action if loss streak reaches "streakLimit". */
- if(this.streak >= streakLimit)
- {
- /* [drinkmorecoffee] */
- /* Strategy 1 - if the streak exceeds a certain length, just keep betting that amount.
- This will still use Martingale until a certain number of losses, then will stop doubling.
- Note, this strategy requires no code in this section.*/
- /* Strategy 2 - reset your bet to this.initialBet after too many losses.
- Standard Martingale up to this point, then just eat it and start over. */
- //document.getElementById('pct_bet').value = this.initialBet;
- /* Uncomment the next line if you want to reset the streak counter when it reaches the streakLimit you set earlier.
- I've found that leaving it out is more meaningful because it will show how long the streak of losses actually was. */
- //this.streak = 0;
- }
- else
- {
- /* [drinkmorecoffee] Double down */
- document.getElementById('pct_bet').value = parseFloat(data['bet']) * 2;
- }
- /* [drinkmorecoffee] Update max loss streak counter */
- this.stats.maxStreak = Math.max(this.streak, this.stats.maxStreak);
- if(this.bet > this.maxBet) {
- this.statusmessage = "bet limit";
- this.stoponwin = false;
- this.auto = false;
- } else if(this.auto) {
- if(this.rollSwitch) {
- this.hi_lo = (this.hi_lo === 'hi') ? 'lo' : 'hi';
- }
- this.roll();
- }
- this.updateStats();
- };
- this.isLoss = this.isLoss.bind(this);
- this.isError = function(data) {
- this.auto = false;
- console.log('Error. Halting.');
- console.log(data);
- };
- this.isError = this.isError.bind(this);
- this.updateStats = function() {
- var status = this.auto ? "Running" : (this.manual ? "Manual" : "Halted"),
- rollmode, currentroll;
- if(this.stoponwin && this.stoponprofit) {
- status += '; SW|SP';
- } else if(this.stoponwin) {
- status += '; SW';
- } else if(this.stoponprofit) {
- status += '; SP';
- }
- if(this.rollRandom) {
- rollmode = 'random';
- $s_rollmodecurrent.text(this.hi_lo).css('display', '');
- } else if(this.rollSwitch) {
- rollmode = 'switch';
- $s_rollmodecurrent.text(this.hi_lo).css('display', '');
- } else {
- rollmode = this.hi_lo;
- $s_rollmodecurrent.text(currentroll).css('display', 'none');
- }
- $s_status.text(status);
- $s_bet.text(this.stats.won + this.stats.lost);
- $s_betwin.text(this.stats.won);
- $s_betlost.text(this.stats.lost);
- $s_streak.text(this.stats.maxStreak);
- $s_rollmode.text(rollmode);
- /* [drinkmorecoffee] Firefox reported an error with the next line, said ".toFixed()" is not a function.
- Just had to parse the text as a float first, then it worked. */
- $s_wagered.text(commaify(parseFloat(this.stats.wagered).toFixed(8)));
- //$s_wagered.text(commaify(this.stats.wagered.toFixed(8)));
- $s_myprofit.text(commaify((this.currentBalance-this.initialBalance).toFixed(8)));
- $s_stopprofit.text(this.profitStop ? commaify(this.profitStop.toFixed(8)) : 'none');
- $s_autorecover.text(localStorage.getItem('autorecover'));
- if(this.statusmessage) {
- $s_statusmessage.text(this.statusmessage).css('display', '');
- } else {
- $s_statusmessage.text('').css('display', 'none');
- }
- }
- // Some styling // There are other ways for this. Bear with me. ;)
- $('<style>').append('\
- #graysbot .bot-stats,\
- #graysbot .button_group {\
- margin-top: 16px;\
- }\
- #graysbot .bot-stats .slabel {\
- width: 200px;\
- }\
- #graysbot #gba_chaos {\
- background-color: #FFCCCC;\
- border: 5px solid #CC9999;\
- }\
- #graysbot #gba_chaos:hover {\
- background-color: #DDAAAA;\
- }\
- ').appendTo(document.head);
- $a_start.on({
- click: function() {
- /*
- MG.initialBet = parseFloat( $in_bet.val() );
- //MG.initialBalance = parseFloat( $bal.val() )
- MG.maxBet = parseFloat( $in_betstop.val() );
- MG.profitStop = parseFloat( $in_stopprofit.val() );
- MG.chance = parseFloat( $in_chance.val() );
- MG.interval = parseFloat( $in_interval.val() );
- MG.multiplyFactor = parseFloat( $in_multiplier.val() );
- MG.stoponprofit = !isNaN(MG.profitStop) && MG.profitStop > 0
- localStorage.setItem('gb_initialBet', MG.initialBet);
- localStorage.setItem('gb_maxBet', MG.maxBet);
- localStorage.setItem('gb_profitStop', MG.profitStop);
- localStorage.setItem('gb_multiplyFactor', MG.multiplyFactor);
- localStorage.setItem('gb_interval', MG.interval);
- localStorage.setItem('gb_chance', MG.chance);
- MG.chaos = false;
- MG.stoponwin = false;
- MG.updateStats();
- */
- MG.start();
- }
- });
- $a_resume.on({
- click: function() {
- MG.resume();
- }
- });
- $a_roll.on({
- click: function() {
- MG.stop();
- MG.manual = true;
- MG.roll();
- }
- });
- $a_stop.on({
- click: function() {
- MG.stop();
- }
- });
- $a_stoponwin.on({
- click: function() {
- MG.stop(true)
- }
- });
- $a_rollhi.on({
- click: function() {
- MG.rollSwitch = false;
- MG.rollRandom = false;
- MG.hi_lo = 'hi';
- MG.updateStats();
- }
- });
- $a_rolllo.on({
- click: function() {
- MG.rollSwitch = false;
- MG.rollRandom = false;
- MG.hi_lo = 'lo';
- MG.updateStats();
- }
- });
- $a_rollrand.on({
- click: function() {
- MG.rollSwitch = false;
- MG.rollRandom = true;
- MG.updateStats();
- }
- });
- $a_rollswitch.on({
- click: function() {
- MG.rollSwitch = true;
- MG.rollRandom = false;
- MG.updateStats();
- }
- });
- $a_chaos.on({
- click: function() {
- msg("Chaosmode has yet to be implemented!");
- }
- });
- $a_autorecover.on({
- click: function() {
- MG.autoRecover();
- }
- })
- this.init();
- window.MG = this;
- // Lastly add the tab
- $('<li>').append($('<a>').text('Bot').attr('href','#dmcbot')).appendTo('.tabs');
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement