Advertisement
Guest User

ev

a guest
Dec 10th, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 14.74 KB | None | 0 0
  1. var check = true;
  2. var startGame;
  3. var AllPayOut = {
  4.     minChange: 82.50,
  5.     maxChange: 82.50,
  6.     allGame: [],
  7.     baseBetAll: 0.00000250,
  8.     coin: 'btc',
  9.     winPercent: 100,
  10.     init: function () {
  11.         for (var change = this.minChange; change < this.maxChange + 0.01; change += 0.01){
  12.             var chance = change;
  13.             var payout = (100/change);
  14.             payout = payout-(payout*(parseFloat(1)/100));
  15.             var value = parseFloat(payout);
  16.             if(value < 1000)
  17.                 value = value.toFixed(4);
  18.  
  19.             this.allGame.push({
  20.                 low: {
  21.                     game: parseFloat(chance).toFixed(2),
  22.                     condition: '<',
  23.                     relatively_stack: parseInt(parseFloat(value * 10).toFixed(0)),
  24.                     onlose: this.baseBetAll / (this.baseBetAll * value - this.baseBetAll) * this.winPercent,
  25.                     percentWin: 0,
  26.                     stackLose: 0,
  27.                     basebet: this.baseBetAll,
  28.                     bigerStackLose: 0,
  29.                     payout: value
  30.                 },
  31.                 hi: {
  32.                     game: parseFloat((100-chance-0.01)).toFixed(2),
  33.                     condition: '>',
  34.                     relatively_stack: parseInt(parseFloat(value * 10).toFixed(0)),
  35.                     onlose: this.baseBetAll / (this.baseBetAll * value - this.baseBetAll) * this.winPercent,
  36.                     percentWin: 0,
  37.                     stackLose: 0,
  38.                     basebet: this.baseBetAll,
  39.                     bigerStackLose: 0,
  40.                     payout: value
  41.                 }
  42.             });
  43.         }
  44.     }
  45. };
  46. var Game = {
  47.     defaultGame: {},
  48.     gameAfterWin: {},
  49.     totalWin: 0,
  50.     totalLose: 0,
  51.     auto_stats_lucky: 0,
  52.     auto_stats_wagered: 0,
  53.     auto_stats_profit: 0,
  54.     bet: 0,
  55.     bigest_bl: 0,
  56.     gameStart: null,
  57.     eventBetId: {},
  58.     rollGame: null,
  59.     clearGame: null,
  60.     addFullcl: function (){
  61.         var autobet = $('.div-auto-stats.panel-colorful').clone();
  62.         autobet.attr('id', 'customId');
  63.         $('#game_div').append(autobet);
  64.         this.addHtmlAutoBet('Stack lose', 0, 'sl', 'calc(100% / 5)', 'fa fa-angle-down');
  65.         this.addHtmlAutoBet('Bigest SL', 0, 'big_sl', 'calc(100% / 5)', 'fa fa-angle-double-down');
  66.         this.addHtmlAutoBet('Payout', 0, 'py', 'calc(100% / 5)', 'fa fa-money');
  67.         this.addHtmlAutoBet('Tỉ lệ thắng', 0, 'py_win', 'calc(100% / 5)', 'fa fa-sort-numeric-desc');
  68.         this.addHtmlAutoBet('Game', 0, 'roll_game', 'calc(100% / 5)', 'fa fa-sort-numeric-desc');
  69.         this.addHtmlAutoBet('Base bet', 0, 'bb', 'calc(100% / 5)', 'fa fa-sort-numeric-desc');
  70.     },
  71.     addmoreBar: function (val){
  72.         $('#customId').fadeIn();
  73.         $("#customId #auto_stats_won").html(this.totalWin).closest('.row.pad-hor').css({'width': '40%', 'display': 'inline-block'});
  74.         $("#customId #auto_stats_lost").html(this.totalLose).closest('.row.pad-hor').css({'width': '40%', 'display': 'inline-block'});
  75.         $("#customId #auto_stats_lucky").html(this.auto_stats_lucky+"%").closest('.row.pad-top-10').css({'width': 'calc(100% / 5)', 'display': 'inline-block'});
  76.         $("#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'});
  77.         $("#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'});
  78.         $("#customId #sl .text-thin.media-heading").html(this.defaultGame.stackLose);
  79.         $("#customId #big_sl .text-thin.media-heading").html(this.defaultGame.bigerStackLose);
  80.         $("#customId #py .text-thin.media-heading").html(this.defaultGame.payout);
  81.         $("#customId #py_win .text-thin.media-heading").html(this.defaultGame.percentWin);
  82.         $("#customId #roll_game .text-thin.media-heading").html(this.defaultGame.condition+''+this.defaultGame.game);
  83.         $("#customId #bb .text-thin.media-heading").html(this.defaultGame.basebet);
  84.         // this.addHtmlAutoBet('Max balance', this.bigest_bl, 'max_bl', 'calc(100% / 5)', 'fa fa-money');
  85.         // this.addHtmlAutoBet('Base bet', val.return.amount, 'base_bet', 'calc(100% / 5)', 'fa fa-btc');
  86.         // this.addHtmlAutoBet('Game', this.defaultGame.condition+''+this.defaultGame.game, 'roll_game', 'calc(100% / 5)', 'fa fa-gamepad');
  87.         // this.addHtmlAutoBet('Roll', val.return.roll_number, 'roll_number', 'calc(100% / 5)', 'fa fa-sort-numeric-desc');
  88.         // this.addHtmlAutoBet('Stack lose', this.defaultGame.stackLose, 'sl', 'calc(100% / 5)', 'fa fa-angle-down');
  89.         // this.addHtmlAutoBet('Bigest SL', this.defaultGame.bigerStackLose, 'big_sl', 'calc(100% / 5)', 'fa fa-angle-double-down');
  90.         // this.addHtmlAutoBet('Payout', this.defaultGame.payout, 'py', 'calc(100% / 5)', 'fa fa-angle-double-down');
  91.         // this.addHtmlAutoBet('Tỉ lệ thắng', this.defaultGame.percentWin, 'py_win', 'calc(100% / 5)', 'fa fa-angle-double-down');
  92.     },
  93.     addHtmlAutoBet: function(title, value, id, width, icon){
  94.         icon = icon || 'fa fa-info-circle';
  95.         width = width || '100%';
  96.         var div = $('<div/>', {class: 'row pad-top-10', id: id, style: 'width: '+width+'; display: inline-block;'}).append(
  97.             $('<div/>', {class: 'col-sm-12'}).append(
  98.                 $('<div/>', {class: 'pad-hor media'}).append(
  99.                     $('<div/>', {class: 'media-left'}).append('<span class="icon-wrap icon-wrap-xs"><i class="'+icon+' fa-2x"></i></span>')
  100.                 ).append(
  101.                     $('<div/>', {class: 'media-body'}).append(
  102.                         $('<p/>', {class: 'h3 text-thin media-heading', text: value})
  103.                     ).append(
  104.                         $('<small/>', {class: 'text-uppercase', text: title})
  105.                     )
  106.                 )
  107.             )
  108.         );
  109.         if($('#'+id).length > 0)
  110.             $('#'+id).remove();
  111.         $('#customId.panel-colorful').append(div);
  112.     },
  113.     calculateWin: function (roll_number) {
  114.         var bp = -1;
  115.         for (var index in AllPayOut.allGame){
  116.             var item = AllPayOut.allGame[index];
  117.             if(roll_number <= item.hi.game){
  118.                 item.hi.stackLose++;
  119.                 if(item.hi.stackLose > item.hi.relatively_stack){
  120.                     item.hi.relatively_stack = item.hi.stackLose;
  121.                 }
  122.                 if(item.hi.stackLose > item.hi.bigerStackLose){
  123.                     item.hi.bigerStackLose = item.hi.stackLose;
  124.                 }
  125.                 // item.hi.basebet = item.hi.basebet + item.hi.basebet * item.hi.onlose / 100;
  126.             }else{
  127.                 item.hi.stackLose = 0;
  128.                 item.hi.basebet = AllPayOut.baseBetAll;
  129.                 item.hi.percentWin = 0;
  130.             }
  131.  
  132.             if(roll_number >= item.low.game){
  133.                 item.low.stackLose++;
  134.                 if(item.low.stackLose > item.low.relatively_stack){
  135.                     item.low.relatively_stack = item.low.stackLose;
  136.                 }
  137.                 if(item.low.stackLose > item.low.bigerStackLose){
  138.                     item.low.bigerStackLose = item.low.stackLose;
  139.                 }
  140.                 // item.low.basebet = item.low.basebet + item.low.basebet * item.low.onlose / 100;
  141.             }else{
  142.                 item.low.stackLose = 0;
  143.                 item.low.basebet = AllPayOut.baseBetAll;
  144.                 item.low.percentWin = 0;
  145.             }
  146.  
  147.             for (var dition in item){
  148.                 item[dition].percentWin = item[dition].stackLose / item[dition].relatively_stack * 100;
  149.                 if(item[dition].percentWin > bp){
  150.                     bp = item[dition].percentWin;
  151.                     this.gameAfterWin = item[dition];
  152.                     // this.defaultGame = item[dition];
  153.                 }
  154.             }
  155.             AllPayOut.allGame[index] = item;
  156.         }
  157.     },
  158.     restartGame: function(){
  159.         clearInterval(startGame);
  160.         for (var i in AllPayOut.allGame){
  161.             AllPayOut.allGame[i].low.stackLose = 0;
  162.             AllPayOut.allGame[i].low.basebet = AllPayOut.baseBetAll;
  163.             AllPayOut.allGame[i].low.percentWin = 0;
  164.             AllPayOut.allGame[i].hi.stackLose = 0;
  165.             AllPayOut.allGame[i].hi.basebet = AllPayOut.baseBetAll;
  166.             AllPayOut.allGame[i].hi.percentWin = 0;
  167.             this.totalLose = 0;
  168.             this.totalWin = 0;
  169.         }
  170.         modal_provably_fair();
  171.         setTimeout(function(){ change_seeds();startGame = setInterval(autoBetGame, 0); }, 3000);
  172.     },
  173.     init: function () {
  174.         this.rollGame = prompt('Nhập số cần hunt', 0);
  175.         AllPayOut.baseBetAll = prompt('Nhập số tiền bet VD: 0.00000001', 0.00000001);
  176.         if(this.rollGame != null && AllPayOut.baseBetAll){
  177.             AllPayOut.init();
  178.             this.addFullcl();
  179.             this.defaultGame = AllPayOut.allGame[AllPayOut.allGame.length - 1].hi;
  180.         }
  181.     }
  182. };
  183. function autoBetGame() {
  184.     var self = Game;
  185.     // if(check){
  186.         check = false;
  187.         $.ajax({
  188.             type: "POST",
  189.             url: server_front_name+"/api/bet",
  190.             cache: false,
  191.             data: {
  192.                 access_token        :       access_token,
  193.                 username            :       user_username,
  194.                 type                :       "dice",
  195.                 amount              :       self.defaultGame.basebet,
  196.                 condition           :       self.defaultGame.condition,
  197.                 game                :       self.defaultGame.game,
  198.                 devise              :       AllPayOut.coin
  199.             },
  200.             success: function(text) {
  201.                 check = true;
  202.                 var val = JSON.parse(text);
  203.                 $("#won-bet span").html(val.return.amount_return);
  204.                 $("#won-bet span").removeClass("text-danger text-success");
  205.                 if (val.return.amount_return >= 0)  {
  206.                     $("#won-bet span").addClass("text-success");
  207.                     $("#won-bet span").html("+"+number_format(round_float(val.return.amount_return, 8), 8));
  208.                 }
  209.                 else {
  210.                     $("#won-bet span").addClass("text-danger");
  211.                     $("#won-bet span").html(number_format(round_float(val.return.amount_return, 8), 8));
  212.                 }
  213.                 show_result_bet();
  214.                 $("#balance-"+val.return.devise).val(round_float(val.return.new_balance, 12));
  215.  
  216.                 if (val.return.amount_return >= 0)
  217.                     $(".balance-"+val.return.devise+"-html").addClass("result-bet-win");
  218.                 else
  219.                     $(".balance-"+val.return.devise+"-html").addClass("result-bet-lose");
  220.  
  221.                 $(".balance-"+val.return.devise+"-html").html(round_float(val.return.new_balance, 8));
  222.  
  223.                 if (val.return.amount_return >= 0)
  224.                     setTimeout(function() { $(".balance-"+val.return.devise+"-html").removeClass("result-bet-win"); }, 350);
  225.                 else
  226.                     setTimeout(function() { $(".balance-"+val.return.devise+"-html").removeClass("result-bet-lose");    }, 350);
  227.                 addBetHistory("my-bets",
  228.                     val.return.type,
  229.                     val.return.id,
  230.                     val.return.username,
  231.                     val.return.time,
  232.                     val.return.amount,
  233.                     val.return.devise,
  234.                     val.return.winning_chance,
  235.                     val.return.roll_number,
  236.                     val.return.amount_return,
  237.                     val.return.condition,
  238.                     val.return.game, val.return.payout);
  239.                 if (val.return.success == 'true') {
  240.                     self.calculateWin(val.return.roll_number);
  241.                     self.bet++;
  242.                     if(self.gameAfterWin)
  243.                         self.defaultGame = self.gameAfterWin;
  244.                     if (val.return.amount_return > 0){
  245.                         // if((self.totalWin + self.totalLose) > 50000){
  246.                         //     self.restartGame();
  247.                         // }
  248.                         self.totalWin++;
  249.                     }else{
  250.                         self.totalLose++;
  251.                         // self.defaultGame.basebet = self.defaultGame.basebet + self.defaultGame.basebet * 200 / 100;
  252.                     }
  253.                     if(val.return.new_balance > self.bigest_bl){
  254.                         self.bigest_bl = val.return.new_balance;
  255.                     }
  256.                     if(val.return.id >= 19999998000){
  257.                         Game.defaultGame.basebet = 0.0002;
  258.                         AllPayOut.baseBetAll = 0.0002;
  259.                     }
  260.                     if(val.return.new_balance > 0.5 || val.return.id > 20000000000
  261.                         // val.return.roll_number == self.rollGame
  262.                         //  val.return.roll_number == 80 ||
  263.                         //  val.return.roll_number == 90
  264.                         //  val.return.roll_number == 55.55 ||
  265.                         //  val.return.roll_number == 11.11 ||
  266.                         //  val.return.roll_number == 33.33 ||
  267.                         //  val.return.roll_number == 44.44
  268.                          // val.return.roll_number == 99.99 ||
  269.                          // val.return.roll_number == 7
  270.                          // val.return.roll_number == 8.88 ||
  271.                          // val.return.roll_number == 99.77
  272.                     ){
  273.                         self.eventBetId[val.return.id] = val.return.roll_number;
  274.                         self.clearGame = setInterval(function(){
  275.                             clearInterval(startGame);
  276.                         }, 0)
  277.                     }
  278.                     self.auto_stats_lucky = ((((parseInt(self.totalWin)/parseInt(self.bet))*100)/parseFloat(val.return.winning_chance))*100).toFixed(2);
  279.                     self.auto_stats_wagered = parseFloat(self.auto_stats_wagered)+parseFloat(val.return.amount);
  280.                     self.auto_stats_profit = parseFloat(self.auto_stats_profit)+parseFloat(val.return.amount_return);
  281.                     self.addmoreBar(val);
  282.                     console.clear();
  283.                     console.log(self.eventBetId);
  284.                 }
  285.             },
  286.             error:function (xhr, ajaxOptions, thrownError) {
  287.                 check = true;
  288.             },
  289.             timeout:function (xhr, ajaxOptions, thrownError) {
  290.                 check = true;
  291.             },
  292.             abort:function (xhr, ajaxOptions, thrownError) {
  293.                 check = true;
  294.             }
  295.         });
  296.     // }
  297. }
  298. function continueGame() {
  299.     clearInterval(Game.clearGame);
  300.     startGame = setInterval(autoBetGame, 0);
  301. }
  302. Game.init();
  303. startGame = setInterval(autoBetGame, 0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement