Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var flameBot, betspeed, aftermanualtrigger,swaplosscount, swapcount, loop, loopenabled, betData, condition,profit, target, losscount, totalloss, totalwin, currentbet, basebet, mainmult, initmult, result, UI ='', UI2='';
- profit=0;
- var streakcounter = [];
- betspeed=500;
- loopcount=0;
- betstarted=false;
- loopenabled=false;
- aftermanualtrigger=false;
- swaplosscount=0;
- swapcount=0;
- flameBot = {
- initialize: {
- init1: function() {
- 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>';
- $(lib).appendTo('head');
- setTimeout(function(){flameBot.initialize.init2();}, 1000);
- },
- init2: function() {
- losscount=0;
- totalloss=0;
- totalwin=0;
- $('.hero__main').empty().css('width', '550px') & $('.hero__main').css("padding", "0") & $(UI).appendTo('.hero__main') &
- $('#flameBot').tabs() & $('button').button().css('font-size', '13px').css('padding', '5px');
- $('#stats th').css("width", "20%").css("font-size", "15px");
- $('#hilo, #resetorzero').buttonset();
- $('#flameBot li').css('font-size', '15px');
- $('#flameBot #resetorzero').css('font-size', '13px');
- $('#flameBot div[role=tabpanel] td').css('padding', 1);
- $('.hero__main').css('margin-top', '-75px');
- $('#stats2 th').css('width', '6.25%');
- var css = '',
- backgroundurl = 'http://cdn.wonderfulengineering.com/wp-content/uploads/2014/01/HD-backgrounds-3.jpg';
- css += '<style id="paraDark">';
- 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;}';
- css += 'time{color:#ccc !important;}';
- css += 'div.tabs > div > div.live-data-header > div{background-color:#111111;border-top:1px solid #777; border-bottom:1px solid #777;}';
- 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;}';
- 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;}';
- css += '.hero{margin-bottom:0px;background:url("' + backgroundurl + '") no-repeat 50% 50%;}';
- css += '.slideout *{color:#ccc;}';
- css += '.tabs{padding-top:20px;border-top:1px solid #777 !important;}';
- css += 'header{border: 1px solid #777 !important;border-left:none !important;border-right:none !important;}';
- css += '.rollrow-thin, .rollrow-dark .chat__input-holder {background-color:#212121;}';
- css += '.input{background-color:#323232 !important;color:#ccc;}';
- css += '.action-open-slideout{background-color:#121212 !important;}';
- css += 'span.admin{color:red !important}';
- css += '</style>';
- $(css).appendTo('head');
- for (i = 0; i < $('#stats2 th').length; i++) {
- streakcounter.push(0);
- }
- for (i = 0; i < $('#stats2 th').length; i++) {
- var lol=$('#stats2 th')[i];
- lol.textContent = (i+1).toString() + "(" + streakcounter[i] + ")";
- }
- $('#start').click(function () {
- looptimes=999999999;
- if (loopenabled === false) {
- loopenabled = true;
- loop = setInterval(function () {
- if (loopcount >= looptimes) {
- clearInterval(loop);
- loopcount = 0;
- loopenabled = false;
- } else {
- if (betstarted === true) {} else {
- flameBot.API.bet();
- }
- }
- }, betspeed);
- }
- });
- $('#stop').click(function () {
- clearInterval(loop);
- loopenabled = false;
- loopcount = 0;
- });
- $('#setparams').click(function(){
- flameBot.API.setParams();
- })
- }
- },
- tools: {
- dec2Sat: function(decimal) {
- return (Math.floor(decimal*1e8));
- },
- token: function() {
- return localStorage.token;
- },
- satToDec: function(satoshi) {
- return ((satoshi/1e8).toFixed(8));
- },
- },
- API: {
- onLoss: function() {
- totalloss++;
- losscount++;
- if ($('#swaplossesenabled').is(':checked') === true) {
- swaplosscount++;
- if (swaplosscount >= $('#swaplosses').val()){
- flameBot.API.swap();
- swaplosscount=0;
- }
- }
- if ($('#afterlossesenabled').is(':checked') === true) {
- if (losscount >= $('#afterlosses').val()){
- if ($('#aftermanualenabled').is(':checked') === true) {
- if (aftermanualtrigger === true) { } else {
- var r = confirm("Click Okay to reset to base. Click cancel to bet 0 until win.");
- if (r == true) {
- aftermanualtrigger=false;
- currentbet=basebet;
- losscount=0;
- } else {
- aftermanualtrigger=true;
- currentbet=0;
- }
- }
- } else {
- if ($('input:radio[name=resetorzero]:checked').val() == 'orzero') {
- currentbet=0;
- } else if ($('input:radio[name=resetorzero]:checked').val() == 'resetor') {
- losscount=0;
- currentbet=basebet;
- }
- }
- } else {
- if (losscount == $('#startlosses').val()) {
- currentbet = currentbet * $('#initialmultiplier').val();
- } else if (losscount > $('#startlosses').val()) {
- currentbet = currentbet * $('#mainmultiplier').val();
- }
- }
- } else {
- if (losscount == $('#startlosses').val()) {
- currentbet = currentbet * $('#initialmultiplier').val();
- } else if (losscount > $('#startlosses').val()) {
- currentbet = currentbet * $('#mainmultiplier').val();
- }
- }
- flameBot.API.addRow();
- },
- onWin: function() {
- if (aftermanualtrigger === true) { aftermanualtrigger = false }
- totalwin++;
- swaplosscount=0;
- var streak = losscount;
- streakcounter[losscount-1]++;
- losscount=0;
- currentbet = basebet;
- flameBot.API.addRow();
- },
- setParams: function () {
- losscount=0;
- aftermanualtrigger=false;
- swaplosscount=0;
- swapcount=0;
- initmult = $('#initialmultiplier').val();
- mainmult = $('#mainmultiplier').val();
- basebet = flameBot.tools.dec2Sat($('#basebet').val());
- currentbet = basebet;
- if ($('input:radio[name=hilo]:checked').val() == 'hi') {
- condition = '>';
- target = (99.99 - (99 / $('#chance').val())).toFixed(2);
- } else if ($('input:radio[name=hilo]:checked').val() == 'lo') {
- condition = '<';
- target = (99 / $('#chance').val()).toFixed(2);
- } else if ($('input:radio[name=hilo]:checked').val() == 'swap') {
- condition = '<';
- target = 0 + (99 / $('#chance').val()).toFixed(2);
- }
- },
- addRow: function () {
- var bettable = '',
- bettab = '#lastbet2';
- bettable += '<tr><td>' + flameBot.tools.satToDec(result.bet.amount) + '</td>';
- bettable += '<td>' + result.bet.multiplier + 'x' + '</td>'; /* return bet payout */
- bettable += '<td>' + (result.bet.target).toFixed(2) + '</td>'; /* return target*/
- bettable += '<td>' + result.bet.roll + '</td>'; /* return roll */
- bettable += '<td id="proff">' + flameBot.tools.satToDec(result.bet.profit) + '</td></tr>';
- var stattable = '',
- stattab = '#lastbet3';
- 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>';
- $(stattab).empty();
- $(stattab).prepend(stattable);
- stattable = '';
- if ($(bettab + ' tbody tr').length >= 30) {
- $(bettab + ' tr').last().remove();
- $(bettab).prepend(bettable);
- bettable = '';
- } else if ($(bettab).length < 30) {
- $(bettab).prepend(bettable);
- bettable = '';
- }
- for (i = 0; i < $('#stats2 th').length; i++) {
- var lol=$('#stats2 th')[i];
- lol.textContent = (i+1).toString() + "(" + streakcounter[i] + ")";
- }
- $('#lastbet2 *, #lastbet3 *, #lastbet *, #proff').css('text-align', 'center');
- $('#lastbet2 *, #lastbet3 *, #lastbet *').css('width', '20%');
- $('#lastbet *').css('padding', '5px');
- $('#lastbet *').css('border-bottom', '1px solid #ccc');
- $('#result-1').css('padding', '5px');
- $('#lastbet2 *, #lastbet3 *, #proff').css('padding', '5px');
- $('#lastbet > tbody > tr > th:nth-child(2)').css('border-top', '1px solid #ddd');
- if (profit >= 0) {
- $('#profit').css('color', 'green');
- } else {
- $('#profit').css('color', 'red');
- }
- if (result.bet.win === true) {
- $('#proff:first').css('color', 'green');
- } else {
- $('#proff:first').css('color', 'red');
- }
- betstarted=false;
- },
- bet: function() {
- betstarted=true;
- var betData = {
- amount: currentbet,
- condition: condition,
- target: target,
- };
- $.ajax({
- url: 'https://api.primedice.com/api/bet?access_token='+flameBot.tools.token(),
- type: 'POST',
- data: betData,
- datatype: 'jsonp',
- success: function (data) {
- result = data;
- profit = parseFloat(profit) + parseFloat(flameBot.tools.satToDec(data.bet.profit));
- if ($('input:radio[name=hilo]:checked').val() == 'swap') {
- swapcount++;
- if (swapcount >= $('#swapevery').val()) {
- flameBot.API.swap();
- swapcount=0;
- }
- }
- if (data.bet.win === true) {
- $('span.btn__text.select div').text(flameBot.tools.satToDec(result.user.balance)).css('color', 'green');
- flameBot.API.onWin();
- } else {
- $('span.btn__text.select div').text(flameBot.tools.satToDec(result.user.balance)).css('color', 'red');
- flameBot.API.onLoss();
- }
- },
- error: function (errorThrown) {
- betstarted=false;
- }
- });
- },
- seedChange: function () {
- function seedgen() {
- var seed = '';
- var seedlength = 10;
- var charset = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()';
- for (var i = 0; i <= seedlength; i++)
- seed += charset.charAt(Math.floor(Math.random() * charset.length));
- return seed;
- }
- var s = seedgen(),
- url = 'https://api.primedice.com/api/seed?access_token=' + localStorage.token,
- sData = {
- seed: s
- };
- $.ajax({
- url: url,
- type: 'POST',
- data: sData,
- datatype: 'json',
- success: function (data, textStatus, jqXHR) {
- data2 = data;
- $('#currentseed').val(data2.seeds.client);
- },
- error: function (jqXHR, textStatus, errorThrown) {
- return false;
- }
- });
- },
- swap: function () {
- if (condition == '<') {
- condition = '>';
- target = (99.99 - (99 / $('#chance').val())).toFixed(2);
- } else if (condition == '>') {
- condition = '<';
- target = (99 / $('#chance').val()).toFixed(2);
- }
- },
- }
- }
- var UI ='';
- UI += '<table style="margin:10px;"id="stats">';
- 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>';
- UI += '<table style="margin:10px;"id="stats2">';
- 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>';
- UI += '<table id="lastbet">';
- UI += '<tr><th>Bet</th><th>Payout</th><th>Game</th><th>Roll</th><th>Profit</th></tr></table>';
- UI += '<div style="max-height:390px !important;font-size:11px;overflow-y: scroll;overflow-x: hidden;"><table id="lastbet2"></table></div>';
- UI += '<div id="flameBot" style="width:550px"><ul><li>';
- UI += '<a href="/play#basic">Basic Settings</a></li>';
- UI += '<li><a href="/play#onloss">On Loss</a></li>';
- UI += '<li><a href="/play#onlosstreak">Loss - Adv.</a></li>';
- UI += '<li style="margin:8px;font-size:12px;margin-left:35px;text-align:center;"><span>FlameBot - v1.0</span></li>';
- UI += '</ul>';
- UI += '<div id="basic" style="font-size:17.5px;"><center>';
- 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>';
- UI += '<div id="onloss" style="font-size:17.5px;"><center>';
- 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>';
- UI += '</center></div>';
- UI += '<div id="onlosstreak" style="font-size:17.5px;"><center>';
- 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>';
- UI += '</center></div>';
- UI += '<div id="controlstat">';
- 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>';
- UI += '</div>';
- UI += '</div>';
- flameBot.initialize.init1();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement