Advertisement
Guest User

Untitled

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