paradocks

Untitled

Jan 12th, 2015
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //blah
  2. // 999Bot by paradocks
  3. // Tip Here: 1LuLz9djKFPTfbFuCKedm2FuX1fiSqt5hg
  4. var bBase, bamount, bHigh, bLow, bSeed, bData, rData, balance, swapcount, sCookie, swapxrolls, iswin, isloss, betprofit, wmcount, lmcount, loss, losstreak, totalwin, totalloss, totalprofit, loop, loopcount, looptimes, incbasebetcount;
  5. loopcount = 0;
  6. looptimes = 0;
  7. swapcount = 0;
  8. swapxrolls = 0;
  9. bHigh = 0;
  10. bLow = 0;
  11. totalwin = 0;
  12. totalloss = 0;
  13. totalprofit = 0;
  14. wmcount = 0;
  15. lmcount = 0;
  16. losstreak = 0;
  17. betstarted = false;
  18. loopenabled=false;
  19. swapwincount=0;
  20. swaplosscount=0;
  21. incbasebetcount=0;
  22. cCurrency = 'ltc';
  23. swapxrolls=1;
  24. var interval = 150;
  25.  
  26. $('<link type="text/css" rel="stylesheet" href="https://jquery-ui.googlecode.com/svn/tags/latest/themes/dot-luv/jquery-ui.css">').appendTo('head');
  27. $('<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.js"></script>').appendTo('head');
  28. $('<style>#parabot table{width: 100%; border-collapse: collapse;}#parabot{font-size: 13px;}#parabot td, #parabot th{padding-top:7px; padding-bottom:7px; border: 1px solid #ccc; text-align: center;}#parabot th{text-align: center !important;}#parabot input{width:100% auto;}#basic{margin:4px !important; padding:4px;}</style>').appendTo('head');
  29.  
  30. setTimeout(function () {
  31.     var UI = '';
  32.     UI += '<div id="parabot" style="width:550px"><ul><li>';
  33.     UI += '<a href="#basic">Basic Settings</a></li>';
  34.     UI += '<li><a href="#winloss">Win/Loss</a></li>';
  35.     UI += '<li><a href="#advanced">Advanced</a></li>';
  36.     UI += '<li><a href="#lastbets">Last Bets</a></li>';
  37.     UI += '</ul>';
  38.     UI += '<div id="basic">';
  39.     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>';
  40.     UI += '<div id="winloss">';
  41.     UI += '<table style="display:table;"><thead><tr><th>Multiply on Win: <input type="checkbox" id="wmultenabled"></th><th>Multiply on Loss: <input type="checkbox" id="lmultenabled"></th></tr><tr><th>Multiplier: </th><th>Multiplier: </th></tr></thead><tbody><tr><td><input id="wmultiplier" placeholder="ex. 1.5 for 50%" type="text"></td><td><input id="lmultiplier" placeholder="ex. 1.5 for 50%" type="text"></td></tr></tbody><thead><tr><th>Reset After: </th><th>Multiply After: </th></tr></thead><tbody><tr><td><input id="resetwins" placeholder="# of wins" type="text"></td><td><input id="multiplylosses" placeholder="# of lossess" type="text"></td></tr></tbody><thead><tr><th>Swap On Win: <input type="checkbox" id="swapwinenabled"></th><th>Swap On Loss: <input type="checkbox" id="swaplossenabled"></th></tr></thead><tbody><tr><td><input id="swapwins" placeholder="after # wins" type="text"></td><td><input id="swaplosses" placeholder="after # losses" type="text"></td></tr></tbody></table>';
  42.     UI += '</div>';
  43.     UI += '<div id="advanced">';
  44.     UI += '<table style="display:table;"><thead><tr><th>Increase Basebet: </th><th>Increase By: </th></tr></thead><tbody><tr><td><input id="incbasebeten" type="checkbox"></td><td><input id="incbasebetby" placeholder="ex. 0.00000100 BTC" type="text"></td></tr></tbody><thead><tr><th>Every X Wins: </th><th>Max Basebet: </th></tr></thead><tbody><tr><td><input id="incbasebetxwins" type="text"></td><td><input id="incbasebetmax" type="text"></td></tr></tbody></table>';
  45.     UI += '</div>';
  46.     UI += '<div id="controlstat">';
  47.     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>';
  48.     UI += '<table id="stats">';
  49.     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>';
  50.     UI += '</div>';
  51.     UI += '</div>';
  52.     $('div#BetActionBoxSet > div:nth(0)').remove() & $('div#BetActionBoxSet > div:nth(0)').remove() & $('div#BetActionBoxSet > div:nth(0)').remove() & $('<center>' + UI + '</center>').insertBefore('#AutoBetsActionTabButton') & $('#parabot').tabs() & $('#BetActionBoxSet br:first').remove();
  53.     $('#hilo').buttonset();
  54.     $('#buttonz button').button();
  55.     var UI2 = '';
  56.     UI2 += '<div id="lastbets">';
  57.     UI2 += '<table id="lastbet">';
  58.     UI2 += '<thead><tr><th>ID</th><th>Bet</th><th>Game</th><th>Roll</th><th>Profit</th></tr></thead><tbody></tbody></table>';
  59.     UI2 += '</div>';
  60.     $(UI2).insertBefore('#BetActionBoxSet center:first') & $('#lastbets').css('display', 'inline-block');
  61. }, 1000);
  62.  
  63. function getCookie(cname) {
  64.     var name = cname + "=";
  65.     var ca = document.cookie.split(';');
  66.     for (var i = 0; i < ca.length; i++) {
  67.         var c = ca[i];
  68.         while (c.charAt(0) == ' ') c = c.substring(1);
  69.         if (c.indexOf(name) == 0) return c.substring(name.length, c.length);
  70.     }
  71.     return "";
  72. }
  73.  
  74. sCookie = getCookie('SessionId');
  75.  
  76. function toJSONObj(a) {
  77.     c = JSON.parse('{"' + decodeURI(a).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g, '":"') + '"}');
  78.     return c;
  79. }
  80.  
  81. function swap() {
  82.     a = $('#chance').val() * 0.01;
  83.     a = (999999 * a);
  84.     if (bHigh == 999999) {
  85.         bHigh = Math.floor(a);
  86.         bLow = 0;
  87.     } else {
  88.         bHigh = 999999;
  89.         bLow = Math.floor(999999 - a);
  90.     }
  91. }
  92.  
  93. function calcChance(percent) {
  94.     a = percent * 0.01;
  95.     a = (999999 * a);
  96.     if ($('input:radio[name=hilo]:checked').val() == 'hi') {
  97.         bHigh = 999999;
  98.         bLow = Math.floor(999999 - a);
  99.     } else if ($('input:radio[name=hilo]:checked').val() == 'lo') {
  100.         bHigh = Math.floor(a);
  101.         bLow = 0;
  102.     } else if ($('input:radio[name=hilo]:checked').val() == 'swap') {
  103.        
  104.         swapcount++;
  105.         if (swapcount >= swapxrolls) {
  106.             swap();
  107.             swapxrolls=Math.floor(Math.random()*2);
  108.             swapcount = 0;
  109.         }
  110.     }
  111. }
  112.  
  113. function setParams() {
  114.     a = $('#chance').val() * 0.01;
  115.     a = (999999 * a);
  116.     if ($('input:radio[name=hilo]:checked').val() == 'swap' && bHigh == 0 && bLow == 0) {
  117.         bHigh = 999999;
  118.         bLow = 999999 - a;
  119.     } else {
  120.         calcChance($('#chance').val());
  121.     }
  122.  
  123.     bBase = Math.floor($('#basebet').val() * 1e8);
  124.     bamount = bBase;
  125.     lmcount=0;
  126.     wmcount=0;
  127.     losstreak=0;
  128.     swapcount=0;
  129. }
  130.  
  131. function seedGen() {
  132.     seedlength = 2;
  133.     charset = '1230';
  134.     var seed = '';
  135.  
  136.     for (var i = 0; i <= seedlength; i++)
  137.  
  138.         seed += charset.charAt(Math.floor(Math.random() * charset.length));
  139.  
  140.     return seed;
  141. }
  142.  
  143. function bet() {
  144.         betstarted = true;
  145.             bSeed = seedGen();
  146.             bData = 'a=PlaceBet&s=' + sCookie + '&PayIn=' + bamount + '&Low=' + bLow + '&High=' + bHigh + '&ClientSeed=' + bSeed + '&Currency='+cCurrency;
  147.             $.ajax({
  148.                 url: '/api/web.aspx',
  149.                 type: 'POST',
  150.                 data: toJSONObj(bData),
  151.                 datatype: 'jsonp',
  152.                 async: true,
  153.                 success: function (data) {
  154.                     rData = JSON.parse(data);
  155.                         if ($('input:radio[name=hilo]:checked').val() == 'swap') {
  156.                                
  157.                                 swapcount++;
  158.                                 if (swapcount >= swapxrolls) {
  159.                                     swap();
  160.                         swapxrolls+=4;
  161.                                     swapcount = 0;
  162. $('#stop').click();
  163.                          interval=Math.floor(Math.random()*150);
  164.                           while (interval < 75) {
  165.                             interval = Math.floor(Math.random()*150);
  166.                             }
  167.  
  168.  setTimeout(function(){$('#start').click();},575);
  169.                                 }
  170.                                 }
  171.                     if (rData.PayOut == 0) {
  172.                         iswin = false;
  173.                         isloss = true;
  174.                         betprofit = ((0 - bamount) / 1e8).toFixed(8);
  175.                        
  176.                         totalprofit = parseFloat(totalprofit) + parseFloat(betprofit);
  177.                         balance = Math.floor(Math.round(parseFloat(rData.StartingBalance) + parseFloat(betprofit)));
  178.                         $('#BetActionBoxSet .UserBalance').text((balance/1e8));
  179.                        
  180.                     } else {
  181.                         iswin = true;swapxrolls=1;
  182.                         isloss = false;
  183.                         betprofit = ((rData.PayOut - bamount) / 1e8).toFixed(8);
  184.                         if (betprofit != 0 && (betprofit > 0) === false) {} else {
  185.                         totalprofit = parseFloat(totalprofit) + parseFloat(betprofit);
  186.                        
  187.                         balance = Math.floor(Math.round(parseFloat(rData.StartingBalance) + parseFloat(betprofit)));
  188.                         $('#BetActionBoxSet .UserBalance').text((balance/1e8));
  189.                         }
  190.                     }
  191.          
  192.                     if (iswin == true) {
  193.                         win();
  194.                    
  195.                     } else {
  196.                         lose();
  197.                     }
  198.                 },
  199.                 error: function (errorThrown) {
  200.                     betstarted = false;
  201.          
  202.                 }
  203.             });
  204.        
  205. }
  206.  
  207. function win() {
  208.     if ($('#incbasebeten').is(':checked') === true) {
  209.         incbasebetcount++;
  210.         if (incbasebetcount >= $('#incbasebetxwins').val()) {
  211.             if ((bBase + ($('#incbasebetby').val()*1e8)) > ($('#incbasebetmax').val()*1e8))
  212.             {
  213.                 bBase = Math.floor($('#basebet').val()*1e8);
  214.                 bamount=bBase;
  215.                 incbasebetcount=0;
  216.             } else {
  217.             bBase = bBase + ($('#incbasebetby').val()*1e8);
  218.             bamount = bBase;
  219.             incbasebetcount=0;
  220.             }
  221.         }
  222.     }
  223.     totalwin++;
  224.     losstreak = 0;swaplosscount=0;
  225.     if ($('#swapwinenabled').is(':checked') === true) {
  226.         swapwincount++;
  227.         if (swapwincount >= $('#swapwins').val()){
  228.             swap();
  229.             swapwincount=0;
  230.         }
  231.     }
  232.     if ($('#lmultenabled').is(':checked') === true) {
  233.         bamount = bBase;
  234.         lmcount = 0;
  235.     }
  236.     if ($('#wmultenabled').is(':checked') === true) {
  237.         wmcount++;
  238.         if (wmcount <= $('#resetwins').val()) {
  239.             bamount = Math.floor(Math.round(bamount * $('#wmultiplier').val()));
  240.            
  241.         } else if (wmcount >= $('#resetwins').val()) {
  242.             bamount = bBase;
  243.             wmcount = 0;
  244.            
  245.         }
  246.     }
  247.     addRow();
  248.     betstarted = false;
  249.  
  250. }
  251.  
  252. function lose() {
  253.     totalloss++;
  254.     losstreak++;
  255.     if ($('#swaplossenabled').is(':checked') === true) {
  256.         swaplosscount++;
  257.         if (swaplosscount >= $('#swaplosses').val()){
  258.             swap();
  259.             swaplosscount=0;
  260.         }
  261.     }
  262.     if ($('#lmultenabled').is(':checked') == true) {
  263.         lmcount++;
  264.         if (lmcount >= $('#multiplylosses').val()) {
  265.             bamount = Math.floor(Math.round(bamount * $('#lmultiplier').val()));
  266.             lmcount = 0;
  267.         }
  268.     }
  269.     addRow();
  270.     betstarted = false;
  271.  
  272. }
  273.  
  274. function addRow() {
  275.     var bettable = '',
  276.         bettab = '#lastbets tbody';
  277.     var game;
  278.     if (bLow > 0) {
  279.         game = '> ' + bLow;
  280.     } else if (bLow == 0) {
  281.         game = '<' + bHigh;
  282.     }
  283.     bettable += '<tr><td>' + rData.BetId + '</td>';
  284.     bettable += '<td>' + (bamount / 1e8).toFixed(8) + '</td>';
  285.     bettable += '<td>' + game + '</td>'; /* return bet payout */
  286.     bettable += '<td>' + rData.Secret + '</td>'; /* return target*/
  287.     bettable += '<td id="bProfit">' + betprofit + '</tr>';
  288.     if ($(bettab + ' tr').length >= 3) {
  289.         $(bettab + ' tr').last().remove();
  290.         $(bettab).prepend(bettable);
  291.         bettable = '';
  292.     } else if ($(bettab).length < 3) {
  293.         $(bettab).prepend(bettable);
  294.         bettable = '';
  295.     }
  296.     var stattable = '',
  297.         stattab = '#stats tbody';
  298.     stattable += '<tr><td style="color:green;">' + (balance / 1e8).toFixed(8) + '</td><td style="color:red;">' + losstreak + '</td><td style="color:green;">' + totalwin + '</td><td style="color:red;">' + totalloss + '</td><td id="profit">' + (totalprofit).toFixed(8) + '</td></tr>';
  299.     $(stattab).empty();
  300.     $(stattab).prepend(stattable);
  301.     stattable = '';
  302.     if (betprofit > 0) {
  303.         $('#bProfit').css('color', 'green');
  304.     } else {
  305.         $('#bProfit').css('color', 'red');
  306.     }
  307.     if (totalprofit >= 0) {
  308.         $('#profit').css('color', 'green');
  309.     } else {
  310.         $('#profit').css('color', 'red');
  311.     }
  312.  
  313. }
  314. setTimeout(function () {
  315.     $('#start').click(function () {
  316.  
  317.  
  318.         looptimes = 999999999;
  319.  
  320.  
  321.         if (loopenabled === false) {
  322.             loopenabled = true;
  323.  
  324.             loop = setInterval(function () {
  325.  
  326.                 if (loopcount >= looptimes) {
  327.                     clearInterval(loop);
  328.                     loopcount = 0;
  329.                     loopenabled = false;
  330.                 } else {
  331.                     if (betstarted === true) {} else {
  332.                         bet();
  333.                     }
  334.                 }
  335.             }, interval);
  336.  
  337.         }
  338.  
  339.     });
  340.     $('#setparams').click(function () {
  341.         setParams();
  342.     });
  343.     $('#stop').click(function () {
  344.         clearInterval(loop);
  345.         loopenabled = false;
  346.         loopcount = 0;
  347.     });
  348. function saveParams() {
  349.     localStorage.basebet = $('#basebet').val();
  350.     localStorage.chance = $('#chance').val();
  351.     localStorage.highlow = '#'+$('input:radio[name=hilo]:checked').attr('id');
  352.     localStorage.swapevery = $('#swapevery').val();
  353.     localStorage.wmultenabled = $('#wmultenabled').is(':checked');
  354.     localStorage.lmultenabled = $('#lmultenabled').is(':checked');
  355.     localStorage.wmultiplier = $('#wmultiplier').val();
  356.     localStorage.lmultiplier = $('#lmultiplier').val();
  357.     localStorage.multiplylosses = $('#multiplylosses').val();
  358.     localStorage.resetwins = $('#resetwins').val();
  359. }
  360. function loadParams() {
  361.     $('#basebet').val(localStorage.basebet);
  362.     $('#chance').val(localStorage.chance);
  363.     $(localStorage.highlow).click();
  364.     $('#swapevery').val(localStorage.swapevery);
  365.     $('#wmultenabled').prop('checked', JSON.parse(localStorage.wmultenabled));
  366.     $('#lmultenabled').prop('checked', JSON.parse(localStorage.lmultenabled));
  367.     $('#wmultiplier').val(localStorage.wmultiplier);
  368.     $('#lmultiplier').val(localStorage.lmultiplier);
  369.     $('#multiplylosses').val(localStorage.multiplylosses);
  370.     $('#resetwins').val(localStorage.resetwins);
  371. }
  372. $('#save').click(function(){
  373.     saveParams();
  374. });
  375. $('#load').click(function(){
  376.     loadParams();
  377. });
  378.     $('<div id="manualroll2" onclick="bet();">Roll</div>').appendTo('#buttonz').button();
  379. }, 2000);
  380. // py
  381.  
  382. import urllib
  383. import urllib2
  384. import json
  385. import threading
  386. global target2
  387. global condition2
  388. global counter
  389. from random import randint
  390. target2 = 10
  391. condition2 = '<'
  392. counter = 0
  393. amount = 3000
  394. swapevery = 1
  395. def set_interval(func, sec):
  396.     def func_wrapper():
  397.         set_interval(func, sec)
  398.         func()
  399.     t = threading.Timer(sec, func_wrapper)
  400.     t.start()
  401.     return t
  402. # Login Info
  403. username = ""
  404. password = ""
  405. apiBase = 'https://api.primedice.com/api/'
  406. # Do Login
  407. lData = {
  408.         'username' : username,
  409.         'password' : password
  410. }
  411.  
  412. loginData = urllib.urlencode(lData)
  413. loginReq = urllib2.Request(apiBase+"login", loginData)
  414. loginResp = urllib2.urlopen(loginReq)
  415.  
  416. # Get Token
  417. token = json.load(loginResp)['access_token']
  418.  
  419. iData = { 'access_token' : token }
  420. infoData = urllib.urlencode(iData)
  421. infoReq = urllib2.Request(apiBase+"users/1?"+infoData)
  422. infoResp = urllib2.urlopen(infoReq)
  423.  
  424. accInfo = json.load(infoResp)
  425. accInfo = accInfo["user"]
  426. totalbets = accInfo["bets"]
  427. userid = accInfo["userid"]
  428. prevshash = accInfo["previous_server_hashed"]
  429. """
  430. print "Total Bets: " + str(totalbets)
  431. print "UserID: " + str(userid)
  432. print "Previous Hash: " + prevshash
  433. """
  434. def swap():
  435.     global counter
  436.     global target2
  437.     global condition2
  438.     global amount
  439.     global swapevery
  440.     counter += 1
  441.     if counter >= swapevery:
  442.         if target2 < 50:
  443.             target2 = 99
  444.             condition2 = '>'
  445.             counter = 0
  446.         else:
  447.             target2 = 0.5
  448.             condition2 = '<'
  449.             counter = 0
  450.     else:
  451.         print "Swap Count: " + str(counter)
  452. swapcounter=0
  453. def bet():
  454.     global amount
  455.     global target2
  456.     global condition2
  457.     global swapevery
  458.     global swapcounter
  459.    
  460.    
  461.     bData = {
  462.         'amount' : amount,
  463.         'target' : target2,
  464.         'condition' : condition2
  465.     }
  466.     try:
  467.         betData = urllib.urlencode(bData)
  468.         betReq = urllib2.Request(apiBase+"bet?"+infoData, betData)
  469.         betResp = urllib2.urlopen(betReq);
  470.         betInfo = json.load(betResp);
  471.         print "Win: " + str(betInfo["bet"]["win"])
  472.         print "Bet Amount: " + str(betInfo["bet"]["amount"])
  473.         print "Balance: " + str(betInfo["user"]["balance"])
  474.         if betInfo["bet"]["win"] == True:
  475.             amount += 1000
  476.             swapevery = 1
  477.         else :
  478.             swapcounter += 1
  479.             if swapcounter >= swapevery:
  480.                 swapevery +=randint(0,99)
  481.                 swapcounter = 0
  482.         swap()
  483.     except urllib2.HTTPError, e:
  484.         print e.code
  485.     except urllib2.URLError, e:
  486.         print str(e.reason)
  487.     except urllib2.HTTPException, e:
  488.         print 'HTTPException'
  489.     except Exception:
  490.         import traceback
  491.         print 'generic exception'
  492.    
  493.  
  494. set_interval(bet, 0.075)
  495.  
  496.  
  497. // end js
  498.  
  499. var flameBot, betspeed, aftermanualtrigger,swaplosscount, swapcount, loop, loopenabled, betData, condition,profit, target, losscount, totalloss, totalwin, currentbet, basebet, mainmult, initmult, result, UI ='', UI2='';
  500. profit=0;
  501. betspeed=500;
  502. loopcount=0;
  503. betstarted=false;
  504. loopenabled=false;
  505. aftermanualtrigger=false;
  506. swaplosscount=0;
  507. swapcount=0;
  508. flameBot = {
  509.         initialize: {
  510.             init1: function() {
  511.                 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>';
  512.                 $(lib).appendTo('head');
  513.                 setTimeout(function(){flameBot.initialize.init2();}, 1000);
  514.             },
  515.             init2: function() {
  516.                 losscount=0;
  517.                 totalloss=0;
  518.                 totalwin=0;
  519.                 $('.hero__main').empty().css('width', '550px') & $('.hero__main').css("padding", "0") & $(UI).appendTo('.hero__main') &
  520.                 $('#flameBot').tabs() & $('button').button().css('font-size', '13px').css('padding', '5px');
  521.                 $('#stats th').css("width", "20%").css("font-size", "15px");
  522.                 $('#hilo, #resetorzero').buttonset();
  523.                 $('#flameBot li').css('font-size', '15px');
  524.                 $('#flameBot #resetorzero').css('font-size', '13px');
  525.                 $('#flameBot div[role=tabpanel] td').css('padding', 1);
  526.                 $('.hero__main').css('margin-top', '-75px');
  527.                  var css = '',
  528.                 backgroundurl = 'http://cdn.wonderfulengineering.com/wp-content/uploads/2014/01/HD-backgrounds-3.jpg';
  529.                 css += '<style id="paraDark">';
  530.                 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;}';
  531.                 css += 'time{color:#ccc !important;}';
  532.                 css += 'div.tabs > div > div.live-data-header > div{background-color:#111111;border-top:1px solid #777; border-bottom:1px solid #777;}';
  533.                 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;}';
  534.                 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;}';
  535.                 css += '.hero{margin-bottom:0px;background:url("' + backgroundurl + '") no-repeat 50% 50%;}';
  536.                 css += '.slideout *{color:#ccc;}';
  537.                 css += '.tabs{padding-top:20px;border-top:1px solid #777 !important;}';
  538.                 css += 'header{border: 1px solid #777 !important;border-left:none !important;border-right:none !important;}';
  539.                 css += '.rollrow-thin, .rollrow-dark .chat__input-holder {background-color:#212121;}';
  540.                 css += '.input{background-color:#323232 !important;color:#ccc;}';
  541.                 css += '.action-open-slideout{background-color:#121212 !important;}';
  542.                 css += 'span.admin{color:red !important}';
  543.              
  544.                 css += '</style>';
  545.                 $(css).appendTo('head');
  546.                 $('#start').click(function () {
  547.                    
  548.                    looptimes=999999999;
  549.                     if (loopenabled === false) {
  550.                         loopenabled = true;
  551.              
  552.                         loop = setInterval(function () {
  553.              
  554.                             if (loopcount >= looptimes) {
  555.                                 clearInterval(loop);
  556.                                 loopcount = 0;
  557.                                 loopenabled = false;
  558.                             } else {
  559.                                 if (betstarted === true) {} else {
  560.                                     flameBot.API.bet();
  561.                                 }
  562.                             }
  563.                         }, betspeed);
  564.              
  565.                     }
  566.              
  567.                 });
  568.                  $('#stop').click(function () {
  569.                     clearInterval(loop);
  570.                     loopenabled = false;
  571.                     loopcount = 0;
  572.                 });
  573.                  $('#setparams').click(function(){
  574.                     flameBot.API.setParams();
  575.                  })
  576.             }
  577.         },
  578.         tools: {
  579.             dec2Sat: function(decimal) {
  580.                 return (Math.floor(decimal*1e8));
  581.             },
  582.             token: function() {
  583.                 return localStorage.token;
  584.             },
  585.             satToDec: function(satoshi) {
  586.                 return ((satoshi/1e8).toFixed(8));
  587.             },
  588.  
  589.         },
  590.         API: {
  591.             onLoss: function() {
  592.                 totalloss++;
  593.                 losscount++;
  594.                
  595.                 if ($('#swaplossesenabled').is(':checked') === true) {
  596.                     swaplosscount++;
  597.                     if (swaplosscount >= $('#swaplosses').val()){
  598.                         flameBot.API.swap();
  599.                         swaplosscount=0;
  600.                     }
  601.                 }
  602.                 if ($('#afterlossesenabled').is(':checked') === true) {
  603.                     if (losscount >= $('#afterlosses').val()){
  604.                         if ($('#aftermanualenabled').is(':checked') === true) {
  605.                            
  606.                                 if (aftermanualtrigger === true) { } else {
  607.                                     var r = confirm("Click Okay to reset to base. Click cancel to bet 0 until win.");
  608.                                     if (r == true) {
  609.                                         aftermanualtrigger=false;
  610.                                         currentbet=basebet;
  611.                                         losscount=0;
  612.                                     } else {
  613.                                         aftermanualtrigger=true;
  614.                                         currentbet=0;
  615.                                     }
  616.                                 }
  617.  
  618.                         } else {
  619.                             if ($('input:radio[name=resetorzero]:checked').val() == 'orzero') {
  620.                                 currentbet=0;
  621.                             } else if ($('input:radio[name=resetorzero]:checked').val() == 'resetor') {
  622.                                 losscount=0;
  623.                                 currentbet=basebet;
  624.                             }
  625.                         }
  626.                      
  627.                     } else {
  628.                         if (losscount == $('#startlosses').val()) {
  629.                             currentbet = currentbet * $('#initialmultiplier').val();
  630.                         } else if (losscount > $('#startlosses').val()) {
  631.                             currentbet = currentbet * $('#mainmultiplier').val();                  
  632.                         }  
  633.                     }
  634.                 } else {
  635.                     if (losscount == $('#startlosses').val()) {
  636.                             currentbet = currentbet * $('#initialmultiplier').val();
  637.                     } else if (losscount > $('#startlosses').val()) {
  638.                             currentbet = currentbet * $('#mainmultiplier').val();                  
  639.                     }  
  640.                 }
  641.                 flameBot.API.addRow();
  642.             },
  643.             onWin: function() {
  644.                 if (aftermanualtrigger === true) { aftermanualtrigger = false }
  645.                 totalwin++;
  646.                 swaplosscount=0;
  647.                 losscount=0;
  648.                 currentbet = basebet;
  649.                 flameBot.API.addRow();
  650.             },
  651.             setParams: function () {
  652.                 losscount=0;
  653.                 aftermanualtrigger=false;
  654.                 swaplosscount=0;
  655.                 swapcount=0;
  656.                 initmult = $('#initialmultiplier').val();
  657.                 mainmult = $('#mainmultiplier').val();
  658.                 basebet = flameBot.tools.dec2Sat($('#basebet').val());
  659.                 currentbet = basebet;
  660.                 if ($('input:radio[name=hilo]:checked').val() == 'hi') {
  661.                     condition = '>';
  662.                     target = (99.99 - (99 / $('#chance').val())).toFixed(2);
  663.                 } else if ($('input:radio[name=hilo]:checked').val() == 'lo') {
  664.                     condition = '<';
  665.                     target = (99 / $('#chance').val()).toFixed(2);
  666.                 } else if ($('input:radio[name=hilo]:checked').val() == 'swap') {
  667.                     condition = '<';
  668.                     target = 0 + (99 / $('#chance').val()).toFixed(2);
  669.                 }
  670.             },
  671.             addRow: function () {
  672.                 var bettable = '',
  673.                     bettab = '#lastbet2';
  674.                 bettable += '<tr><td>' + flameBot.tools.satToDec(result.bet.amount) + '</td>';
  675.                 bettable += '<td>' + result.bet.multiplier + 'x' + '</td>'; /* return bet payout */
  676.                 bettable += '<td>' + (result.bet.target).toFixed(2) + '</td>'; /* return target*/
  677.                 bettable += '<td>' + result.bet.roll + '</td>'; /* return roll */
  678.                 bettable += '<td id="proff">' + flameBot.tools.satToDec(result.bet.profit) + '</td></tr>';
  679.              
  680.                 var stattable = '',
  681.                     stattab = '#lastbet3';
  682.                 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>';
  683.                 $(stattab).empty();
  684.                 $(stattab).prepend(stattable);
  685.                 stattable = '';
  686.                 if ($(bettab + ' tbody tr').length >= 30) {
  687.                     $(bettab + ' tr').last().remove();
  688.                     $(bettab).prepend(bettable);
  689.                     bettable = '';
  690.                 } else if ($(bettab).length < 30) {
  691.                     $(bettab).prepend(bettable);
  692.                     bettable = '';
  693.                 }
  694.              
  695.                 $('#lastbet2 *, #lastbet3 *, #lastbet *, #proff').css('text-align', 'center');
  696.                 $('#lastbet2 *, #lastbet3 *, #lastbet *').css('width', '20%');
  697.                 $('#lastbet *').css('padding', '5px');
  698.                 $('#lastbet *').css('border-bottom', '1px solid #ccc');
  699.                 $('#result-1').css('padding', '5px');
  700.                 $('#lastbet2 *, #lastbet3 *, #proff').css('padding', '5px');
  701.                 $('#lastbet > tbody > tr > th:nth-child(2)').css('border-top', '1px solid #ddd');
  702.                 if (profit >= 0) {
  703.                     $('#profit').css('color', 'green');
  704.                 } else {
  705.                     $('#profit').css('color', 'red');
  706.                 }
  707.                 if (result.bet.win === true) {
  708.                     $('#proff:first').css('color', 'green');
  709.                 } else {
  710.                     $('#proff:first').css('color', 'red');
  711.                 }
  712.                 betstarted=false;
  713.             },
  714.  
  715.             bet: function() {
  716.                 betstarted=true;
  717.                 var betData = {
  718.                     amount: currentbet,
  719.                     condition: condition,
  720.                     target: target,
  721.                 };
  722.                 $.ajax({
  723.                     url: 'https://api.primedice.com/api/bet?access_token='+flameBot.tools.token(),
  724.                     type: 'POST',
  725.                     data: betData,
  726.                     datatype: 'jsonp',
  727.                     success: function (data) {
  728.                         result = data;
  729.                         profit = parseFloat(profit) + parseFloat(flameBot.tools.satToDec(data.bet.profit));
  730.                         if ($('input:radio[name=hilo]:checked').val() == 'swap') {
  731.                             swapcount++;
  732.                             if (swapcount >= $('#swapevery').val()) {
  733.                                 flameBot.API.swap();
  734.                                 swapcount=0;
  735.                             }
  736.                         }
  737.                         if (data.bet.win === true) {
  738.                             $('span.btn__text.select div').text(flameBot.tools.satToDec(result.user.balance)).css('color', 'green');
  739.                             flameBot.API.onWin();
  740.                         } else {
  741.                             $('span.btn__text.select div').text(flameBot.tools.satToDec(result.user.balance)).css('color', 'red');
  742.                             flameBot.API.onLoss();
  743.                         }
  744.                     },
  745.                     error: function (errorThrown) {
  746.                         betstarted=false;
  747.                     }
  748.                 });
  749.             },
  750.             seedChange: function () {
  751.                 function seedgen() {
  752.                     var seed = '';
  753.                     var seedlength = 10;
  754.                     var charset = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()';
  755.                     for (var i = 0; i <= seedlength; i++)
  756.              
  757.                         seed += charset.charAt(Math.floor(Math.random() * charset.length));
  758.              
  759.                     return seed;
  760.                 }
  761.                 var s = seedgen(),
  762.                     url = 'https://api.primedice.com/api/seed?access_token=' + localStorage.token,
  763.                     sData = {
  764.                         seed: s
  765.                     };
  766.              
  767.                 $.ajax({
  768.                     url: url,
  769.                     type: 'POST',
  770.                     data: sData,
  771.                     datatype: 'json',
  772.                     success: function (data, textStatus, jqXHR) {
  773.                         data2 = data;
  774.                         $('#currentseed').val(data2.seeds.client);
  775.              
  776.              
  777.                     },
  778.                     error: function (jqXHR, textStatus, errorThrown) {
  779.                         return false;
  780.                     }
  781.                 });
  782.             },
  783.             swap: function () {
  784.                 if (condition == '<') {
  785.                      condition = '>';
  786.                     target = (99.99 - (99 / $('#chance').val())).toFixed(2);               
  787.                 } else if (condition == '>') {
  788.                        condition = '<';
  789.                     target = (99 / $('#chance').val()).toFixed(2);
  790.                 }
  791.             },
  792.         }
  793. }
  794.    
  795. var UI ='';
  796. UI += '<table id="lastbet">';
  797. UI += '<tr><th>Bet</th><th>Payout</th><th>Game</th><th>Roll</th><th>Profit</th></tr></table>';
  798. UI += '<div style="max-height:390px !important;font-size:11px;overflow-y: scroll;overflow-x: hidden;"><table id="lastbet2"></table></div>';
  799. UI += '<div id="flameBot" style="width:550px"><ul><li>';
  800. UI += '<a href="/play#basic">Basic Settings</a></li>';
  801. UI += '<li><a href="/play#onloss">On Loss</a></li>';
  802. UI += '<li><a href="/play#onlosstreak">Loss - Adv.</a></li>';
  803. UI += '<li style="margin:8px;font-size:12px;margin-left:35px;text-align:center;"><span>FlameBot - v1.0</span></li>';
  804. UI += '</ul>';
  805. UI += '<div id="basic" style="font-size:17.5px;"><center>';
  806. 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>';
  807. UI += '<div id="onloss" style="font-size:17.5px;"><center>';
  808. 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>';
  809. UI += '</center></div>';
  810. UI += '<div id="onlosstreak" style="font-size:17.5px;"><center>';
  811. 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>';
  812. UI += '</center></div>';
  813. UI += '<div id="controlstat">';
  814. 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>';
  815. UI += '<table style="margin:10px;"id="stats">';
  816. 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>';
  817. UI += '</div>';
  818. UI += '</div>';
  819. flameBot.initialize.init1();
Advertisement
Add Comment
Please, Sign In to add comment