Advertisement
paradocks

Untitled

Jan 12th, 2015
425
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. var streakcounter = [];
  4.  
  5.  
  6. betspeed=500;
  7. loopcount=0;
  8. betstarted=false;
  9. loopenabled=false;
  10. aftermanualtrigger=false;
  11. swaplosscount=0;
  12. swapcount=0;
  13. flameBot = {
  14.         initialize: {
  15.             init1: function() {
  16.                 var lib = '<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/dark-hive/jquery-ui.css" /><script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script>';
  17.                 $(lib).appendTo('head');
  18.                 setTimeout(function(){flameBot.initialize.init2();}, 1000);
  19.             },
  20.             init2: function() {
  21.                 losscount=0;
  22.                 totalloss=0;
  23.                 totalwin=0;
  24.                 $('.hero__main').empty().css('width', '550px') & $('.hero__main').css("padding", "0") & $(UI).appendTo('.hero__main') &
  25.                 $('#flameBot').tabs() & $('button').button().css('font-size', '13px').css('padding', '5px');
  26.                 $('#stats th').css("width", "20%").css("font-size", "15px");
  27.                 $('#hilo, #resetorzero').buttonset();
  28.                 $('#flameBot li').css('font-size', '15px');
  29.                 $('#flameBot #resetorzero').css('font-size', '13px');
  30.                 $('#flameBot div[role=tabpanel] td').css('padding', 1);
  31.                 $('.hero__main').css('margin-top', '-75px');
  32.                 $('#stats2 th').css('width', '6.25%');
  33.                  var css = '',
  34.                 backgroundurl = 'http://cdn.wonderfulengineering.com/wp-content/uploads/2014/01/HD-backgrounds-3.jpg';
  35.                 css += '<style id="paraDark">';
  36.                 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;}';
  37.                 css += 'time{color:#ccc !important;}';
  38.                 css += 'div.tabs > div > div.live-data-header > div{background-color:#111111;border-top:1px solid #777; border-bottom:1px solid #777;}';
  39.                 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;}';
  40.                 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;}';
  41.                 css += '.hero{margin-bottom:0px;background:url("' + backgroundurl + '") no-repeat 50% 50%;}';
  42.                 css += '.slideout *{color:#ccc;}';
  43.                 css += '.tabs{padding-top:20px;border-top:1px solid #777 !important;}';
  44.                 css += 'header{border: 1px solid #777 !important;border-left:none !important;border-right:none !important;}';
  45.                 css += '.rollrow-thin, .rollrow-dark .chat__input-holder {background-color:#212121;}';
  46.                 css += '.input{background-color:#323232 !important;color:#ccc;}';
  47.                 css += '.action-open-slideout{background-color:#121212 !important;}';
  48.                 css += 'span.admin{color:red !important}';
  49.              
  50.                 css += '</style>';
  51.                 $(css).appendTo('head');
  52.                 for (i = 0; i < $('#stats2 th').length; i++) {
  53.                     streakcounter.push(0);
  54.                 }
  55.                 for (i = 0; i < $('#stats2 th').length; i++) {
  56.                  var lol=$('#stats2 th')[i];
  57.                  lol.textContent = (i+1).toString() + "(" + streakcounter[i] + ")";
  58.                 }
  59.                 $('#start').click(function () {
  60.                    
  61.                    looptimes=999999999;
  62.                     if (loopenabled === false) {
  63.                         loopenabled = true;
  64.              
  65.                         loop = setInterval(function () {
  66.              
  67.                             if (loopcount >= looptimes) {
  68.                                 clearInterval(loop);
  69.                                 loopcount = 0;
  70.                                 loopenabled = false;
  71.                             } else {
  72.                                 if (betstarted === true) {} else {
  73.                                     flameBot.API.bet();
  74.                                 }
  75.                             }
  76.                         }, betspeed);
  77.              
  78.                     }
  79.              
  80.                 });
  81.                  $('#stop').click(function () {
  82.                     clearInterval(loop);
  83.                     loopenabled = false;
  84.                     loopcount = 0;
  85.                 });
  86.                  $('#setparams').click(function(){
  87.                     flameBot.API.setParams();
  88.                  })
  89.             }
  90.         },
  91.         tools: {
  92.             dec2Sat: function(decimal) {
  93.                 return (Math.floor(decimal*1e8));
  94.             },
  95.             token: function() {
  96.                 return localStorage.token;
  97.             },
  98.             satToDec: function(satoshi) {
  99.                 return ((satoshi/1e8).toFixed(8));
  100.             },
  101.  
  102.         },
  103.         API: {
  104.             onLoss: function() {
  105.                 totalloss++;
  106.                 losscount++;
  107.                
  108.                 if ($('#swaplossesenabled').is(':checked') === true) {
  109.                     swaplosscount++;
  110.                     if (swaplosscount >= $('#swaplosses').val()){
  111.                         flameBot.API.swap();
  112.                         swaplosscount=0;
  113.                     }
  114.                 }
  115.                 if ($('#afterlossesenabled').is(':checked') === true) {
  116.                     if (losscount >= $('#afterlosses').val()){
  117.                         if ($('#aftermanualenabled').is(':checked') === true) {
  118.                            
  119.                                 if (aftermanualtrigger === true) { } else {
  120.                                     var r = confirm("Click Okay to reset to base. Click cancel to bet 0 until win.");
  121.                                     if (r == true) {
  122.                                         aftermanualtrigger=false;
  123.                                         currentbet=basebet;
  124.                                         losscount=0;
  125.                                     } else {
  126.                                         aftermanualtrigger=true;
  127.                                         currentbet=0;
  128.                                     }
  129.                                 }
  130.  
  131.                         } else {
  132.                             if ($('input:radio[name=resetorzero]:checked').val() == 'orzero') {
  133.                                 currentbet=0;
  134.                             } else if ($('input:radio[name=resetorzero]:checked').val() == 'resetor') {
  135.                                 losscount=0;
  136.                                 currentbet=basebet;
  137.                             }
  138.                         }
  139.                      
  140.                     } else {
  141.                         if (losscount == $('#startlosses').val()) {
  142.                             currentbet = currentbet * $('#initialmultiplier').val();
  143.                         } else if (losscount > $('#startlosses').val()) {
  144.                             currentbet = currentbet * $('#mainmultiplier').val();                  
  145.                         }  
  146.                     }
  147.                 } else {
  148.                     if (losscount == $('#startlosses').val()) {
  149.                             currentbet = currentbet * $('#initialmultiplier').val();
  150.                     } else if (losscount > $('#startlosses').val()) {
  151.                             currentbet = currentbet * $('#mainmultiplier').val();                  
  152.                     }  
  153.                 }
  154.                 flameBot.API.addRow();
  155.             },
  156.             onWin: function() {
  157.                 if (aftermanualtrigger === true) { aftermanualtrigger = false }
  158.                 totalwin++;
  159.                 swaplosscount=0;
  160.                 var streak = losscount;
  161.                 streakcounter[losscount-1]++;
  162.                 losscount=0;
  163.                 currentbet = basebet;
  164.                 flameBot.API.addRow();
  165.             },
  166.             setParams: function () {
  167.                 losscount=0;
  168.                 aftermanualtrigger=false;
  169.                 swaplosscount=0;
  170.                 swapcount=0;
  171.                 initmult = $('#initialmultiplier').val();
  172.                 mainmult = $('#mainmultiplier').val();
  173.                 basebet = flameBot.tools.dec2Sat($('#basebet').val());
  174.                 currentbet = basebet;
  175.                 if ($('input:radio[name=hilo]:checked').val() == 'hi') {
  176.                     condition = '>';
  177.                     target = (99.99 - (99 / $('#chance').val())).toFixed(2);
  178.                 } else if ($('input:radio[name=hilo]:checked').val() == 'lo') {
  179.                     condition = '<';
  180.                     target = (99 / $('#chance').val()).toFixed(2);
  181.                 } else if ($('input:radio[name=hilo]:checked').val() == 'swap') {
  182.                     condition = '<';
  183.                     target = 0 + (99 / $('#chance').val()).toFixed(2);
  184.                 }
  185.             },
  186.             addRow: function () {
  187.                 var bettable = '',
  188.                     bettab = '#lastbet2';
  189.                 bettable += '<tr><td>' + flameBot.tools.satToDec(result.bet.amount) + '</td>';
  190.                 bettable += '<td>' + result.bet.multiplier + 'x' + '</td>'; /* return bet payout */
  191.                 bettable += '<td>' + (result.bet.target).toFixed(2) + '</td>'; /* return target*/
  192.                 bettable += '<td>' + result.bet.roll + '</td>'; /* return roll */
  193.                 bettable += '<td id="proff">' + flameBot.tools.satToDec(result.bet.profit) + '</td></tr>';
  194.              
  195.                 var stattable = '',
  196.                     stattab = '#lastbet3';
  197.                 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>';
  198.                 $(stattab).empty();
  199.                 $(stattab).prepend(stattable);
  200.                 stattable = '';
  201.                 if ($(bettab + ' tbody tr').length >= 30) {
  202.                     $(bettab + ' tr').last().remove();
  203.                     $(bettab).prepend(bettable);
  204.                     bettable = '';
  205.                 } else if ($(bettab).length < 30) {
  206.                     $(bettab).prepend(bettable);
  207.                     bettable = '';
  208.                 }
  209.                 for (i = 0; i < $('#stats2 th').length; i++) {
  210.                  var lol=$('#stats2 th')[i];
  211.                  lol.textContent = (i+1).toString() + "(" + streakcounter[i] + ")";
  212.                 }
  213.                 $('#lastbet2 *, #lastbet3 *, #lastbet *, #proff').css('text-align', 'center');
  214.                 $('#lastbet2 *, #lastbet3 *, #lastbet *').css('width', '20%');
  215.                 $('#lastbet *').css('padding', '5px');
  216.                 $('#lastbet *').css('border-bottom', '1px solid #ccc');
  217.                 $('#result-1').css('padding', '5px');
  218.                 $('#lastbet2 *, #lastbet3 *, #proff').css('padding', '5px');
  219.                 $('#lastbet > tbody > tr > th:nth-child(2)').css('border-top', '1px solid #ddd');
  220.                 if (profit >= 0) {
  221.                     $('#profit').css('color', 'green');
  222.                 } else {
  223.                     $('#profit').css('color', 'red');
  224.                 }
  225.                 if (result.bet.win === true) {
  226.                     $('#proff:first').css('color', 'green');
  227.                 } else {
  228.                     $('#proff:first').css('color', 'red');
  229.                 }
  230.                 betstarted=false;
  231.             },
  232.  
  233.             bet: function() {
  234.                 betstarted=true;
  235.                 var betData = {
  236.                     amount: currentbet,
  237.                     condition: condition,
  238.                     target: target,
  239.                 };
  240.                 $.ajax({
  241.                     url: 'https://api.primedice.com/api/bet?access_token='+flameBot.tools.token(),
  242.                     type: 'POST',
  243.                     data: betData,
  244.                     datatype: 'jsonp',
  245.                     success: function (data) {
  246.                         result = data;
  247.                         profit = parseFloat(profit) + parseFloat(flameBot.tools.satToDec(data.bet.profit));
  248.                         if ($('input:radio[name=hilo]:checked').val() == 'swap') {
  249.                             swapcount++;
  250.                             if (swapcount >= $('#swapevery').val()) {
  251.                                 flameBot.API.swap();
  252.                                 swapcount=0;
  253.                             }
  254.                         }
  255.                         if (data.bet.win === true) {
  256.                             $('span.btn__text.select div').text(flameBot.tools.satToDec(result.user.balance)).css('color', 'green');
  257.                             flameBot.API.onWin();
  258.                         } else {
  259.                             $('span.btn__text.select div').text(flameBot.tools.satToDec(result.user.balance)).css('color', 'red');
  260.                             flameBot.API.onLoss();
  261.                         }
  262.                     },
  263.                     error: function (errorThrown) {
  264.                         betstarted=false;
  265.                     }
  266.                 });
  267.             },
  268.             seedChange: function () {
  269.                 function seedgen() {
  270.                     var seed = '';
  271.                     var seedlength = 10;
  272.                     var charset = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()';
  273.                     for (var i = 0; i <= seedlength; i++)
  274.              
  275.                         seed += charset.charAt(Math.floor(Math.random() * charset.length));
  276.              
  277.                     return seed;
  278.                 }
  279.                 var s = seedgen(),
  280.                     url = 'https://api.primedice.com/api/seed?access_token=' + localStorage.token,
  281.                     sData = {
  282.                         seed: s
  283.                     };
  284.              
  285.                 $.ajax({
  286.                     url: url,
  287.                     type: 'POST',
  288.                     data: sData,
  289.                     datatype: 'json',
  290.                     success: function (data, textStatus, jqXHR) {
  291.                         data2 = data;
  292.                         $('#currentseed').val(data2.seeds.client);
  293.              
  294.              
  295.                     },
  296.                     error: function (jqXHR, textStatus, errorThrown) {
  297.                         return false;
  298.                     }
  299.                 });
  300.             },
  301.             swap: function () {
  302.                 if (condition == '<') {
  303.                      condition = '>';
  304.                     target = (99.99 - (99 / $('#chance').val())).toFixed(2);               
  305.                 } else if (condition == '>') {
  306.                        condition = '<';
  307.                     target = (99 / $('#chance').val()).toFixed(2);
  308.                 }
  309.             },
  310.         }
  311. }
  312.    
  313. var UI ='';
  314. UI += '<table style="margin:10px;"id="stats">';
  315. 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>';
  316. UI += '<table style="margin:10px;"id="stats2">';
  317. UI += '<thead><tr><th>1 </th><th>2</th><th>3</th><th>4</th><th>5</th><th>6</th><th>7</th><th>8</th><th>9</th><th>10</th><th>11</th><th>12</th><th>13</th><th>14</th><th>15</th><th>16</th></tr></thead><tbody></tbody></table>';
  318. UI += '<table id="lastbet">';
  319. UI += '<tr><th>Bet</th><th>Payout</th><th>Game</th><th>Roll</th><th>Profit</th></tr></table>';
  320. UI += '<div style="max-height:390px !important;font-size:11px;overflow-y: scroll;overflow-x: hidden;"><table id="lastbet2"></table></div>';
  321. UI += '<div id="flameBot" style="width:550px"><ul><li>';
  322. UI += '<a href="/play#basic">Basic Settings</a></li>';
  323. UI += '<li><a href="/play#onloss">On Loss</a></li>';
  324. UI += '<li><a href="/play#onlosstreak">Loss - Adv.</a></li>';
  325. UI += '<li style="margin:8px;font-size:12px;margin-left:35px;text-align:center;"><span>FlameBot - v1.0</span></li>';
  326. UI += '</ul>';
  327. UI += '<div id="basic" style="font-size:17.5px;"><center>';
  328. 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>';
  329. UI += '<div id="onloss" style="font-size:17.5px;"><center>';
  330. 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>';
  331. UI += '</center></div>';
  332. UI += '<div id="onlosstreak" style="font-size:17.5px;"><center>';
  333. 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>';
  334. UI += '</center></div>';
  335. UI += '<div id="controlstat">';
  336. 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>';
  337. UI += '</div>';
  338. UI += '</div>';
  339. flameBot.initialize.init1();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement