paradocks

Untitled

Jan 12th, 2015
402
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var flameBot, betspeed, aftermanualtrigger,swaplosscount, swapcount, loop, loopenabled, betData, condition,profit, target, losscount, totalloss, totalwin, currentbet, basebet, mainmult, initmult, result, UI ='', UI2='';
  2. profit=0;
  3. betspeed=500;
  4. loopcount=0;
  5. betstarted=false;
  6. loopenabled=false;
  7. aftermanualtrigger=false;
  8. swaplosscount=0;
  9. swapcount=0;
  10. flameBot = {
  11.         initialize: {
  12.             init1: function() {
  13.                 var lib = '<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css" /><script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script>';
  14.                 $(lib).appendTo('head');
  15.                 setTimeout(function(){flameBot.initialize.init2();}, 1000);
  16.             },
  17.             init2: function() {
  18.                 losscount=0;
  19.                 totalloss=0;
  20.                 totalwin=0;
  21.                 $('.hero__main').empty().css('width', '550px') & $('.hero__main').css("padding", "0") & $(UI).appendTo('.hero__main') &
  22.                 $('#flameBot').tabs() & $('button').button().css('font-size', '13px').css('padding', '5px');
  23.                 $('#stats th').css("width", "20%").css("font-size", "15px");
  24.                 $('#hilo, #resetorzero').buttonset();
  25.                 $('#flameBot li').css('font-size', '15px');
  26.                 $('#flameBot #resetorzero').css('font-size', '13px');
  27.                 $('#flameBot div[role=tabpanel] td').css('padding', 1);
  28.                 $('.hero__main').css('margin-top', '-75px')
  29.                 $('#start').click(function () {
  30.                    
  31.                    looptimes=999999999;
  32.                     if (loopenabled === false) {
  33.                         loopenabled = true;
  34.              
  35.                         loop = setInterval(function () {
  36.              
  37.                             if (loopcount >= looptimes) {
  38.                                 clearInterval(loop);
  39.                                 loopcount = 0;
  40.                                 loopenabled = false;
  41.                             } else {
  42.                                 if (betstarted === true) {} else {
  43.                                     flameBot.API.bet();
  44.                                 }
  45.                             }
  46.                         }, betspeed);
  47.              
  48.                     }
  49.              
  50.                 });
  51.                  $('#stop').click(function () {
  52.                     clearInterval(loop);
  53.                     loopenabled = false;
  54.                     loopcount = 0;
  55.                 });
  56.                  $('#setparams').click(function(){
  57.                     flameBot.API.setParams();
  58.                  })
  59.             }
  60.         },
  61.         tools: {
  62.             dec2Sat: function(decimal) {
  63.                 return (Math.floor(decimal*1e8));
  64.             },
  65.             token: function() {
  66.                 return localStorage.token;
  67.             },
  68.             satToDec: function(satoshi) {
  69.                 return ((satoshi/1e8).toFixed(8));
  70.             },
  71.  
  72.         },
  73.         API: {
  74.             onLoss: function() {
  75.                 totalloss++;
  76.                 losscount++;
  77.                 if ($('#afterlossesenabled').is(':checked') === true) {
  78.                     if (losscount >= $('#afterlosses').val()){
  79.                         if ($('#aftermanualenabled').is(':checked') === true) {
  80.                            
  81.                                 if (aftermanualtrigger === true) { } else {
  82.                                     var r = confirm("Click Okay to reset to base. Click cancel to bet 0 until win.");
  83.                                     if (r == true) {
  84.                                         aftermanualtrigger=false;
  85.                                         currentbet=basebet;
  86.                                         losscount=0;
  87.                                     } else {
  88.                                         aftermanualtrigger=true;
  89.                                         currentbet=0;
  90.                                     }
  91.                                 }
  92.  
  93.                         } else {
  94.                             if ($('input:radio[name=resetorzero]:checked').val() == 'orzero') {
  95.                                 currentbet=0;
  96.                             } else if ($('input:radio[name=resetorzero]:checked').val() == 'resetor') {
  97.                                 losscount=0;
  98.                                 currentbet=basebet;
  99.                             }
  100.                         }
  101.                      
  102.                     } else {
  103.                         if (losscount == $('#startlosses').val()) {
  104.                             currentbet = currentbet * $('#initialmultiplier').val();
  105.                         } else if (losscount > $('#startlosses').val()) {
  106.                             currentbet = currentbet * $('#mainmultiplier').val();                  
  107.                         }  
  108.                     }
  109.                 } else {
  110.                     if (losscount == $('#startlosses').val()) {
  111.                             currentbet = currentbet * $('#initialmultiplier').val();
  112.                     } else if (losscount > $('#startlosses').val()) {
  113.                             currentbet = currentbet * $('#mainmultiplier').val();                  
  114.                     }  
  115.                 }
  116.                 flameBot.API.addRow();
  117.             },
  118.             onWin: function() {
  119.                 if (aftermanualtrigger === true) { aftermanualtrigger = false }
  120.                 totalwin++;
  121.                 losscount=0;
  122.                 currentbet = basebet;
  123.                 flameBot.API.addRow();
  124.             },
  125.             setParams: function () {
  126.                 losscount=0;
  127.                 aftermanualtrigger=false;
  128.                 swaplosscount=0;
  129.                 swapcount=0;
  130.                 initmult = $('#initialmultiplier').val();
  131.                 mainmult = $('#mainmultiplier').val();
  132.                 basebet = flameBot.tools.dec2Sat($('#basebet').val());
  133.                 currentbet = basebet;
  134.                 if ($('input:radio[name=hilo]:checked').val() == 'hi') {
  135.                     condition = '>';
  136.                     target = (99.99 - (99 / $('#chance').val())).toFixed(2);
  137.                 } else if ($('input:radio[name=hilo]:checked').val() == 'lo') {
  138.                     condition = '<';
  139.                     target = (99 / $('#chance').val()).toFixed(2);
  140.                 } else if ($('input:radio[name=hilo]:checked').val() == 'swap') {
  141.                     condition = '<';
  142.                     target = 0 + (99 / $('#chance').val()).toFixed(2);
  143.                 }
  144.             },
  145.             addRow: function () {
  146.                 var bettable = '',
  147.                     bettab = '#lastbet2';
  148.                 bettable += '<tr><td>' + flameBot.tools.satToDec(result.bet.amount) + '</td>';
  149.                 bettable += '<td>' + result.bet.multiplier + 'x' + '</td>'; /* return bet payout */
  150.                 bettable += '<td>' + (result.bet.target).toFixed(2) + '</td>'; /* return target*/
  151.                 bettable += '<td>' + result.bet.roll + '</td>'; /* return roll */
  152.                 bettable += '<td id="proff">' + flameBot.tools.satToDec(result.bet.profit) + '</td></tr>';
  153.              
  154.                 var stattable = '',
  155.                     stattab = '#lastbet3';
  156.                 stattable += '<tr><td style="color:green;">' + flameBot.tools.satToDec(result.user.balance) + '</td><td style="color:red;">' + losscount + '</td><td style="color:green;">' + totalwin + '</td><td style="color:red;">' + totalloss + '</td><td id="profit">' + (profit).toFixed(8) + '</td></tr>';
  157.                 $(stattab).empty();
  158.                 $(stattab).prepend(stattable);
  159.                 stattable = '';
  160.                 if ($(bettab + ' tbody tr').length >= 30) {
  161.                     $(bettab + ' tr').last().remove();
  162.                     $(bettab).prepend(bettable);
  163.                     bettable = '';
  164.                 } else if ($(bettab).length < 30) {
  165.                     $(bettab).prepend(bettable);
  166.                     bettable = '';
  167.                 }
  168.              
  169.                 $('#lastbet2 *, #lastbet3 *, #lastbet *, #proff').css('text-align', 'center');
  170.                 $('#lastbet2 *, #lastbet3 *, #lastbet *').css('width', '20%');
  171.                 $('#lastbet *').css('padding', '5px');
  172.                 $('#lastbet *').css('border-bottom', '1px solid #ccc');
  173.                 $('#result-1').css('padding', '5px');
  174.                 $('#lastbet2 *, #lastbet3 *, #proff').css('padding', '5px');
  175.                 $('#lastbet > tbody > tr > th:nth-child(2)').css('border-top', '1px solid #ddd');
  176.                 if (profit >= 0) {
  177.                     $('#profit').css('color', 'green');
  178.                 } else {
  179.                     $('#profit').css('color', 'red');
  180.                 }
  181.                 if (result.bet.win === true) {
  182.                     $('#proff:first').css('color', 'green');
  183.                 } else {
  184.                     $('#proff:first').css('color', 'red');
  185.                 }
  186.                 betstarted=false;
  187.             },
  188.  
  189.             bet: function() {
  190.                 betstarted=true;
  191.                 var betData = {
  192.                     amount: currentbet,
  193.                     condition: condition,
  194.                     target: target,
  195.                 };
  196.                 $.ajax({
  197.                     url: 'https://api.primedice.com/api/bet?access_token='+flameBot.tools.token(),
  198.                     type: 'POST',
  199.                     data: betData,
  200.                     datatype: 'jsonp',
  201.                     success: function (data) {
  202.                         result = data;
  203.                         profit = parseFloat(profit) + parseFloat(flameBot.tools.satToDec(data.bet.profit));
  204.                         if (data.bet.win === true) {
  205.                             flameBot.API.onWin();
  206.                         } else {
  207.                             flameBot.API.onLoss();
  208.                         }
  209.                     },
  210.                     error: function (errorThrown) {
  211.                         betstarted=false;
  212.                     }
  213.                 });
  214.             },
  215.             seedChange: function () {
  216.                 function seedgen() {
  217.                     var seed = '';
  218.                     var seedlength = 10;
  219.                     var charset = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()';
  220.                     for (var i = 0; i <= seedlength; i++)
  221.              
  222.                         seed += charset.charAt(Math.floor(Math.random() * charset.length));
  223.              
  224.                     return seed;
  225.                 }
  226.                 var s = seedgen(),
  227.                     url = 'https://api.primedice.com/api/seed?access_token=' + localStorage.token,
  228.                     sData = {
  229.                         seed: s
  230.                     };
  231.              
  232.                 $.ajax({
  233.                     url: url,
  234.                     type: 'POST',
  235.                     data: sData,
  236.                     datatype: 'json',
  237.                     success: function (data, textStatus, jqXHR) {
  238.                         data2 = data;
  239.                         $('#currentseed').val(data2.seeds.client);
  240.              
  241.              
  242.                     },
  243.                     error: function (jqXHR, textStatus, errorThrown) {
  244.                         return false;
  245.                     }
  246.                 });
  247.             },
  248.             swap: function () {
  249.                 if (condition2 == '<') {
  250.                     condition2 = '>';
  251.                     target2 = (99.99 - (99 / $('#payout').val())).toFixed(2);
  252.                 } else if (condition2 == '>') {
  253.                     condition2 = '<';
  254.                     target2 = (99 / $('#payout').val()).toFixed(2);
  255.                 }
  256.             },
  257.         }
  258. }
  259.    
  260. var UI ='';
  261. UI += '<table id="lastbet">';
  262. UI += '<tr><th>Bet</th><th>Payout</th><th>Game</th><th>Roll</th><th>Profit</th></tr></table>';
  263. UI += '<div style="max-height:390px !important;font-size:11px;overflow-y: scroll;overflow-x: hidden;"><table id="lastbet2"></table></div>';
  264. UI += '<div id="flameBot" style="width:550px"><ul><li>';
  265. UI += '<a href="/play#basic">Basic Settings</a></li>';
  266. UI += '<li><a href="/play#onloss">On Loss</a></li>';
  267. UI += '<li><a href="/play#onlosstreak">Loss - Adv.</a></li>';
  268. UI += '<li style="margin:8px;font-size:12px;margin-left:35px;text-align:center;"><span>FlameBot - v1.0</span></li>';
  269. UI += '</ul>';
  270. UI += '<div id="basic" style="font-size:17.5px;"><center>';
  271. UI += '<table style="display:table;"><thead><tr><th>Basebet: </th><th>Chance:</th></tr></thead><tbody><tr><td><input id="basebet" type="text"></td><td><input id="chance" type="text"></td></tr></tbody><thead><tr><th>High/Low/Swap:</th><th>Swap Every:</th></tr></thead><tbody><tr><td><div id="hilo"><input type="radio" id="hi" value="hi" name="hilo"><label for="hi">High</label> <input type="radio" id="lo" value="lo" name="hilo" checked="checked"><label for="lo">Low</label> <input type="radio" id="swap" value="swap" name="hilo"><label for="swap">Swap</label> </div></td><td><input id="swapevery" type="text"></td></tr></tbody></table></div></center>';
  272. UI += '<div id="onloss" style="font-size:17.5px;"><center>';
  273. UI += '<table style="display:table;"><thead><tr><th>Start Multipling: </th><th>Main Multiplier:</th></tr></thead><tbody><tr><td><input id="startlosses" style="text-align:center;" placeholder="after # of losses"type="text"></td><td><input id="mainmultiplier" style="text-align:center;" placeholder="2, 4, etc."type="text"></td></tr></tbody><thead><tr><th>Initial Multiplier</th><th>Max Bet:</th></tr></thead><tbody><tr><td><input id="initialmultiplier" style="text-align:center;" placeholder="2, 4, etc."type="text"></td><td><input id="maxbet" style="text-align:center;" placeholder="ex. 0.001" type="text"></td></tr></tbody></table>';
  274. UI += '</center></div>';
  275. UI += '<div id="onlosstreak" style="font-size:17.5px;"><center>';
  276. UI += '<table style="display:table;"><thead><tr><th>After: <input type="checkbox" id="afterlossesenabled"></th><th>Either: </th></tr></thead><tbody><tr><td><input id="afterlosses" style="text-align:center;" placeholder="# of losses"type="text"></td><td><div id="resetorzero"><input type="radio" id="resetor" value="resetor" name="resetorzero"><label for="resetor">Reset to Base</label><input type="radio" id="orzero" value="orzero" name="resetorzero" checked="checked"><label for="orzero">Roll 0 to Win</label></div></td></tr></tbody><thead><tr><th>Manualy Choose?</th><th>Swap After: <input id="swaplossesenabled" type="checkbox"></th></tr></thead><tbody><tr><td><center><input id="aftermanualenabled" type="checkbox"></center></td><td><input id="swaplosses" style="text-align:center;" placeholder="# of losses" type="text"></td></tr></tbody></table>';
  277. UI += '</center></div>';
  278. UI += '<div id="controlstat">';
  279. UI += '<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="set"><button id="setparams">Set Params</button><button id="save">Save Settings</button><button id="load">Load Settings</button></div></center><br>';
  280. UI += '<table style="margin:10px;"id="stats">';
  281. UI += '<thead><tr><th>Balance</th><th>Loss Streak</th><th>Total Wins</th><th>Total Losses</th><th>Total Profit</th></tr></thead><tbody></tbody><table id="lastbet3"></table></table>';
  282. UI += '</div>';
  283. UI += '</div>';
  284. flameBot.initialize.init1();
Advertisement
Add Comment
Please, Sign In to add comment