Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var check = true;
- var startGame;
- var AllPayOut = {
- minChange: 90,
- maxChange: 90,
- allGame: [],
- baseBetAll: 0.00001000,
- coin: 'btc',
- winPercent: 110,
- init: function () {
- for (var change = this.minChange; change < this.maxChange + 0.01; change += 0.01){
- var chance = change;
- var payout = (100/change);
- payout = payout-(payout*(parseFloat(1)/100));
- var value = parseFloat(payout);
- if(value < 1000)
- value = value.toFixed(4);
- this.allGame.push({
- low: {
- game: parseFloat(chance).toFixed(2),
- condition: '<',
- relatively_stack: parseInt(parseFloat(value * 10).toFixed(0)),
- onlose: this.baseBetAll / (this.baseBetAll * value - this.baseBetAll) * this.winPercent,
- percentWin: 0,
- stackLose: 0,
- basebet: this.baseBetAll,
- bigerStackLose: 0,
- payout: value
- },
- hi: {
- game: parseFloat((100-chance-0.01)).toFixed(2),
- condition: '>',
- relatively_stack: parseInt(parseFloat(value * 10).toFixed(0)),
- onlose: this.baseBetAll / (this.baseBetAll * value - this.baseBetAll) * this.winPercent,
- percentWin: 0,
- stackLose: 0,
- basebet: this.baseBetAll,
- bigerStackLose: 0,
- payout: value
- }
- });
- }
- }
- };
- var Game = {
- defaultGame: {},
- gameAfterWin: {},
- totalWin: 0,
- totalLose: 0,
- auto_stats_lucky: 0,
- auto_stats_wagered: 0,
- auto_stats_profit: 0,
- bet: 0,
- bigest_bl: 0,
- gameStart: null,
- eventBetId: {},
- addFullcl: function (){
- var autobet = $('.div-auto-stats.panel-colorful').clone();
- autobet.attr('id', 'customId');
- $('#game_div').append(autobet);
- this.addHtmlAutoBet('Stack lose', 0, 'sl', 'calc(100% / 5)', 'fa fa-angle-down');
- this.addHtmlAutoBet('Bigest SL', 0, 'big_sl', 'calc(100% / 5)', 'fa fa-angle-double-down');
- this.addHtmlAutoBet('Payout', 0, 'py', 'calc(100% / 5)', 'fa fa-money');
- this.addHtmlAutoBet('Tỉ lệ thắng', 0, 'py_win', 'calc(100% / 5)', 'fa fa-sort-numeric-desc');
- this.addHtmlAutoBet('Game', 0, 'roll_game', 'calc(100% / 5)', 'fa fa-sort-numeric-desc');
- this.addHtmlAutoBet('Base bet', 0, 'bb', 'calc(100% / 5)', 'fa fa-sort-numeric-desc');
- },
- addmoreBar: function (val){
- $('#customId').fadeIn();
- $("#customId #auto_stats_won").html(this.totalWin).closest('.row.pad-hor').css({'width': '40%', 'display': 'inline-block'});
- $("#customId #auto_stats_lost").html(this.totalLose).closest('.row.pad-hor').css({'width': '40%', 'display': 'inline-block'});
- $("#customId #auto_stats_lucky").html(this.auto_stats_lucky+"%").closest('.row.pad-top-10').css({'width': 'calc(100% / 5)', 'display': 'inline-block'});
- $("#customId #auto_stats_wagered").html(number_format(round_float(this.auto_stats_wagered, 8), 8)).closest('.row.pad-top-10').css({'width': 'calc(100% / 5)', 'display': 'inline-block'});
- $("#customId #auto_stats_profit").html(number_format(round_float(this.auto_stats_profit, 8), 8)).closest('.row.pad-top-10').css({'width': 'calc(100% / 5)', 'display': 'inline-block'});
- $("#customId #sl .text-thin.media-heading").html(this.defaultGame.stackLose);
- $("#customId #big_sl .text-thin.media-heading").html(this.defaultGame.bigerStackLose);
- $("#customId #py .text-thin.media-heading").html(this.defaultGame.payout);
- $("#customId #py_win .text-thin.media-heading").html(this.defaultGame.percentWin);
- $("#customId #roll_game .text-thin.media-heading").html(this.defaultGame.condition+''+this.defaultGame.game);
- $("#customId #bb .text-thin.media-heading").html(this.defaultGame.basebet);
- // this.addHtmlAutoBet('Max balance', this.bigest_bl, 'max_bl', 'calc(100% / 5)', 'fa fa-money');
- // this.addHtmlAutoBet('Base bet', val.return.amount, 'base_bet', 'calc(100% / 5)', 'fa fa-btc');
- // this.addHtmlAutoBet('Game', this.defaultGame.condition+''+this.defaultGame.game, 'roll_game', 'calc(100% / 5)', 'fa fa-gamepad');
- // this.addHtmlAutoBet('Roll', val.return.roll_number, 'roll_number', 'calc(100% / 5)', 'fa fa-sort-numeric-desc');
- // this.addHtmlAutoBet('Stack lose', this.defaultGame.stackLose, 'sl', 'calc(100% / 5)', 'fa fa-angle-down');
- // this.addHtmlAutoBet('Bigest SL', this.defaultGame.bigerStackLose, 'big_sl', 'calc(100% / 5)', 'fa fa-angle-double-down');
- // this.addHtmlAutoBet('Payout', this.defaultGame.payout, 'py', 'calc(100% / 5)', 'fa fa-angle-double-down');
- // this.addHtmlAutoBet('Tỉ lệ thắng', this.defaultGame.percentWin, 'py_win', 'calc(100% / 5)', 'fa fa-angle-double-down');
- },
- addHtmlAutoBet: function(title, value, id, width, icon){
- icon = icon || 'fa fa-info-circle';
- width = width || '100%';
- var div = $('<div/>', {class: 'row pad-top-10', id: id, style: 'width: '+width+'; display: inline-block;'}).append(
- $('<div/>', {class: 'col-sm-12'}).append(
- $('<div/>', {class: 'pad-hor media'}).append(
- $('<div/>', {class: 'media-left'}).append('<span class="icon-wrap icon-wrap-xs"><i class="'+icon+' fa-2x"></i></span>')
- ).append(
- $('<div/>', {class: 'media-body'}).append(
- $('<p/>', {class: 'h3 text-thin media-heading', text: value})
- ).append(
- $('<small/>', {class: 'text-uppercase', text: title})
- )
- )
- )
- );
- if($('#'+id).length > 0)
- $('#'+id).remove();
- $('#customId.panel-colorful').append(div);
- },
- calculateWin: function (roll_number) {
- var bp = -1;
- for (var index in AllPayOut.allGame){
- var item = AllPayOut.allGame[index];
- if(roll_number <= item.hi.game){
- item.hi.stackLose++;
- if(item.hi.stackLose > item.hi.relatively_stack){
- item.hi.relatively_stack = item.hi.stackLose;
- }
- if(item.hi.stackLose > item.hi.bigerStackLose){
- item.hi.bigerStackLose = item.hi.stackLose;
- }
- // item.hi.basebet = item.hi.basebet + item.hi.basebet * item.hi.onlose / 100;
- }else{
- item.hi.stackLose = 0;
- item.hi.basebet = AllPayOut.baseBetAll;
- item.hi.percentWin = 0;
- }
- if(roll_number >= item.low.game){
- item.low.stackLose++;
- if(item.low.stackLose > item.low.relatively_stack){
- item.low.relatively_stack = item.low.stackLose;
- }
- if(item.low.stackLose > item.low.bigerStackLose){
- item.low.bigerStackLose = item.low.stackLose;
- }
- // item.low.basebet = item.low.basebet + item.low.basebet * item.low.onlose / 100;
- }else{
- item.low.stackLose = 0;
- item.low.basebet = AllPayOut.baseBetAll;
- item.low.percentWin = 0;
- }
- for (var dition in item){
- item[dition].percentWin = item[dition].stackLose / item[dition].relatively_stack * 100;
- if(item[dition].percentWin > bp){
- bp = item[dition].percentWin;
- this.gameAfterWin = item[dition];
- // this.defaultGame = item[dition];
- }
- }
- AllPayOut.allGame[index] = item;
- }
- },
- restartGame: function(){
- clearInterval(startGame);
- for (var i in AllPayOut.allGame){
- AllPayOut.allGame[i].low.stackLose = 0;
- AllPayOut.allGame[i].low.basebet = AllPayOut.baseBetAll;
- AllPayOut.allGame[i].low.percentWin = 0;
- AllPayOut.allGame[i].hi.stackLose = 0;
- AllPayOut.allGame[i].hi.basebet = AllPayOut.baseBetAll;
- AllPayOut.allGame[i].hi.percentWin = 0;
- this.totalLose = 0;
- this.totalWin = 0;
- }
- modal_provably_fair();
- setTimeout(function(){ change_seeds();startGame = setInterval(autoBetGame, 0); }, 3000);
- },
- init: function () {
- AllPayOut.init();
- this.addFullcl();
- this.defaultGame = AllPayOut.allGame[AllPayOut.allGame.length - 1].hi;
- }
- };
- function autoBetGame() {
- var self = Game;
- // if(check){
- check = false;
- $.ajax({
- type: "POST",
- url: server_front_name+"/api/bet",
- cache: false,
- data: {
- access_token : access_token,
- username : user_username,
- type : "dice",
- amount : self.defaultGame.basebet,
- condition : self.defaultGame.condition,
- game : self.defaultGame.game,
- devise : AllPayOut.coin
- },
- success: function(text) {
- check = true;
- var val = JSON.parse(text);
- $("#won-bet span").html(val.return.amount_return);
- $("#won-bet span").removeClass("text-danger text-success");
- if (val.return.amount_return >= 0) {
- $("#won-bet span").addClass("text-success");
- $("#won-bet span").html("+"+number_format(round_float(val.return.amount_return, 8), 8));
- }
- else {
- $("#won-bet span").addClass("text-danger");
- $("#won-bet span").html(number_format(round_float(val.return.amount_return, 8), 8));
- }
- show_result_bet();
- $("#balance-"+val.return.devise).val(round_float(val.return.new_balance, 12));
- if (val.return.amount_return >= 0)
- $(".balance-"+val.return.devise+"-html").addClass("result-bet-win");
- else
- $(".balance-"+val.return.devise+"-html").addClass("result-bet-lose");
- $(".balance-"+val.return.devise+"-html").html(round_float(val.return.new_balance, 8));
- if (val.return.amount_return >= 0)
- setTimeout(function() { $(".balance-"+val.return.devise+"-html").removeClass("result-bet-win"); }, 350);
- else
- setTimeout(function() { $(".balance-"+val.return.devise+"-html").removeClass("result-bet-lose"); }, 350);
- addBetHistory("my-bets",
- val.return.type,
- val.return.id,
- val.return.username,
- val.return.time,
- val.return.amount,
- val.return.devise,
- val.return.winning_chance,
- val.return.roll_number,
- val.return.amount_return,
- val.return.condition,
- val.return.game, val.return.payout);
- if (val.return.success == 'true') {
- // self.calculateWin(val.return.roll_number);
- self.bet++;
- // self.defaultGame = self.gameAfterWin;
- if (val.return.amount_return > 0){
- // if((self.totalWin + self.totalLose) > 50000){
- // self.restartGame();
- // }
- self.totalWin++;
- }else{
- self.totalLose++;
- // self.defaultGame.basebet = self.defaultGame.basebet + self.defaultGame.basebet * self.defaultGame.onlose / 100;
- }
- if(val.return.new_balance > self.bigest_bl){
- self.bigest_bl = val.return.new_balance;
- }
- if(val.return.new_balance > 0.5 || val.return.roll_number == 22.22){
- self.eventBetId[val.return.id] = val.return.roll_number;
- clearInterval(startGame);
- }
- self.auto_stats_lucky = ((((parseInt(self.totalWin)/parseInt(self.bet))*100)/parseFloat(val.return.winning_chance))*100).toFixed(2);
- self.auto_stats_wagered = parseFloat(self.auto_stats_wagered)+parseFloat(val.return.amount);
- self.auto_stats_profit = parseFloat(self.auto_stats_profit)+parseFloat(val.return.amount_return);
- self.addmoreBar(val);
- console.clear();
- console.log(self.eventBetId);
- }
- },
- error:function (xhr, ajaxOptions, thrownError) {
- check = true;
- },
- timeout:function (xhr, ajaxOptions, thrownError) {
- check = true;
- },
- abort:function (xhr, ajaxOptions, thrownError) {
- check = true;
- }
- });
- // }
- }
- Game.init();
- startGame = setInterval(autoBetGame, 0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement