Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var loop, currentloss, curbet, basebet, seedcount, prebet, prerollsenabled, profit, prerollson, prerollcount, betval, currentwin, target2, condition2, wincount, xhr, tstatus, seedlength, counter, charset, everyxrolls,wins,losses, data1, data2, swapenabled, betstarted, wmultcount, lmultcount, storebet;
- condition2="<";
- target2="10";
- seedcount=0;
- currentloss = 0;
- lmultcount = 0;
- wmultcount = 0;
- prerollcount = 0;
- wins = 0;
- losses = 0;
- profit = 0;
- //jQuery UI CSS
- var jqueryready = false;
- var link = document.createElement("link");
- link.href = "https://jquery-ui.googlecode.com/svn/tags/latest/themes/dark-hive/jquery-ui.css";
- link.type = "text/css";
- link.rel = "stylesheet";
- document.getElementsByTagName("head")[0].appendChild(link);
- //jQuery UI inject
- (function() {
- jqueryready = true;
- var e = ".thing",
- t = {
- outline: "1px dashed #f0f",
- cursor: "pointer"
- };
- var n = function() {
- if (window.jQuery) {
- r();
- } else {
- var e = document.createElement("script");
- e.setAttribute("src", "//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js");
- document.body.appendChild(e);
- }
- };
- var r = function() {
- if (window.jQuery.ui) {
- i();
- } else {
- var e = document.createElement("script");
- e.setAttribute("src", "//ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/jquery-ui.js");
- document.body.appendChild(e);
- initGUI();
- }
- };
- var i = function() {
- $(e).css(t).draggable().on("click", function(e) {
- console.log(e.target.id + ":", e.target.style.left, e.target.style.top);
- });
- };
- n();
- })();
- betstarted=false;var swapswap=2,swapcount=0;
- var curbalance=$('div.hero > div.hero__content > div > div.grid__item.S--one-whole.M--one-whole.custom--one-whole > aside > div.grid.grid--bottom.grid--reversed > div:nth-child(2) > span.btn.btn--tertiary.btn--large.btn--limited.btn--block > span.btn__text.select div').text()*100000000;
- function bet() {
- if (betstarted === false) {
- betstarted=true;
- if ($('#stoprofitenabled').is(':checked') === true){
- if (profit >= $('#stopprofitamount').val()) {
- clearInterval(loop);
- loopenabled=false;
- loopcount=0;
- }
- }
- if ($('#stoploss2enabled').is(':checked') === true){
- if (profit <= (-1 * $('#stoplossamount').val())) {
- clearInterval(loop);
- loopenabled=false;
- loopcount=0;
- }
- }
- if (prerollsenabled === true){
- prebet=Math.floor($('#prerollbet').val()*100000000);
- curbet = prebet;
- } else {
- curbet=betval;
- }
- var betData = {
- amount: curbet,
- condition: condition2,
- target: target2,
- },
- url = 'https://api.primedice.com/api/bet?access_token=' + localStorage.token;
- if (curbet > curbalance) {
- clearInterval(loop);
- loopenabled=false;
- loopcount=0;
- }
- $.ajax({
- url: url,
- type: 'POST',
- data: betData,
- datatype: 'json',
- success: function(data, textStatus, jqXHR) {
- if ($('#seedchangeon').is(":checked") === true){
- if ($('#charset').val() != "") {
- charset=$('#charset').val();
- }
- if ($('#seedxrolls').val() == ""){} else {
- seedcount++;
- if (seedcount >= $('#seedxrolls').val()){
- seedchange(seedgen());
- seedcount=0;
- }
- }
- }
- data1 = data;
- profit = profit = (parseFloat(profit) + parseFloat((data1.bet.profit/100000000))).toFixed(8);
- curbalance = data1.user.balance;
- addRow();
- if (loopenabled === true) {
- loopcount++;
- }
- if ($('#hilo').val() == "swap") {
- if ($('#swaprollsenabled').is(':checked') === true){
- swapswap = $('#swaprolls').val();
- swapcount++;
- if (swapcount >= swapswap){
- swap();
- swapcount=0;
- }
- } else {
- swap();
- }
- }
- $('.btn__text.select div').text((data1.user.balance / 100000000).toFixed(8));
- if (data.bet.win === true) {
- win();
- if (prerollson === true){
- if (prerollsenabled === false) {
- prerollsenabled = true;
- prerollcount=0;
- }
- }
- $('.btn__text.select div').attr('style', 'color:green;');
- } else {
- lose();
- $('.btn__text.select div').attr('style', 'color:red;');
- }
- if (data.bet.win === true) { $('#proff').attr('style', 'text-align: center; width: 20%; padding: 5px;color:green;'); } else { $('#proff').attr('style', 'text-align: center; width: 20%; padding: 5px;color:red;'); }
- betstarted=false;
- },
- error: function(jqXHR, textStatus, errorThrown) {
- betstarted=false;
- }
- });
- } else if (betstarted === true) {}
- }
- prerollcount=0;
- function preroll(){
- }
- function win() {
- if ($('#stopwinenabled').is(':checked') === true && prerollsenabled === false) {
- clearInterval(loop);
- currentloss=0;
- loopcount=0;
- loopenabled=false;
- }
- if (prerollson === true){
- if (prerollsenabled === true) {
- prerollcount = 0;
- }
- }
- if ($('#seedchangeonwin').is(':checked') === true) {
- seedchange(seedgen());
- }
- wins++;
- currentloss=0;
- if ($('#winmultenabled').is(':checked') === true) {
- if (prerollsenabled === true) {} else {
- if (prerollson === true && prerollsenabled === false) {
- prerollsenabled = true;
- prerollcount = 0;
- }
- wmultcount++;
- if (wmultcount < $('#resetwin').val()){
- betval = betval * $('#winlossmultiplier').val();
- } else if (wmultcount >= $('#resetwin').val()) {
- betval = basebet;
- wmultcount = 0;
- }
- }
- }
- if ($('#lossmultenabled').is(':checked') === true) {
- if (prerollsenabled === true) {prerollcount=0;} else {
- if (prerollson === true && prerollsenabled === false){
- prerollsenabled = true;
- prerollcount = 0;
- }
- betval = basebet;
- lmultcount = 0;
- }
- }
- }
- function lose() {
- currentloss++;
- if ($('#stoplossenabled').is(':checked') === true && prerollsenabled === false) {
- if ($('#stoplosses').val() <= currentloss){
- clearInterval(loop);
- currentloss=0;
- loopcount=0;
- loopenabled=false;
- }
- }
- if (prerollson === true){
- if (prerollsenabled === true){
- prerollcount++;
- if (prerollcount >= $('#numprerolls').val()){
- prerollsenabled=false;
- }
- }
- }
- losses++;
- if ($('#lossmultenabled').is(':checked') === true) {
- if (prerollsenabled === true) {} else {
- lmultcount++;
- if (lmultcount >= $('#multloss').val()){
- betval = betval * $('#winlossmultiplier').val();
- lmultcount = 0;
- }
- }
- }
- }
- function swap(){
- if (condition2 == "<") {
- condition2=">";
- target2 = (99.99-(99/$('#payout').val())).toFixed(2);
- } else if (condition2 == ">") {
- condition2="<";
- target2 =(99/$('#payout').val()).toFixed(2);
- }
- }
- function addRow() {
- $('#lastID').text('Last Bet ID: ' + data1.bet.id);
- var bettable = '', bettab = '#lastbet2';
- bettable += '<tr><td>' + (data1.bet.amount / 100000000).toFixed(8) + '</td>';
- bettable += '<td>' + data1.bet.multiplier + 'x' + '</td>'; /* return bet payout */
- bettable += '<td>' + (data1.bet.target).toFixed(2) + '</td>'; /* return target*/
- bettable += '<td>' + data1.bet.roll + '</td>'; /* return roll */
- bettable += '<td id="proff">' + (data1.bet.profit / 100000000).toFixed(8) + '</td></tr>';
- var stattable = '', stattab = '#lastbet3';
- stattable += '<tr><td style="color:green;">'+ (data1.user.balance/100000000).toFixed(8) + '</td><td style="color:red;">'+ currentloss + '</td><td style="color:green;">' + wins + '</td><td style="color:red;">'+ losses +'</td><td id="profit">'+ profit +'</td></tr>';
- $(stattab).empty();
- $(stattab).prepend(stattable);
- stattable = '';
- if ($(bettab + ' tbody tr').length >= 3) {
- $(bettab + ' tr').last().remove();
- $(bettab).prepend(bettable);
- bettable='';
- } else if ($(bettab).length < 3) {
- $(bettab).prepend(bettable);
- bettable='';
- }
- $('#lastbet2 *, #lastbet3 *, #lastbet *, #proff').css("text-align", "center");$('#lastbet2 *, #lastbet3 *, #lastbet *').css("width", "20%");
- $('#lastbet *').css("padding", "5px");$('#lastbet *').css("border-bottom", "1px solid #ccc");$('#result-1').css("padding", "5px");
- $('#lastbet2 *, #lastbet3 *, #proff').css("padding", "5px");$('#lastbet > tbody > tr > th:nth-child(2)').css("border-top", "1px solid #ddd");
- if (profit >= 0) {
- $('#profit').css("color", "green");
- } else {
- $('#profit').css("color", "red");
- }
- }
- $('<div id="paraContainer">').appendTo('.hero');
- var gui;
- gui='';
- gui += '<div id="result">';
- gui += '<ul>';
- gui += '<li><a href="/play#lastbet-1">Last Bets: </a></li>';
- gui += '<li><a style="float:right;" id="lastID" href="/play#lastbet-1">Last Bet ID: (none yet!)</a></li>';
- gui += '<li><a style="float:right;" id="detach" href="/play#lastbet-1">Detach</a></li>';
- gui += '</ul>';
- gui += '<div id="result-1">';
- gui += '<table id="lastbet">';
- gui += '<tr><th>Bet</th><th>Payout</th><th>Game</th><th>Roll</th><th>Profit</th></tr></table>';
- gui += '<table id="lastbet2">';
- gui += '</table>';
- gui += '<table id="lastbet">';
- gui += '<tr><th>Balance</th><th>Loss Streak</th><th>Total Wins</th><th>Total Losses</th><th>Total Profit</th></tr></table>';
- gui += '<table id="lastbet3">';
- gui += '</table>';
- gui += '</div>';
- gui += '</div>';
- gui +='</div>';
- gui += '<div id="paraGUI">';
- gui += '<ul>';
- gui += '<li><a href="/play#paraGUI-1">Params</a></li>';
- gui += '<li><a href="/play#paraGUI-2">On Win/Loss</a></li>';
- gui += '<li><a href="/play#paraGUI-3">Advanced</a></li>';
- gui += '<li><a href="/play#paraGUI-4">Seed</a></li>';
- gui += '<li><a href="/play#paraGUI-5">Credits</a></li>';
- gui += '</ul>';
- gui += '<div id="paraGUI-1">';
- gui += '<div>';
- gui += '<table id="params1">';
- gui += '<tr><th>Basebet:</th><th>Multiplier:</th><th>Hi/Lo/Swap</th></tr>';
- gui += '<tr><td><input id="basebet" placeholder="Basebet"/></td><td><input id="payout" placeholder="ex. 10, 90"/></td>';
- gui += '<td><select id="hilo"><option value="hi">Hi</option><option value="lo">Lo</option><option value="swap">Swap</option></select></td></tr>';
- gui += '<tr><th>Enable Prerolls</th><th># of Prerolls</th><th>Preroll Bet</th></tr>';
- gui += '<tr><td><input id="prerollsenabled" type="checkbox"/></td><td><input id="numprerolls"/></td><td><input id="prerollbet"/></td></tr>';
- gui += '</table>';
- gui += '</div>';
- gui +='</div>';
- gui +='<div id="paraGUI-2">';
- gui +='<div>';
- gui += '<table id="params1">';
- gui += '<tr><th>Multiply On Loss? <input id="lossmultenabled" type="checkbox"/></th><th>Multiply on Win? <input id="winmultenabled" type="checkbox"/></th><th>Multiplier on W/L</th></tr>';
- gui += '<tr><td><label for="multloss">Mutiply After X Losses:</label><br><input id="multloss" placeholder="Multiply Every X Rolls"/></td><td><label for="multwin">Reset After X Wins:</label><br><input id="resetwin" placeholder="Reset After X Wins"/></td>';
- gui += '<td><input id="winlossmultiplier" placeholder="2 (2x), 1.5 (1.5x) etc"/></tr>';
- gui += '</table>';
- gui+= '</div>';
- gui +='</div>';
- gui +='<div id="paraGUI-3">';
- gui +='<div>';
- gui += '<table id="params1">';
- gui += '<tr><th><label>Stop After: <input id="stoplossenabled" type="checkbox"></label></th><th><label>Stop On Win: </label></th><th>Swap After: <input id="swaprollsenabled" type="checkbox"></th></tr>';
- gui += '<tr><td><input style="width:85px;" id="stoplosses" placeholder="# of losses"/></td><td><input id="stopwinenabled" type="checkbox"></td>';
- gui += '<td><input id="swaprolls" type="text" placeholder="# of rolls"></tr>';
- gui += '<tr><th>Stop on Profit:<input id="stopprofitenabled" type="checkbox"></th><th>Stop on Loss: <input id="stoploss2enabled" type="checkbox"></th></tr>';
- gui += '<tr><td><input id="stopprofitamount" type="text"/> </td><td>-<input id="stoplossamount" type="text"/></td></tr>';
- gui += '<tr><p>Note: Use Total Profit as your reference for stop loss/profit. Do NOT enter a balance.</p></tr>'
- gui += '</table>';
- gui+= '</div>';
- gui +='</div>';
- gui +='<div id="paraGUI-4">';
- gui +='<div>';
- gui += '<table id="params1">';
- gui += '<tr><th>Current Seed:</th><th>Charset:</th><th>Change Every #: <input id="seedchangeon" type="checkbox"/></th></tr>';
- gui += '<tr><td><input style="color:red;text-align:center;"id="currentseed"/></td><td><input id="charset" placeholder="Optional"/></td>';
- gui += '<td><input id="seedxrolls" placeholder="ex. 1, 10, 20"/></tr>';
- gui += '<tr><td>Change on Win: <input id="seedchangeonwin" type="checkbox"/> </td></tr>';
- gui += '</table>';
- gui += '</div>';
- gui +='</div>';
- gui +='<div id="paraGUI-5">';
- gui += '<div>';
- gui += '<p>Version: 0.4</p>';
- gui += '<p>Created By: paradocks</p>';
- gui += '<p>PD Username: paradocks</p>';
- gui += '<p>BTCTalk Username: paradoxal420</p>';
- gui += '<p>Tip Addy: <input type="text" style="width:auto;"value="1LuLz9djKFPTfbFuCKedm2FuX1fiSqt5hg"/></p>';
- gui += '</div>';
- gui +='</div>';
- gui +='<div id="buttonz"><button id="start">Start</button><button id="stop">Stop</button><button id="setparams">Set Params</button><button id="seedchange">Change Seed</button><button id="saveparams">Save Params</button><button id="resetstats">Reset Stats</button><br><label for="numrolls">Number of Rolls: <input id="numrollsenabled" type="checkbox"></label><input style="width:85px;" id="numrolls"/><br></div>';
- gui +='</div>';
- $(gui).appendTo("#paraContainer");
- seedlength = 5;
- counter = 0;
- charset = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ123';
- everyxrolls = 3;
- function seedgen() {
- var seed = '';
- for (var i = 0; i <= seedlength; i++)
- seed += charset.charAt(Math.floor(Math.random() * charset.length));
- return seed;
- }
- function seedchange(s) {
- var url = 'https://api.primedice.com/api/seed?access_token=' + localStorage.token,
- sData = {
- seed: s
- };
- $.ajax({
- url: url,
- type: 'POST',
- data: sData,
- datatype: 'json',
- success: function(data, textStatus, jqXHR) {
- data2 = data;
- $('#currentseed').val(data2.seeds.client);
- },
- error: function(jqXHR, textStatus, errorThrown) {
- return false;
- }
- });
- }
- // Click Funcs
- $('#seedchange').click(function(){
- seedchange(seedgen());
- });
- $('#detach').click(function(){
- $('#result').draggable();
- });
- $('#setparams').click(function(){
- if ( $('#prerollsenabled').is(':checked') === true) {
- prerollson = true;
- prerollcount=0;
- prerollsenabled=true;
- prebet=Math.floor($('#prerollbet').val()*100000000);
- basebet = Math.floor($('#basebet').val()*100000000);
- betval = basebet;
- } else if ( $('#prerollsenabled').is(':checked') === false ) {
- prerollson = false;
- prerollsenabled=false;
- basebet = Math.floor($('#basebet').val()*100000000);
- betval = basebet;
- }
- if ($('#hilo').val() == "hi") {
- condition2=">";
- target2 = (99.99-(99/$('#payout').val())).toFixed(2);
- } else if ($('#hilo').val() == "lo") {
- condition2="<";
- target2 = (99/$('#payout').val()).toFixed(2);
- } else if ($('#hilo').val() == "swap") {
- condition2="<";
- target2 = 0 + (99/$('#payout').val()).toFixed(2);
- swapenabled=true;
- }
- });
- $('#saveparams').click(function(){
- localStorage.setItem("params-stored", true);
- localStorage.setItem("basebet", $('#basebet').val());
- localStorage.setItem("payout", $('#payout').val());
- localStorage.setItem("prerollbet", $('#prerollbet').val());
- localStorage.setItem("prerollenabled", $('#prerollsenabled').is(':checked'));
- localStorage.setItem("numprerolls", $('#numprerolls').val());
- })
- if (localStorage.getItem("params-stored") === "true") {
- $('#basebet').val(localStorage.getItem("basebet"));
- $('#payout').val(localStorage.getItem("payout"));
- $('#prerollbet').val(localStorage.getItem("prerollbet"));
- $('#prerollsenabled').prop('checked', localStorage.getItem("prerollenabled"));
- $('#numprerolls').val(localStorage.getItem("numprerolls"));
- }
- var loop, loopenabled, loopcount, looptimes;
- loopenabled = false;
- loopcount = 0;
- $('#start').click(function(){
- if ($('#numrollsenabled').is(':checked') === true) {
- looptimes = $('#numrolls').val();
- } else {
- looptimes = 999999999;
- }
- if (loopenabled === false) {
- loopenabled = true;
- loop = setInterval(function(){
- if (loopcount >= looptimes){
- clearInterval(loop);
- loopcount = 0;
- loopenabled=false;
- } else {
- bet();
- }
- }, 103);
- }
- });
- $('#stop').click(function(){
- clearInterval(loop);
- loopenabled=false;
- loopcount=0;
- });
- $('#resetstats').click(function(){
- wins = 0;
- losses = 0;
- profit = 0;
- currentloss = 0;
- addRow();
- });
- function initGUI(){
- setTimeout(function(){
- $('#paraContainer').css("font-size", "11px")
- $('#result, #paraGUI').tabs();
- $('#paraGUI-1, #params1 td, #params1 th').css("padding", "5px");
- $('#params1 select, #params1 input').css("width", "80%");
- $('#params1 select, #params1 input').css("margin", "2px");
- $('#params1 select, #params1 input').css("padding", "4px");
- $('#params1 td, #params1 th').css("text-align", "center");
- $('#buttonz *').css("margin","5px");
- $('#buttonz').css("padding","3px");
- $('#buttonz').css("text-align","center");
- $('#buttonz').css("border-top","1px solid #bbb");
- $('#paraContainer').draggable();
- $('#paraContainer').css("z-index","1000");
- $('#paraContainer').width(450);
- $('#paraContainer button').button();
- },750);
- }
Advertisement
Add Comment
Please, Sign In to add comment