Advertisement
paradocks

Untitled

Dec 9th, 2014
15,950
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var loop, currentloss, betspeed, dialog, swapwincount, incrementwincount, swaplosscount, 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, manualenabled;
  2. var balancebefore;var chart='';
  3. betspeed=500;
  4. seedcount = 0;
  5. currentloss = 0;
  6. lmultcount = 0;
  7. wmultcount = 0;
  8. prerollcount = 0;
  9. wins = 0;
  10. losses = 0;
  11. profit = 0;
  12. swaplosscount = 0;
  13. swapwincount = 0;
  14. incrementwincount = 0;
  15. loopenabled = false;
  16. manualenabled = false;
  17. loopcount = 0;
  18. seedlength = 5;
  19. counter = 0;
  20. charset = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ123';
  21. everyxrolls = 3;
  22. var JSINJ = '';
  23. JSINJ += '<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/jquery-ui.js"></script>';
  24. JSINJ += '<link rel="stylesheet" type="text/css" href="https://jquery-ui.googlecode.com/svn/tags/latest/themes/dot-luv/jquery-ui.css">';
  25. JSINJ += '<script src="https://code.highcharts.com/highcharts.js"></script>';
  26. JSINJ += '<script src="https://code.highcharts.com/modules/exporting.js"></script>';
  27. $(JSINJ).appendTo('head');
  28.  
  29.  
  30. function initializeUI() {
  31.     // Begin UI
  32.     $('.hero__main').empty();
  33.     var UI = '';
  34.     UI += '<div id="result">';
  35.     UI += '<ul>';
  36.     UI += '<li><a href="/play#result-1">Last Bets: </a></li>';
  37.     UI += '<li><a href="/play#result-2">Bet History: </a></li>';
  38.     UI += '<li><a href="/play#result-1" id="lagfix">Browser Lag?: Click Here </a></li>';
  39.     UI += '</ul>';
  40.     UI += '<div id="result-1">';
  41.     UI += '<table id="lastbet">';
  42.     UI += '<tr><th>Bet</th><th>Payout</th><th>Game</th><th>Roll</th><th>Profit</th></tr></table>';
  43.     UI += '<table id="lastbet2">';
  44.     UI += '</table>';
  45.     UI += '<table id="lastbet">';
  46.     UI += '<tr><th>Balance</th><th>Loss Streak</th><th>Total Wins</th><th>Total Losses</th><th>Total Profit</th></tr></table>';
  47.     UI += '<table id="lastbet3">';
  48.     UI += '</table>';
  49.     UI += '</div>';
  50.     UI += '<div  id="result-2">';
  51.     UI += '<table id="lastbet">';
  52.     UI += '<tr><th>Bet</th><th>Payout</th><th>Game</th><th>Roll</th><th>Profit</th></tr></table>';
  53.     UI += '<div style="max-height:84px !important;overflow-y: scroll;overflow-x: hidden;"id="historycontainer">';
  54.     UI += '<table id="lastbet2">';
  55.     UI += '</table>';
  56.     UI += '</div>';
  57.     UI += '</div>';
  58.     UI += '</div>';
  59.     UI += '<div id="params">';
  60.     UI += '<h3>Basic Settings</h3>';
  61.     UI += '<div>';
  62.     UI += '<table id="params1">';
  63.     UI += '<tr><th>Basebet:</th><th>Multiplier:</th><th>Hi/Lo/Swap</th></tr>';
  64.     UI += '<tr><td><input id="basebet" type="text" placeholder="Basebet"/><br><div id="basebetslider"></div></td><td><input id="payout" type="text" placeholder="ex. 10, 90"/><br><div id="payoutslider"></div></td>';
  65.     UI += '<td><div id="hilo"><input type="radio" id="hi" value="hi" name="hilo"><label for="hi">Hi</label><input type="radio" id="lo" value="lo" name="hilo" checked="checked"><label for="lo">Lo</label><input type="radio" id="swap" value="swap" name="hilo"><label for="swap">Swap</label></div></td></tr>';
  66.     UI += '<tr><th></th><th># of Prerolls</th><th>Preroll Bet</th></tr>';
  67.     UI += '<tr><td> Prerolls: <input id="prerollsenabled" type="checkbox"/><label style="width: auto !important;" for="prerollsenabled">Off</label></td><td><input id="numprerolls" type="text" /></td><td><input type="text" id="prerollbet"/></td></tr>';
  68.     UI += '<tr><th><label>Loss Preroll: <input id="lossprerollenabled" type="checkbox"><label style="width: auto !important;" for="lossprerollenabled">Off</label></label></th><th><label>After # Losses: <input style="width:85px;" id="prerollafterlosses" type="text" placeholder="After # of losses"/></th><th># of Prerolls After Loss: <input style="width:85px;" type="text" id="numlossprerolls" placeholder="# of prerolls"/></th></tr>';
  69.     UI += '</table>';
  70.     UI += '</div>';
  71.     UI += '<h3>Win/Loss Settings</h3>';
  72.     UI += '<div>';
  73.     UI += '<table id="params1">';
  74.     UI += '<tr><th>Multiply On Loss: <input id="lossmultenabled" type="checkbox"/><label style="width: auto !important;" for="lossmultenabled">Off</label></th><th>Multiply on Win: <input id="winmultenabled" type="checkbox"/><label style="width: auto !important;" for="winmultenabled">Off</label></th><th>Multiplier on W/L</th></tr>';
  75.     UI += '<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>';
  76.     UI += '<td><input id="winlossmultiplier" placeholder="2 (2x), 1.5 (1.5x) etc"/></tr>';
  77.     UI += '<tr><td><label>Increment Basebet by: <input id="incrementbaseenabled" style="padding: 2px !important;" type="checkbox"/><label style="width: auto !important;" for="incrementbaseenabled">Off</label></label></td><td><input placeholder="ex 0.00000100" id="incrementwin"> BTC </td><td><input placeholder="after #wins" id="incrementafterwins"></td></tr>';
  78.     UI += '<tr><td>Reset base after base reaches: <input placeholder="ex 0.00000500"id="resetincrementbasebet"> </td><td> Reset to Base After Profit: <input type="checkbox" id="resetprofitenabled"><label style="width: auto !important;" for="resetprofitenabled">Off</label> </td><td><input placeholder="ex. reset after profit=0.00100000" id="resetprofit"></td></tr>';
  79.     UI += '</table>';
  80.     UI += '</div>';
  81.     UI += '<h3>Advanced Settings</h3>';
  82.     UI += '<div>';
  83.     UI += '<table id="params1">';
  84.     UI += '<tr><th><label>Stop After: <input id="stoplossenabled" type="checkbox"><label style="width: auto !important;" for="stoplossenabled">Off</label></label></th><th><label>Stop On Win: <input id="stopwinenabled" type="checkbox"><label style="width: auto !important;" for="stopwinenabled">Off</label></label></th><th>Swap After: <input id="swaprollsenabled" type="checkbox"><label style="width: auto !important;" for="swaprollsenabled">Off</label></th></tr>';
  85.     UI += '<tr><td><input style="width:85px;" id="stoplosses" placeholder="# of losses"/></td><td></td>';
  86.     UI += '<td><input id="swaprolls" type="text" placeholder="# of rolls"></tr>';
  87.     UI += '<tr><th>Stop on Profit:<input id="stopprofitenabled" type="checkbox"><label style="width: auto !important;" for="stopprofitenabled">Off</label></th><th>Stop on Loss: <input id="stoploss2enabled" type="checkbox"><label style="width: auto !important;" for="stoploss2enabled">Off</label></th><th>Reset After: <input id="resetlossenabled" type="checkbox"><label style="width: auto !important;" for="resetlossenabled">Off</label></th></tr>';
  88.     UI += '<tr><td><input id="stopprofitamount" type="text"/> </td><td>-<input id="stoplossamount" type="text"/></td><td><input id="resetlosses" placeholder="# Losses" type="text"/></td></tr>';
  89.     UI += '<tr><th>Swap On Loss: <input id="swaponlossenabled" type="checkbox"><label style="width: auto !important;" for="swaponlossenabled">Off</label></th><th></th><th>Swap On Win:<input id="swaponwinenabled" type="checkbox"><label style="width: auto !important;"for="swaponwinenabled">Off</label></th></tr>';
  90.     UI += '<tr><th><label for="swapafterlosses">Swap After X Losses</label></th><th></th><th><label for="swapafterwins">Swap After X Wins</label></th></tr>';
  91.     UI += '<tr><td><input id="swapafterlosses"></td><td></td><td><input id="swapafterwins"></td></tr>';
  92.     UI += '<tr><p>Note: Use Total Profit as your reference for stop loss/profit. Do NOT enter a balance.</p></tr>';
  93.     UI += '</table>';
  94.     UI += '</div>';
  95.     UI += '<h3>Seed Settings</h3>';
  96.     UI += '<div>';
  97.     UI += '<table id="params1">';
  98.     UI += '<tr><th>Current Seed:</th><th>Charset:</th><th>Change Every #: <input id="seedchangeon" type="checkbox"/><label style="width: auto !important;" for="seedchangeon">Off</label></th></tr>';
  99.     UI += '<tr><td><input style="color:red;text-align:center;"id="currentseed"/></td><td><input id="charset" placeholder="Optional"/></td>';
  100.     UI += '<td><input id="seedxrolls" placeholder="ex. 1, 10, 20"/></tr>';
  101.     UI += '<tr><td>Change on Win: <input style="width: auto !important;" id="seedchangeonwin" type="checkbox"/><label style="width: auto !important;" for="seedchangeonloss">Off</label> </td><td>Change on Loss: <input id="seedchangeonloss" type="checkbox"/><label for="seedchangeonloss">Off</label></td></tr>';
  102.     UI += '</table>';
  103.     UI += '</div>';
  104.     UI += '</div>';
  105.     UI += '<div id="manual" style="display:none;">';
  106.     UI += '<div style = "padding: 0 !important; z-index: 1000 !important;width:450px !important;height:350px !important;"id="dialog-form" title="Profit Over Time"><div  id="chartContainer"></div></div>';
  107.     //Manual Mode HTML
  108.     UI += '<table id="params1"><tr>';
  109.     UI += '<th><label for="manualamount">Bet Amount: </label></th><th><label for="manualttarget">Multiplier: </label></th><th><label for="manualthilo">High/Low: </label></th></tr>';
  110.     UI += '<tr><td><input id="manualamount"><td><input id="manualtarget"></td><td><div id="manualhilo"><input type="radio" id="manualhi" value="High" name="manualhilo"><label for="manualhi">Hi</label><input type="radio" id="manuallow"  name="manualhilo" checked="checked"><label for="manuallow">Low</label></td></tr></table></div>';
  111.    
  112.  
  113.  
  114.     UI += '</div><center><div id="toolbar" class="ui-widget-header ui-corner-all"><div id="buttonz"><span id="startstop"><button id="start">Start</button><button id="stop">Stop</button></span><span id="setsavereset"><button id="setparams">Set Params</button><button id="saveparams">Save Params</button><button id="resetstats">Reset Stats</button></span><span id="themeseed"><button id="seedchange">Change Seed</button><button id="darktheme">Theme - On/Off</button></span><button id="openChart">Show Chart</button><button style="padding:2px;font-size:10px;"id="manualmode">Manual Mode</button></div></div></center><br><center><button class="btn btn--primary btn--huge btn--limited btn--block text--center" id="spinner2">Roll</button></center>';
  115.     //<label for="numrolls">Number of Rolls: <input id="numrollsenabled" type="checkbox"></label><input style="width:85px;" id="numrolls"/>
  116.     $(UI).appendTo('.hero__main');
  117.     $(function(){
  118.         Highcharts.createElement('link',{href:'http://fonts.googleapis.com/css?family=Unica+One',rel:'stylesheet',type:'text/css'},null,document.getElementsByTagName('head')[0]);Highcharts.theme={colors:["#2b908f","#90ee7e","#f45b5b","#7798BF","#aaeeee","#ff0066","#eeaaee","#55BF3B","#DF5353","#7798BF","#aaeeee"],chart:{backgroundColor:{linearGradient:{x1:0,y1:0,x2:1,y2:1},stops:[[0,'#2a2a2b'],[1,'#3e3e40']]},style:{fontFamily:"'Unica One', sans-serif"},plotBorderColor:'#606063'},title:{style:{color:'#E0E0E3',textTransform:'uppercase',fontSize:'20px'}},subtitle:{style:{color:'#E0E0E3',textTransform:'uppercase'}},xAxis:{gridLineColor:'#707073',labels:{style:{color:'#E0E0E3'}},lineColor:'#707073',minorGridLineColor:'#505053',tickColor:'#707073',title:{style:{color:'#A0A0A3'}}},yAxis:{gridLineColor:'#707073',labels:{style:{color:'#E0E0E3'}},lineColor:'#707073',minorGridLineColor:'#505053',tickColor:'#707073',tickWidth:1,title:{style:{color:'#A0A0A3'}}},tooltip:{backgroundColor:'rgba(0, 0, 0, 0.85)',style:{color:'#F0F0F0'}},plotOptions:{series:{dataLabels:{color:'#B0B0B3'},marker:{lineColor:'#333'}},boxplot:{fillColor:'#505053'},candlestick:{lineColor:'white'},errorbar:{color:'white'}},legend:{itemStyle:{color:'#E0E0E3'},itemHoverStyle:{color:'#FFF'},itemHiddenStyle:{color:'#606063'}},credits:{style:{color:'#666'}},labels:{style:{color:'#707073'}},drilldown:{activeAxisLabelStyle:{color:'#F0F0F3'},activeDataLabelStyle:{color:'#F0F0F3'}},navigation:{buttonOptions:{symbolStroke:'#DDDDDD',theme:{fill:'#505053'}}},rangeSelector:{buttonTheme:{fill:'#505053',stroke:'#000000',style:{color:'#CCC'},states:{hover:{fill:'#707073',stroke:'#000000',style:{color:'white'}},select:{fill:'#000003',stroke:'#000000',style:{color:'white'}}}},inputBoxBorderColor:'#505053',inputStyle:{backgroundColor:'#333',color:'silver'},labelStyle:{color:'silver'}},navigator:{handles:{backgroundColor:'#666',borderColor:'#AAA'},outlineColor:'#CCC',maskFill:'rgba(255,255,255,0.1)',series:{color:'#7798BF',lineColor:'#A6C7ED'},xAxis:{gridLineColor:'#505053'}},scrollbar:{barBackgroundColor:'#808083',barBorderColor:'#808083',buttonArrowColor:'#CCC',buttonBackgroundColor:'#606063',buttonBorderColor:'#606063',rifleColor:'#FFF',trackBackgroundColor:'#404043',trackBorderColor:'#404043'},legendBackgroundColor:'rgba(0, 0, 0, 0.5)',background2:'#505053',dataLabelsColor:'#B0B0B3',textColor:'#C0C0C0',contrastTextColor:'#F0F0F3',maskColor:'rgba(255,255,255,0.3)'};Highcharts.setOptions(Highcharts.theme);
  119.     });
  120.     //jQ-UI Settings
  121.     jQSettings = '';
  122.     jQSettings += '<script>';
  123.     // Settings Here
  124.     jQSettings += '';
  125.     jQSettings += '$(function(){';
  126.     jQSettings += 'dialog = $( "#dialog-form" ).dialog({autoOpen: false,height: 350,width: 450,modal: true, buttons: {Close: function() {dialog.dialog( "close" )}}});';
  127.     jQSettings += 'chart = $("#chartContainer").highcharts({chart: {height: 350, width: 450},credits: { enabled: false }, title:{text:"Total Profit vs. # of Bets",x:-20}, subtitle:{text: "Bet Profit vs. # Bets"},yAxis:{title:{text:"Profit/Total Profit"},data:[0]},xAxis:{title:{text:"# of Bets"},data:[0]},series:[{name:"Total Profit",data:[0]},{name: "Bet Profit",data: [0]}]});';
  128.     jQSettings += '$("#basebetslider").slider({value:0.00000000,min: 0.00000000,max: 0.00020001,step: 0.0000000010, slide: function( event, ui ) {$( "#basebet" ).val( ui.value );}});';
  129.     jQSettings += '$("#payoutslider").slider({value:5.0,min: 1,max: 100,step: 1, slide: function( event, ui ) {$( "#payout" ).val( ui.value );}});';
  130.     jQSettings += '$("#buttonz button").button();$("input:checkbox").button();$("div#hilo").buttonset();';
  131.     jQSettings += '$("#themeseed").buttonset();$("#setsavereset").buttonset();$("#startstop").buttonset();';
  132.     jQSettings += '$("#result").tabs();$("#manualhilo").buttonset(); $( "#params" ).accordion({collapsible: true});});';
  133.  
  134.     jQSettings += '</script>';
  135.     $(jQSettings).appendTo('head');
  136.     var UICSS = '';
  137.     UICSS += '<style>';
  138.     UICSS += 'span.ui-slider-handle { width: 12px !important; }';
  139.     UICSS += '#basebetslider , #basebet, #payoutslider, #payout { width: 100% !important; }';
  140.     UICSS += '#params h3 { padding: 5px; }';
  141.     UICSS += '#params label { width: auto !important; }';
  142.     UICSS += 'span.ui-button-text { font-size: 9px; }';
  143.     UICSS += '#params, #result { border-radius: 0px; width: auto !important; }';
  144.     UICSS += '.hero__main { padding: 2px; margin: 5px; }';
  145.     UICSS += '.hero__main {font-size: 10px !important;}';
  146.     UICSS += '.ui-accordion-content { height: auto !important; padding: 5px !important;}';
  147.     UICSS += '.ui-accordion .ui-accordion-content {margin-left: 3px !important; margin-right: 3px;margin-top: 0.5px;}';
  148.     UICSS += 'table#params1 input:text { width: auto; height: auto; }';
  149.     UICSS += 'table#params1 th, table#params1 td, table#params1 label { width: 33% !important; padding:5px !important; }';
  150.     UICSS += '#buttonz { margin:2px; padding: 1px; text-align: center; font-size: 12px;}';
  151.     UICSS += '#toolbar { width:100%;display: inline-block; padding: 0px; margin-top:3px; }';
  152.     UICSS += '#params *, #result * { font-size: 10px;}';
  153.     UICSS += '#toolbar button { margin: 1px; }';
  154.     UICSS += 'label.ui-button span, label .ui-button { padding: 2px !important; }';
  155.     UICSS += '#manual { margin: 10px 0px 10px 60px;}';
  156.     UICSS += 'body > div.ui-widget-overlay.ui-front { display: none !important; }';
  157.     UICSS += '.ui-button-icon-primary { top: 0 !important; left: 0 !important;}';
  158.     UICSS += '</style>';
  159.     setTimeout(function () {
  160.         $(UICSS).appendTo('head');
  161.     }, 3000);
  162. }
  163. setTimeout(function () {
  164.     initializeUI();
  165. }, 1000);
  166.  
  167. function darkTheme() {
  168.     var css = '',
  169.         backgroundurl = 'http://cdn.wonderfulengineering.com/wp-content/uploads/2014/01/HD-backgrounds-3.jpg';
  170.     css += '<style id="paraDark">';
  171.     css += 'header, .tabs, .slideout__content__inside, .chat__you *, .btn, .hero__main, .rollrow-dark, .rollbox--prominent, .chat__input-holder{background-color:#121212 !important;color:#ccc !important;}';
  172.     css += 'time{color:#ccc !important;}';
  173.     css += 'div.tabs > div > div.live-data-header > div{background-color:#111111;border-top:1px solid #777; border-bottom:1px solid #777;}';
  174.     css += '.btn,.btn--secondary.btn--active,.btn--secondary.btn--selector, .btn--submit:last-child{border:1px solid #777 !important;background-color:#242130 !important;color:#ccc!important;}';
  175.     css += '.btn:hover,.btn--secondary.btn--active:hover,.btn--secondary.btn--selector:hover{border:1px solid #777 !important;background-color:#322E47 !important;color:#ccc!important;}';
  176.     css += '.hero{margin-bottom:0px;background:url("' + backgroundurl + '") no-repeat 50% 50%;}';
  177.     css += '.slideout *{color:#ccc;}';
  178.     css += '.tabs{padding-top:20px;border-top:1px solid #777 !important;}';
  179.     css += 'header{border: 1px solid #777 !important;border-left:none !important;border-right:none !important;}';
  180.     css += '.rollrow-thin, .rollrow-dark .chat__input-holder {background-color:#212121;}';
  181.     css += '.input{background-color:#323232 !important;color:#ccc;}';
  182.     css += '.action-open-slideout{background-color:#121212 !important;}';
  183.     css += 'span.admin{color:red !important}';
  184.  
  185.     css += '</style>';
  186.     $(css).appendTo('head');
  187. }
  188. darkTheme();
  189. var mixcount = 0;
  190. betstarted = false;
  191. var swapswap = 2,
  192.     swapcount = 0,
  193.     lossprerollcount = 0,
  194.     lossprerollson;
  195. 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;
  196.  
  197. function bet() {
  198.     if (betstarted === true) {} else {
  199.         betstarted = true;
  200.         if (manualenabled === true) {
  201.             manualamount = Math.floor($('#manualamount').val() * 100000000);
  202.             if ($('#manualhi').is(':checked') === true) {
  203.                 manualcondition = '>';
  204.                 manualtarget = (99.99 - (99 / $('#manualtarget').val())).toFixed(2);
  205.             } else if ($('#manuallow').is(':checked') === true) {
  206.                 manualcondition = '<';
  207.                 manualtarget = (99 / $('#manualtarget').val()).toFixed(2);
  208.             }
  209.             var betData = {
  210.                     amount: manualamount,
  211.                     condition: manualcondition,
  212.                     target: manualtarget,
  213.                 },
  214.                 url = 'https://api.primedice.com/api/bet?access_token=' + localStorage.token;
  215.         } else {
  216.                 if ($('#resetprofitenabled').is(':checked') === true) {
  217.                 if (parseFloat(profit) >= $('#resetprofit').val()) {
  218.                         betval = basebet;
  219.                         curbet = betval;
  220.                         profit = 0;
  221.                        
  222.                         wmultcount = 0;
  223.                         /*betval = basebet;
  224.                         wmultcount = 0;
  225.                         profit = 0;
  226.                         if ($('#payout').val() == '5') {
  227.                             $('#payout').val(10);
  228.                         } else {
  229.                             $('#payout').val(5);
  230.                         }
  231.                         if (condition2 == '>') {
  232.                            
  233.                             target2 = (99.99 - (99 / $('#payout').val())).toFixed(2);
  234.                         } else if (condition2 == '<') {
  235.                            
  236.                         target2 = (99 / $('#payout').val()).toFixed(2);
  237.                         }*/
  238.                     }
  239.                 }
  240.             if ($('#stopprofitenabled').is(':checked') === true) {
  241.                 if (profit >= $('#stopprofitamount').val()) {
  242.                     clearInterval(loop);
  243.                     loopenabled = false;
  244.                     loopcount = 0;
  245.                 }
  246.             }
  247.            
  248.            
  249.             if ($('#resetlossenabled').is(':checked') === true && prerollsenabled === false) {
  250.                 if ($('#resetlosses').val() <= currentloss) {
  251.                    
  252.                     betval = basebet;
  253.                     lmultcount = 0;
  254.                     wmultcount = 0;
  255.                     currentloss = 0;
  256.  
  257.                 }
  258.             }
  259.             if ($('#stoploss2enabled').is(':checked') === true) {
  260.                 if (profit <= (-1 * $('#stoplossamount').val())) {
  261.                     clearInterval(loop);
  262.                     loopenabled = false;
  263.                     loopcount = 0;
  264.                 }
  265.             }
  266.             if (prerollsenabled === true) {
  267.                 prebet = Math.floor($('#prerollbet').val() * 100000000);
  268.                 curbet = prebet;
  269.             } else {
  270.                 curbet = betval;
  271.             }
  272.             if ($('#lossprerollenabled').is(':checked') === true) {
  273.                 if (lossprerollson === true) {
  274.  
  275.                     curbet = prebet;
  276.                 } else {
  277.                     curbet = betval;
  278.                 }
  279.             }
  280.  
  281.             var betData = {
  282.                     amount: curbet,
  283.                     condition: condition2,
  284.                     target: target2,
  285.                 },
  286.                 url = 'https://api.primedice.com/api/bet?access_token=' + localStorage.token;
  287.         }
  288.         if (curbet > curbalance) {
  289.             clearInterval(loop);
  290.             loopenabled = false;
  291.             loopcount = 0;
  292.         }
  293.  
  294.         $.ajax({
  295.             url: url,
  296.             type: 'POST',
  297.             data: betData,
  298.             datatype: 'json',
  299.             async: true,
  300.             success: function (data, textStatus, jqXHR) {
  301.                
  302.                 if ($('#seedchangeon').is(':checked') === true) {
  303.                     if ($('#charset').val() !== '') {
  304.                         charset = $('#charset').val();
  305.                     }
  306.                     if ($('#seedxrolls').val() === '') {} else {
  307.                         seedcount++;
  308.                         if (seedcount >= $('#seedxrolls').val()) {
  309.                             seedchange();
  310.                             seedcount = 0;
  311.                         }
  312.                     }
  313.                 }
  314.                 data1 = data;
  315.                 profit = profit = (parseFloat(profit) + parseFloat((data1.bet.profit / 100000000))).toFixed(8);
  316.                 curbalance = data1.user.balance;
  317.                 addRow();
  318.  
  319.                 if (loopenabled === true) {
  320.                     loopcount++;
  321.                 }
  322.                 if ($('input:radio[name=hilo]:checked').val() == 'swap') {
  323.                     if ($('#swaprollsenabled').is(':checked') === true) {
  324.                         swapswap = $('#swaprolls').val();
  325.                         swapcount++;
  326.                         if (swapcount >= swapswap) {
  327.                             swap();
  328.                             swapcount = 0;
  329.                         }
  330.                     } else {
  331.                         swap();
  332.                     }
  333.                 }
  334.                 $('.btn__text.select div').text((data1.user.balance / 100000000).toFixed(8));
  335.                 if (data.bet.win === true) {
  336.                     win();
  337.  
  338.                     if (prerollson === true) {
  339.                         if (prerollsenabled === false) {
  340.                             prerollsenabled = true;
  341.                             prerollcount = 0;
  342.                         }
  343.                     }
  344.                     $('.btn__text.select div').attr('style', 'color:green;');
  345.  
  346.                 } else {
  347.                     lose();
  348.                     $('.btn__text.select div').attr('style', 'color:red;');
  349.                 }
  350.  
  351.  
  352.                 if (data.bet.win === true) {
  353.                     $('#result-1 #proff:nth(0), #result-2 #proff:nth(0)').attr('style', 'text-align: center; width: 20%; padding: 5px;color:green;');
  354.                 } else {
  355.                     $('#result-1 #proff:nth(0), #result-2 #proff:nth(0)').attr('style', 'text-align: center; width: 20%; padding: 5px;color:red;');
  356.                 }
  357.                 betstarted = false;
  358.  
  359.             },
  360.             error: function (jqXHR, textStatus, errorThrown) {
  361.                 betstarted = false;
  362.  
  363.             }
  364.  
  365.         });
  366.     }
  367. }
  368.  
  369. function seedchange() {
  370.     function seedgen() {
  371.         var seed = '';
  372.  
  373.         for (var i = 0; i <= seedlength; i++)
  374.  
  375.             seed += charset.charAt(Math.floor(Math.random() * charset.length));
  376.  
  377.         return seed;
  378.     }
  379.     var s = seedgen(),
  380.         url = 'https://api.primedice.com/api/seed?access_token=' + localStorage.token,
  381.         sData = {
  382.             seed: s
  383.         };
  384.  
  385.     $.ajax({
  386.         url: url,
  387.         type: 'POST',
  388.         data: sData,
  389.         datatype: 'json',
  390.         success: function (data, textStatus, jqXHR) {
  391.             data2 = data;
  392.             $('#currentseed').val(data2.seeds.client);
  393.  
  394.  
  395.         },
  396.         error: function (jqXHR, textStatus, errorThrown) {
  397.             return false;
  398.         }
  399.     });
  400. }
  401.  
  402. function addRow() {
  403.     // Update Chart
  404.     chart.addPoint([parseFloat(wins+losses), parseFloat(profit)]);
  405.     chart2.addPoint([parseFloat(wins+losses), parseFloat((data1.bet.profit/100000000).toFixed(8))]);
  406.     $('#lastID').text('Last Bet ID: ' + data1.bet.id);
  407.     var bettable = '',
  408.         bettab = '#result-1 #lastbet2';
  409.     var bettab2 = '#result-2 #lastbet2';
  410.     bettable += '<tr><td>' + (data1.bet.amount / 100000000).toFixed(8) + '</td>';
  411.     bettable += '<td>' + data1.bet.multiplier + 'x' + '</td>'; /* return bet payout */
  412.     bettable += '<td>' + (data1.bet.target).toFixed(2) + '</td>'; /* return target*/
  413.     bettable += '<td>' + data1.bet.roll + '</td>'; /* return roll */
  414.     bettable += '<td id="proff">' + (data1.bet.profit / 100000000).toFixed(8) + '</td></tr>';
  415.  
  416.     var stattable = '',
  417.         stattab = '#lastbet3';
  418.     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>';
  419.     $(stattab).empty();
  420.     $(stattab).prepend(stattable);
  421.     stattable = '';
  422.     $(bettab2).prepend(bettable);
  423.     if ($(bettab + ' tbody tr').length >= 3) {
  424.         $(bettab + ' tr').last().remove();
  425.         $(bettab).prepend(bettable);
  426.         bettable = '';
  427.     } else if ($(bettab).length < 3) {
  428.         $(bettab).prepend(bettable);
  429.         bettable = '';
  430.     }
  431.  
  432.     $('#lastbet2 *, #lastbet3 *, #lastbet *, #proff').css('text-align', 'center');
  433.     $('#lastbet2 *, #lastbet3 *, #lastbet *').css('width', '20%');
  434.     $('#lastbet *').css('padding', '5px');
  435.     $('#lastbet *').css('border-bottom', '1px solid #ccc');
  436.     $('#result-1').css('padding', '5px');
  437.     $('#lastbet2 *, #lastbet3 *, #proff').css('padding', '5px');
  438.     $('#lastbet > tbody > tr > th:nth-child(2)').css('border-top', '1px solid #ddd');
  439.     if (profit >= 0) {
  440.         $('#profit').css('color', 'green');
  441.     } else {
  442.         $('#profit').css('color', 'red');
  443.     }
  444. }
  445.  
  446. function win() {
  447.     if ($('#incrementbaseenabled').is(':checked') === true) {
  448.         incrementwincount++;
  449.         if (incrementwincount >= $('#incrementafterwins').val()) {
  450.             incrementwincount = 0;
  451.             basebet = Math.floor(basebet + ($('#incrementwin').val() * 100000000));
  452.             if (basebet >= Math.floor($('#resetincrementbasebet').val() * 100000000)) {
  453.                 basebet = Math.floor($('#basebet').val() * 100000000)
  454.             }
  455.         }
  456.     }
  457.     if ($('#swaponlossenabled').is(':checked') === true) {
  458.         swaplosscount = 0;
  459.     }
  460.     if ($('#swaponwinenabled').is(':checked') === true) {
  461.         swapwincount++;
  462.         if (swapwincount >= $('#swapafterwins').val()) {
  463.             swapwincount = 0;
  464.             swap();
  465.  
  466.         }
  467.     }
  468.     if ($('#stopwinenabled').is(':checked') === true && prerollsenabled === false) {
  469.         clearInterval(loop);
  470.         currentloss = 0;
  471.         loopcount = 0;
  472.         loopenabled = false;
  473.     }
  474.     if (prerollson === true) {
  475.         if (prerollsenabled === true) {
  476.             prerollcount = 0;
  477.         }
  478.     }
  479.     if ($('#seedchangeonwin').is(':checked') === true) {
  480.         seedchange();
  481.     }
  482.     wins++;
  483.     currentloss = 0;
  484.  
  485.     if ($('#winmultenabled').is(':checked') === true) {
  486.         if (prerollsenabled === true) {} else {
  487.  
  488.             if (prerollson === true && prerollsenabled === false) {
  489.                 prerollsenabled = true;
  490.                 prerollcount = 0;
  491.             }
  492.            if (lossprerollson === true) {} else {
  493.                 wmultcount++;
  494.                 if (wmultcount < $('#resetwin').val()) {
  495.                    
  496.                         betval = betval * $('#winlossmultiplier').val();
  497.                  
  498.                 } else if (wmultcount >= $('#resetwin').val()) {
  499.                     betval = basebet;
  500.                     wmultcount = 0;
  501.  
  502.  
  503.  
  504.                 }
  505.             }
  506.  
  507.         }
  508.         if ($('#lossprerollenabled').is(':checked') === true) {
  509.             if (lossprerollson === true) {
  510.                 lossprerollcount = $('#prerollafterlosses').val();
  511.                 lossprerollson = true;
  512.  
  513.             } else {
  514.                 lossprerollcount = 0;
  515.                 lossprerollson = false;
  516.             }
  517.         }
  518.     }
  519.     if ($('#lossmultenabled').is(':checked') === true) {
  520.         if (prerollsenabled === true) {
  521.             prerollcount = 0;
  522.         } else {
  523.             if (prerollson === true && prerollsenabled === false) {
  524.                 prerollsenabled = true;
  525.                 prerollcount = 0;
  526.             }
  527.             if (lossprerollson === true) {
  528.                 lmultcount = 0;
  529.                 lossprerollcount = $('#prerollafterlosses').val();
  530.             } else {
  531.                 betval = basebet;
  532.                 lmultcount = 0;
  533.                 lossprerollcount = 0;
  534.             }
  535.         }
  536.     }
  537.  
  538. }
  539.  
  540. function lose() {
  541.     if ($('#swaponlossenabled').is(':checked') === true) {
  542.         swaplosscount++;
  543.         if (swaplosscount >= $('#swapafterlosses').val()) {
  544.             swap();
  545.             swaplosscount = 0;
  546.         }
  547.     }
  548.     if ($('#lossprerollenabled').is(':checked') === true) {
  549.         lossprerollcount++;
  550.         if (lossprerollcount == $('#prerollafterlosses').val()) {
  551.             lossprerollson = true;
  552.         }
  553.         if (lossprerollcount >= (parseFloat($('#numlossprerolls').val()) + parseFloat($('#prerollafterlosses').val()))) {
  554.             curbet = betval;
  555.             lossprerollson = false;
  556.             lossprerollcount = 0;
  557.         }
  558.     }
  559.  
  560.     if ($('#seedchangeonloss').is(':checked') === true) {
  561.         seedcount = 0;
  562.         seedchange();
  563.     }
  564.  
  565.     currentloss++;
  566.  
  567.     if ($('#stoplossenabled').is(':checked') === true) {
  568.         if ($('#stoplosses').val() <= currentloss) {
  569.            
  570.             clearInterval(loop);
  571.             currentloss = 0;
  572.             loopcount = 0;
  573.             loopenabled = false;
  574.        
  575.         }
  576.     }
  577.  
  578.     if (prerollson === true) {
  579.         if (prerollsenabled === true) {
  580.             prerollcount++;
  581.             if (prerollcount >= $('#numprerolls').val()) {
  582.                 prerollsenabled = false;
  583.             }
  584.         }
  585.  
  586.     }
  587.     losses++;
  588.  
  589.     if ($('#lossmultenabled').is(':checked') === true) {
  590.         if (prerollsenabled === true) {} else {
  591.             if (lossprerollson === true) {} else {
  592.                 lmultcount++;
  593.                 if (lmultcount >= $('#multloss').val()) {
  594.                     betval = betval * $('#winlossmultiplier').val();
  595.                     lmultcount = 0;
  596.                 }
  597.             }
  598.         }
  599.     }
  600. }
  601.  
  602. function swap() {
  603.     if (condition2 == '<') {
  604.         condition2 = '>';
  605.         target2 = (99.99 - (99 / $('#payout').val())).toFixed(2);
  606.     } else if (condition2 == '>') {
  607.         condition2 = '<';
  608.         target2 = (99 / $('#payout').val()).toFixed(2);
  609.     }
  610. }
  611. var themeoff = false;
  612. // Click Funcs
  613. function init2() {
  614.     $('#darktheme').click(function () {
  615.         if (themeoff === true) {
  616.             darkTheme();
  617.             $('#smoothness').remove();
  618.             var jqCSS = document.createElement('link');
  619.                 jqCSS.href = 'https://jquery-ui.googlecode.com/svn/tags/latest/themes/dot-luv/jquery-ui.css';
  620.                 jqCSS.type = 'text/css';
  621.                 jqCSS.rel = 'stylesheet';
  622.                 jqCSS.id = 'dark';
  623. document.getElementsByTagName('head')[0].appendChild(jqCSS);
  624.             themeoff = false;
  625.         } else if (themeoff === false) {
  626.             removeTheme();
  627.             $('#dark').remove();
  628.             var jqCSS = document.createElement('link');
  629.             jqCSS.href = 'https://jquery-ui.googlecode.com/svn/tags/latest/themes/smoothness/jquery-ui.css';
  630.             jqCSS.type = 'text/css';
  631.             jqCSS.rel = 'stylesheet';
  632.             jqCSS.id = 'smoothness';
  633.             document.getElementsByTagName('head')[0].appendChild(jqCSS);
  634.             themeoff = true;
  635.         }
  636.     });
  637.     $('#spinner2').click(function () {
  638.         bet();
  639.     });
  640.     if ($('#params label.ui-button').prev().is(':checked') === false && $('#params label.ui-button').prev().attr('type') != 'radio') {
  641.         $('#params label.ui-button').text('On');
  642.     } else {
  643.         if ($('#params label.ui-button').prev().attr('type') != 'radio') {
  644.             $('#params label.ui-button').text('Off');
  645.         }
  646.     }
  647.     $('#params label.ui-button').click(function () {
  648.         if ($(this).prev().is(':checked') === false && $(this).prev().attr('type') != 'radio') {
  649.             $(this).text('On');
  650.         } else {
  651.             if ($(this).prev().attr('type') != 'radio') {
  652.                 $(this).text('Off');
  653.             }
  654.         }
  655.     })
  656.     $('#seedchange').click(function () {
  657.         seedchange();
  658.     });
  659.     $('#detach').click(function () {
  660.         $('#result').draggable();
  661.     });
  662.     $('#manualmode').click(function () {
  663.         if ($(this).text() == 'Manual Mode') {
  664.             manualenabled = true;
  665.             $('#params').hide();
  666.             $('#manual').show();
  667.             $(this).text('Auto Mode');
  668.             return;
  669.         } else if ($(this).text() == 'Auto Mode') {
  670.             manualenabled = false;
  671.             $('#params').show();
  672.             $('#manual').hide();
  673.             $(this).text('Manual Mode');
  674.             return;
  675.         }
  676.     })
  677.     $('#setparams').click(function () {
  678.         if ($('#lossprerollenabled').is(':checked') === false) {
  679.             lossprerollson = false;
  680.         }
  681.         lmultcount = 0;
  682.         currentloss = 0;
  683.         wmultcount = 0;
  684.         loopcount = 0;
  685.         if ($('#prerollbet').val() !== "") {
  686.             prebet = $('#prerollbet').val();
  687.         } else {
  688.             prebet = 0;
  689.         }
  690.         if ($('#prerollsenabled').is(':checked') === true) {
  691.  
  692.             prerollson = true;
  693.             prerollcount = 0;
  694.             prerollsenabled = true;
  695.             prebet = Math.floor($('#prerollbet').val() * 100000000);
  696.             basebet = Math.floor($('#basebet').val() * 100000000);
  697.             betval = basebet;
  698.  
  699.         } else if ($('#prerollsenabled').is(':checked') === false) {
  700.             prerollson = false;
  701.             prerollsenabled = false;
  702.             basebet = Math.floor($('#basebet').val() * 100000000);
  703.             betval = basebet;
  704.         }
  705.  
  706.         if ($('input:radio[name=hilo]:checked').val() == 'hi') {
  707.             condition2 = '>';
  708.             target2 = (99.99 - (99 / $('#payout').val())).toFixed(2);
  709.         } else if ($('input:radio[name=hilo]:checked').val() == 'lo') {
  710.             condition2 = '<';
  711.             target2 = (99 / $('#payout').val()).toFixed(2);
  712.         } else if ($('input:radio[name=hilo]:checked').val() == 'swap') {
  713.             condition2 = '<';
  714.             target2 = 0 + (99 / $('#payout').val()).toFixed(2);
  715.             swapenabled = true;
  716.         }
  717.     });
  718.     $('#lagfix').click(function () {
  719.         $('#result-2 table:nth(1)').empty();
  720.         chart.setData([]);chart2.setData([]);
  721.     });
  722.     $('#saveparams').click(function () {
  723.         localStorage.setItem('params-stored', true);
  724.         localStorage.setItem('basebet', $('#basebet').val());
  725.         localStorage.setItem('payout', $('#payout').val());
  726.         localStorage.setItem('prerollbet', $('#prerollbet').val());
  727.         localStorage.setItem('prerollenabled', $('#prerollsenabled').is(':checked'));
  728.         localStorage.setItem('numprerolls', $('#numprerolls').val());
  729.         localStorage.setItem('lossenabled', $('#lossmultenabled').is(':checked'));
  730.         localStorage.setItem('winenabled', $('#winmultenabled').is(':checked'));
  731.         localStorage.setItem('resetwin', $('#resetwin').val());
  732.         localStorage.setItem('xlosses', $('#multloss').val());
  733.         localStorage.setItem('wlmult', $('#winlossmultiplier').val());
  734.         localStorage.setItem('seedchangeon', $('#seedchangeon').is(':checked'));
  735.         localStorage.setItem('seedxrolls', $('#seedxrolls').val());
  736.         localStorage.setItem('swapxrolls', $('#swaprolls').val());
  737.         localStorage.setItem('swapenabled', $('#swaprollsenabled').is(':checked'));
  738.  
  739.     });
  740. $('#openChart').click(function(){
  741.     $('#dialog-form').dialog("open");
  742. })
  743.     if (localStorage.getItem('params-stored') === 'true') {
  744.         $('#basebet').val(localStorage.getItem('basebet'));
  745.         $('#payout').val(localStorage.getItem('payout'));
  746.         $('#prerollbet').val(localStorage.getItem('prerollbet'));
  747.         if (localStorage.getItem('prerollenabled') === 'true') {
  748.             $('#prerollsenabled').click();
  749.         } else {
  750.             $('#prerollsenabled').prop('checked', false);
  751.         }
  752.         $('#numprerolls').val(localStorage.getItem('numprerolls'));
  753.         if (localStorage.getItem('lossenabled') === 'true') {
  754.             $('#lossmultenabled').click();
  755.             $('#lossmultenabled').prop('checked', false);
  756.         }
  757.         if (localStorage.getItem('winenabled') === 'true') {
  758.             $('#winmultenabled').click();
  759.         } else {
  760.             $('#winmultenabled').prop('checked', false);
  761.         }
  762.         $('#resetwin').val(localStorage.getItem('resetwin'));
  763.         $('#multloss').val(localStorage.getItem('xlosses'));
  764.         $('#winlossmultiplier').val(localStorage.getItem('wlmult'));
  765.         if (localStorage.getItem('seedchangeon') === 'true') {
  766.             $('#seedchangeon').click();
  767.         } else {
  768.             $('#seedchangeon').prop('checked', false);
  769.         }
  770.         $('#seedxrolls').val(localStorage.getItem('seedxrolls'));
  771.         if (localStorage.getItem('swapenabled') === 'true') {
  772.             $('#swaprollsenabled').click();
  773.         } else {
  774.             $('#swaprollsenabled').prop('checked', false);
  775.         }
  776.         $('#swaprolls').val(localStorage.getItem('swapxrolls'));
  777.  
  778.     }
  779.     chart = Highcharts.charts[0].series[0];
  780.     chart2 = Highcharts.charts[0].series[1];
  781.     loopenabled = false;
  782.     loopcount = 0;
  783.     $('#start').click(function () {
  784.  
  785.         if ($('#numrollsenabled').is(':checked') === true) {
  786.             looptimes = $('#numrolls').val();
  787.         } else {
  788.  
  789.             looptimes = 999999999;
  790.         }
  791.  
  792.         if (loopenabled === false) {
  793.             loopenabled = true;
  794.  
  795.             loop = setInterval(function () {
  796.  
  797.                 if (loopcount >= looptimes) {
  798.                     clearInterval(loop);
  799.                     loopcount = 0;
  800.                     loopenabled = false;
  801.                 } else {
  802.                     if (betstarted === true) {} else {
  803.                         bet();
  804.                     }
  805.                 }
  806.             }, betspeed);
  807.  
  808.         }
  809.  
  810.     });
  811.  
  812.     function removeTheme() {
  813.         $('#paraDark').remove();
  814.     }
  815.  
  816.     $('#stop').click(function () {
  817.         clearInterval(loop);
  818.         loopenabled = false;
  819.         loopcount = 0;
  820.     });
  821.     $('#resetstats').click(function () {
  822.         wins = 0;
  823.         chart.setData([]);
  824.          chart2.setData([]);
  825.         losses = 0;
  826.         profit = 0;
  827.         currentloss = 0;
  828.         addRow();
  829.         wmultcount = 0;
  830.         lmultcount = 0;
  831.     });
  832. }
  833. setTimeout(function () {
  834.     init2();
  835. }, 2000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement