Best Strategy BOT for Bitsler 2k17


SUBMITTED BY: Optiplex

DATE: June 24, 2017, 10:06 p.m.

UPDATED: June 24, 2017, 10:20 p.m.

FORMAT: Text only

SIZE: 29.6 kB

HITS: 2308

  1. console.clear();
  2. // Tick the increase button
  3. $('#id-bet-on-lose').click();
  4. // Won variable
  5. var won = null;
  6. (function() {
  7. console.log("This script is coded by Christian **** (clasher.7526@gmail.com). If you have any problems, contact me");
  8. var balance = parseFloat(prompt("Type in your exact balance!!!", '0.000001'));
  9. if (balance == null || isNaN(balance)){alert("Invalid balance, aborting");return;}
  10. var stopAmount = parseFloat(stopAmount);
  11. var risk = prompt("How much risk you want to have? 1 - Low, 2 - Medium, 3 - High, 4 - Auto Mode", '1');
  12. if (risk != "1" && risk != "2" && risk != "3" && risk != "4"){
  13. alert("Invalid risk entered, aborting");
  14. return false;
  15. }
  16. if (risk == "1") {low();}
  17. else if (risk == "2"){medium();}
  18. else if (risk == "3"){high();}
  19. else {automode();}
  20. function medium() {
  21. if (balance < 0.00001)
  22. {
  23. var amount = document.getElementById("amount").value = "0.00000001";
  24. var chance = $.trim($("#editable-chance-field").val("2%"));
  25. var payout = document.getElementById('editable-payout').innerHTML = "49.5000";
  26. // var increase = document.getElementById('pourc-bet-on-lose').value = "2";
  27. // jQuery needed here:
  28. var increase = $.trim($("#pourc-bet-on-lose").val("2"));
  29. // First click the updated condition
  30. $('#updated_condition').click();
  31. // Wait 50 ms
  32. wait(50);
  33. $('#btn-bet-start-pilot-dice').click();
  34. var stoprollButton = document.getElementById("btn-bet-stop-pilot-dice").innerHTML = "Stop Bot";
  35. var startrollButton = document.getElementById("btn-bet-start-pilot-dice").innerHTML = "Start Bot";
  36. var timeout = setTimeout(function(){var profit = $('#auto_stats_profit').html(); var profit = parseFloat(profit);if (profit > stop){alert("You got your profit, enjoy");kill();}}, 1);
  37. }
  38. else if (balance < 0.0001 && balance > 0.00001){
  39. var amount = document.getElementById("amount").value = "0.00000005";
  40. var chance = $.trim($("#editable-chance-field").val("44%"));
  41. var payout = document.getElementById('editable-payout').innerHTML = "49.5000";
  42. // var increase = document.getElementById('pourc-bet-on-lose').value = "2";
  43. // jQuery needed here:
  44. var increase = $.trim($("#pourc-bet-on-lose").val("100"));
  45. // First click the updated condition
  46. $('#updated_condition').click();
  47. // Wait 50 ms
  48. wait(50);
  49. $('#btn-bet-start-pilot-dice').click();
  50. var stoprollButton = document.getElementById("btn-bet-stop-pilot-dice").innerHTML = "Stop Bot";
  51. var startrollButton = document.getElementById("btn-bet-start-pilot-dice").innerHTML = "Start Bot";
  52. var timeout = setTimeout(function(){var profit = $('#auto_stats_profit').html(); var profit = parseFloat(profit);if (profit > stop){alert("You got your profit, enjoy");kill();}}, 1);
  53. }
  54. else if (balance < 0.001 && balance > 0.0001) {
  55. var amount = document.getElementById("amount").value = "0.00000050";
  56. var chance = $.trim($("#editable-chance-field").val("44%"));
  57. var payout = document.getElementById('editable-payout').innerHTML = "49.5000";
  58. // var increase = document.getElementById('pourc-bet-on-lose').value = "2";
  59. // jQuery needed here:
  60. var increase = $.trim($("#pourc-bet-on-lose").val("100"));
  61. // First click the updated condition
  62. $('#updated_condition').click();
  63. // Wait 50 ms
  64. wait(50);
  65. $('#btn-bet-start-pilot-dice').click();
  66. var stoprollButton = document.getElementById("btn-bet-stop-pilot-dice").innerHTML = "Stop Bot";
  67. var startrollButton = document.getElementById("btn-bet-start-pilot-dice").innerHTML = "Start Bot";
  68. var timeout = setTimeout(function(){var profit = $('#auto_stats_profit').html(); var profit = parseFloat(profit);if (profit > stop){alert("You got your profit, enjoy");kill();}}, 1);
  69. }
  70. else if (balance < 0.01 && balance > 0.001) {
  71. var amount = document.getElementById("amount").value = "0.00000500";
  72. var chance = $.trim($("#editable-chance-field").val("44%"));
  73. var payout = document.getElementById('editable-payout').innerHTML = "49.5000";
  74. // var increase = document.getElementById('pourc-bet-on-lose').value = "2";
  75. // jQuery needed here:
  76. var increase = $.trim($("#pourc-bet-on-lose").val("100"));
  77. // First click the updated condition
  78. $('#updated_condition').click();
  79. // Wait 50 ms
  80. wait(50);
  81. $('#btn-bet-start-pilot-dice').click();
  82. var stoprollButton = document.getElementById("btn-bet-stop-pilot-dice").innerHTML = "Stop Bot";
  83. var startrollButton = document.getElementById("btn-bet-start-pilot-dice").innerHTML = "Start Bot";
  84. var timeout = setTimeout(function(){var profit = $('#auto_stats_profit').html(); var profit = parseFloat(profit);if (profit > stop){alert("You got your profit, enjoy");kill();}}, 1);
  85. }
  86. else if (balance < 0.1 && balance > 0.01) {
  87. var amount = document.getElementById("amount").value = "0.00001096";
  88. var chance = $.trim($("#editable-chance-field").val("44%"));
  89. var payout = document.getElementById('editable-payout').innerHTML = "49.5000";
  90. // var increase = document.getElementById('pourc-bet-on-lose').value = "2";
  91. // jQuery needed here:
  92. var increase = $.trim($("#pourc-bet-on-lose").val("100"));
  93. // First click the updated condition
  94. $('#updated_condition').click();
  95. // Wait 50 ms
  96. wait(50);
  97. $('#btn-bet-start-pilot-dice').click();
  98. var stoprollButton = document.getElementById("btn-bet-stop-pilot-dice").innerHTML = "Stop Bot";
  99. var startrollButton = document.getElementById("btn-bet-start-pilot-dice").innerHTML = "Start Bot";
  100. var timeout = setTimeout(function(){var profit = $('#auto_stats_profit').html(); var profit = parseFloat(profit);if (profit > stopAmount){alert("You got your profit, enjoy");kill();}}, 1);
  101. }
  102. else if (balance > 0.1) {
  103. var amount = document.getElementById("amount").value = "0.00002500";
  104. var chance = $.trim($("#editable-chance-field").val("0.99%"));
  105. var payout = document.getElementById('editable-payout').innerHTML = "49.5000";
  106. // var increase = document.getElementById('pourc-bet-on-lose').value = "2";
  107. // jQuery needed here:
  108. var increase = $.trim($("#pourc-bet-on-lose").val("1.5"));
  109. // First click the updated condition
  110. $('#updated_condition').click();
  111. // Wait 50 ms
  112. wait(50);
  113. $('#btn-bet-start-pilot-dice').click();
  114. var stoprollButton = document.getElementById("btn-bet-stop-pilot-dice").innerHTML = "Stop Bot";
  115. var startrollButton = document.getElementById("btn-bet-start-pilot-dice").innerHTML = "Start Bot";
  116. var stopout = setTimeout(function(){var profit = $('#auto_stats_profit').html(); var profit = parseFloat(profit);if (profit < minus){alert("You got your profit, enjoy");kill();}}, 1);
  117. var timeout = setTimeout(function(){var profit = $('#auto_stats_profit').html(); var profit = parseFloat(profit);if (profit > stop){alert("You got your profit, enjoy");kill();}}, 1);
  118. }
  119. var stopout = setTimeout(function(){var profit = $('#auto_stats_profit').html(); var profit = parseFloat(profit);if (profit < minus){alert("You got your profit, enjoy");kill();}}, 1);
  120. }
  121. function wait(ms){
  122. var start = new Date().getTime();
  123. var end = start;
  124. while(end < start + ms) {
  125. end = new Date().getTime();
  126. }
  127. }
  128. function high() {
  129. if (balance < 0.00001)
  130. {
  131. var amount = document.getElementById("amount").value = "0.00000005";
  132. var chance = $.trim($("#editable-chance-field").val("39.5%"));
  133. var payout = document.getElementById('editable-payout').innerHTML = "49.5000";
  134. // var increase = document.getElementById('pourc-bet-on-lose').value = "2";
  135. // jQuery needed here:
  136. var increase = $.trim($("#pourc-bet-on-lose").val("5"));
  137. // First click the updated condition
  138. $('#updated_condition').click();
  139. // Wait 50 ms
  140. wait(50);
  141. $('#btn-bet-start-pilot-dice').click();
  142. var stoprollButton = document.getElementById("btn-bet-stop-pilot-dice").innerHTML = "Stop Bot";
  143. var startrollButton = document.getElementById("btn-bet-start-pilot-dice").innerHTML = "Start Bot";
  144. }
  145. else if (balance < 0.0001 && balance > 0.00001){
  146. var amount = document.getElementById("amount").value = "0.00000010";
  147. var chance = $.trim($("#editable-chance-field").val("20%"));
  148. var payout = document.getElementById('editable-payout').innerHTML = "49.5000";
  149. // var increase = document.getElementById('pourc-bet-on-lose').value = "2";
  150. // jQuery needed here:
  151. var increase = $.trim($("#pourc-bet-on-lose").val("20"));
  152. // First click the updated condition
  153. $('#updated_condition').click();
  154. // Tick increase on win button
  155. $('#id-bet-on-win').click();
  156. var increase = $.trim($("#pourc-bet-on-win").val("0"));
  157. // Wait 50 ms
  158. wait(50);
  159. $('#btn-bet-start-pilot-dice').click();
  160. var stoprollButton = document.getElementById("btn-bet-stop-pilot-dice").innerHTML = "Stop Bot";
  161. var startrollButton = document.getElementById("btn-bet-start-pilot-dice").innerHTML = "Start Bot";
  162. }
  163. else if (balance < 0.001 && balance > 0.0001) {
  164. var amount = document.getElementById("amount").value = "0.000000100";
  165. var chance = $.trim($("#editable-chance-field").val("29.12%"));
  166. var payout = document.getElementById('editable-payout').innerHTML = "49.5000";
  167. // var increase = document.getElementById('pourc-bet-on-lose').value = "2";
  168. // jQuery needed here:
  169. var increase = $.trim($("#pourc-bet-on-lose").val("1.6"));
  170. // First click the updated condition
  171. $('#updated_condition').click();
  172. // Wait 50 ms
  173. wait(50);
  174. $('#btn-bet-start-pilot-dice').click();
  175. var stoprollButton = document.getElementById("btn-bet-stop-pilot-dice").innerHTML = "Stop Bot";
  176. var startrollButton = document.getElementById("btn-bet-start-pilot-dice").innerHTML = "Start Bot";
  177. }
  178. else if (balance < 0.01 && balance > 0.001) {
  179. var amount = document.getElementById("amount").value = "0.00000015";
  180. var chance = $.trim($("#editable-chance-field").val("29.73%"));
  181. var payout = document.getElementById('editable-payout').innerHTML = "49.5000";
  182. // var increase = document.getElementById('pourc-bet-on-lose').value = "2";
  183. // jQuery needed here:
  184. var increase = $.trim($("#pourc-bet-on-lose").val("50"));
  185. // First click the updated condition
  186. $('#updated_condition').click();
  187. // Wait 50 ms
  188. wait(50);
  189. $('#btn-bet-start-pilot-dice').click();
  190. var stoprollButton = document.getElementById("btn-bet-stop-pilot-dice").innerHTML = "Stop Bot";
  191. var startrollButton = document.getElementById("btn-bet-start-pilot-dice").innerHTML = "Start Bot";
  192. }
  193. else if (balance < 0.1 && balance > 0.01) {
  194. var amount = document.getElementById("amount").value = "0.00000100";
  195. var chance = $.trim($("#editable-chance-field").val("34,66%"));
  196. var payout = document.getElementById('editable-payout').innerHTML = "49.5000";
  197. // var increase = document.getElementById('pourc-bet-on-lose').value = "2";
  198. // jQuery needed here:
  199. var increase = $.trim($("#pourc-bet-on-lose").val("50"));
  200. // First click the updated condition
  201. $('#updated_condition').click();
  202. // Wait 50 ms
  203. wait(50);
  204. $('#btn-bet-start-pilot-dice').click();
  205. var stoprollButton = document.getElementById("btn-bet-stop-pilot-dice").innerHTML = "Stop Bot";
  206. var startrollButton = document.getElementById("btn-bet-start-pilot-dice").innerHTML = "Start Bot";
  207. }
  208. else if (balance > 0.1) {
  209. var amount = document.getElementById("amount").value = "0.001000";
  210. var chance = $.trim($("#editable-chance-field").val("34.66%"));
  211. var payout = document.getElementById('editable-payout').innerHTML = "49.5000";
  212. // var increase = document.getElementById('pourc-bet-on-lose').value = "2";
  213. // jQuery needed here:
  214. var increase = $.trim($("#pourc-bet-on-lose").val("86"));
  215. // First click the updated condition
  216. $('#updated_condition').click();
  217. // Wait 50 ms
  218. wait(50);
  219. $('#btn-bet-start-pilot-dice').click();
  220. var stoprollButton = document.getElementById("btn-bet-stop-pilot-dice").innerHTML = "Stop Bot";
  221. var startrollButton = document.getElementById("btn-bet-start-pilot-dice").innerHTML = "Start Bot";
  222. }
  223. var stopout = setTimeout(function(){var profit = $('#auto_stats_profit').html(); var profit = parseFloat(profit);if (profit < minus){alert("You got your profit, enjoy");kill();}}, 1);
  224. var timeout = setTimeout(function(){var profit = $('#auto_stats_profit').html(); var profit = parseFloat(profit);if (profit > stop){alert("You got your profit, enjoy");kill();}}, 1);
  225. }
  226. function low() {
  227. if (balance < 0.00001)
  228. {
  229. var amount = document.getElementById("amount").value = "0.00000002";
  230. var chance = $.trim($("#editable-chance-field").val("8%"));
  231. var payout = document.getElementById('editable-payout').innerHTML = "49.5000";
  232. // var increase = document.getElementById('pourc-bet-on-lose').value = "2";
  233. // jQuery needed here:
  234. var increase = $.trim($("#pourc-bet-on-lose").val("10"));
  235. // First click the updated condition
  236. $('#updated_condition').click();
  237. // Wait 50 ms
  238. wait(50);
  239. $('#btn-bet-start-pilot-dice').click();
  240. var stoprollButton = document.getElementById("btn-bet-stop-pilot-dice").innerHTML = "Stop Bot";
  241. var startrollButton = document.getElementById("btn-bet-start-pilot-dice").innerHTML = "Start Bot";
  242. }
  243. else if (balance < 0.0001 && balance > 0.00001){
  244. var amount = document.getElementById("amount").value = "0.00000005";
  245. var chance = $.trim($("#editable-chance-field").val("10%"));
  246. var payout = document.getElementById('editable-payout').innerHTML = "49.5000";
  247. // var increase = document.getElementById('pourc-bet-on-lose').value = "2";
  248. // jQuery needed here:
  249. var increase = $.trim($("#pourc-bet-on-lose").val("10"));
  250. // First click the updated condition
  251. $('#updated_condition').click();
  252. // Wait 50 ms
  253. wait(50);
  254. $('#btn-bet-start-pilot-dice').click();
  255. var stoprollButton = document.getElementById("btn-bet-stop-pilot-dice").innerHTML = "Stop Bot";
  256. var startrollButton = document.getElementById("btn-bet-start-pilot-dice").innerHTML = "Start Bot";
  257. }
  258. else if (balance < 0.001 && balance > 0.0001) {
  259. var amount = document.getElementById("amount").value = "0.00000001";
  260. var chance = $.trim($("#editable-chance-field").val("9.90%"));
  261. var payout = document.getElementById('editable-payout').innerHTML = "49.5000";
  262. // var increase = document.getElementById('pourc-bet-on-lose').value = "2";
  263. // jQuery needed here:
  264. var increase = $.trim($("#pourc-bet-on-lose").val("11"));
  265. // First click the updated condition
  266. $('#updated_condition').click();
  267. // Wait 50 ms
  268. wait(50);
  269. $('#btn-bet-start-pilot-dice').click();
  270. var stoprollButton = document.getElementById("btn-bet-stop-pilot-dice").innerHTML = "Stop Bot";
  271. var startrollButton = document.getElementById("btn-bet-start-pilot-dice").innerHTML = "Start Bot";
  272. }
  273. else if (balance < 0.01 && balance > 0.001) {
  274. var amount = document.getElementById("amount").value = "0.00000005";
  275. var chance = $.trim($("#editable-chance-field").val("0.99%"));
  276. var payout = document.getElementById('editable-payout').innerHTML = "49.5000";
  277. // var increase = document.getElementById('pourc-bet-on-lose').value = "2";
  278. // jQuery needed here:
  279. var increase = $.trim($("#pourc-bet-on-lose").val("76"));
  280. // First click the updated condition
  281. $('#updated_condition').click();
  282. // Wait 50 ms
  283. wait(50);
  284. $('#btn-bet-start-pilot-dice').click();
  285. var stoprollButton = document.getElementById("btn-bet-stop-pilot-dice").innerHTML = "Stop Bot";
  286. var startrollButton = document.getElementById("btn-bet-start-pilot-dice").innerHTML = "Start Bot";
  287. }
  288. else if (balance < 0.1 && balance > 0.01) {
  289. var amount = document.getElementById("amount").value = "0.00000050";
  290. var chance = $.trim($("#editable-chance-field").val("0.99%"));
  291. var payout = document.getElementById('editable-payout').innerHTML = "49.5000";
  292. // var increase = document.getElementById('pourc-bet-on-lose').value = "2";
  293. // jQuery needed here:
  294. var increase = $.trim($("#pourc-bet-on-lose").val("1.5"));
  295. // First click the updated condition
  296. $('#updated_condition').click();
  297. // Wait 50 ms
  298. wait(50);
  299. $('#btn-bet-start-pilot-dice').click();
  300. var stoprollButton = document.getElementById("btn-bet-stop-pilot-dice").innerHTML = "Stop Bot";
  301. var startrollButton = document.getElementById("btn-bet-start-pilot-dice").innerHTML = "Start Bot";
  302. }
  303. else if (balance > 0.1) {
  304. var amount = document.getElementById("amount").value = "0.00001000";
  305. var chance = $.trim($("#editable-chance-field").val("0.99%"));
  306. var payout = document.getElementById('editable-payout').innerHTML = "49.5000";
  307. // var increase = document.getElementById('pourc-bet-on-lose').value = "2";
  308. // jQuery needed here:
  309. var increase = $.trim($("#pourc-bet-on-lose").val("1.5"));
  310. // First click the updated condition
  311. $('#updated_condition').click();
  312. // Wait 50 ms
  313. wait(50);
  314. $('#btn-bet-start-pilot-dice').click();
  315. var stoprollButton = document.getElementById("btn-bet-stop-pilot-dice").innerHTML = "Stop Bot";
  316. var startrollButton = document.getElementById("btn-bet-start-pilot-dice").innerHTML = "Start Bot";
  317. }
  318. var stopout = setTimeout(function(){var profit = $('#auto_stats_profit').html(); var profit = parseFloat(profit);if (profit < minus){alert("You got your profit, enjoy");kill();}}, 1);
  319. var timeout = setTimeout(function(){var profit = $('#auto_stats_profit').html(); var profit = parseFloat(profit);if (profit > stop){alert("You got your lose, try again:)");kill();}}, 1);
  320. }
  321. function kill(){
  322. var stopBot = $('#btn-bet-stop-pilot-dice').click();
  323. var startBot = $('#btn-bet-start-pilot-dice').click();
  324. var stopout = setTimeout(function(){var profit = $('#auto_stats_profit').html(); var profit = parseFloat(profit);if (profit < minus){alert("You got your profit, enjoy");kill();}}, 1);
  325. var timeout = setTimeout(function(){var profit = $('#auto_stats_profit').html(); var profit = parseFloat(profit);if (profit > stop){alert("You got your lose, try again:)");kill();}}, 1);
  326. }
  327. function automode() {
  328. // Here is the new method published in version 1.2
  329. var risk1 = prompt("What's your automode risk? 1 - Low, 2 - Medium, 3 - High", '1');
  330. if (risk1 != "1" && risk1 != "2" && risk1 != "3"){
  331. alert("Invalid automode risk, aborting");
  332. return false;
  333. }
  334. if (risk1 == "1")automode_low();
  335. else if (risk1 == "2")automode_medium();
  336. else automode_high();
  337. }
  338. function automode_low() {
  339. var amount = document.getElementById("amount").value = "0.00000001";
  340. var chance = $.trim($("#editable-chance-field").val("49.5%"));
  341. //var payout = document.getElementById('editable-payout').innerHTML = "49.5000";
  342. // var increase = document.getElementById('pourc-bet-on-lose').value = "2";
  343. // jQuery needed here:
  344. var increase = $.trim($("#pourc-bet-on-lose").val("100"));
  345. // First click the updated condition
  346. $('#updated_condition').click();
  347. $('#btn-bet-start-pilot-dice').click();
  348. var stoprollButton = document.getElementById("btn-bet-stop-pilot-dice").innerHTML = "Stop Bot";
  349. var startrollButton = document.getElementById("btn-bet-start-pilot-dice").innerHTML = "Start Bot";
  350. }
  351. function automode_high() {
  352. var amount = document.getElementById("amount").value = "0.00000001";
  353. var chance = $.trim($("#editable-chance-field").val("49.5%"));
  354. //var payout = document.getElementById('editable-payout').innerHTML = "49.5000";
  355. // var increase = document.getElementById('pourc-bet-on-lose').value = "2";
  356. // jQuery needed here:
  357. var increase = $.trim($("#pourc-bet-on-lose").val("300"));
  358. // First click the updated condition
  359. $('#updated_condition').click();
  360. $('#btn-bet-start-pilot-dice').click();
  361. var stoprollButton = document.getElementById("btn-bet-stop-pilot-dice").innerHTML = "Stop Bot";
  362. var startrollButton = document.getElementById("btn-bet-start-pilot-dice").innerHTML = "Start Bot";
  363. }
  364. function automode_medium() {
  365. var amount = document.getElementById("amount").value = "0.00000001";
  366. var chance = $.trim($("#editable-chance-field").val("49.5%"));
  367. //var payout = document.getElementById('editable-payout').innerHTML = "49.5000";
  368. // var increase = document.getElementById('pourc-bet-on-lose').value = "2";
  369. // jQuery needed here:
  370. var increase = $.trim($("#pourc-bet-on-lose").val("200"));
  371. // First click the updated condition
  372. $('#updated_condition').click();
  373. $('#btn-bet-start-pilot-dice').click();
  374. var stoprollButton = document.getElementById("btn-bet-stop-pilot-dice").innerHTML = "Stop Bot";
  375. var startrollButton = document.getElementById("btn-bet-start-pilot-dice").innerHTML = "Start Bot";
  376. }
  377. function doubleamount() {
  378. var attr = $(this).attr("rel");
  379. var amount = parseFloat($("#amount" + attr).val());
  380. amount = round_float(amount * 2, devise_decimal);
  381. $("#amount" + attr).val(amount);
  382. window['var_amount' + attr] = amount;
  383. calculate_profit();
  384. }
  385. })();
  386. // This is the modified bitsler play function
  387. var stopAmount = prompt("Type in the amount after you want to stop", '0.0001');
  388. var again = prompt("Type in 1 if you want to start the bot automatically after getting the profit and 2 for no", '1');
  389. if (isNaN(stopAmount) || stopAmount == null){alert("Invalid Profit after to Stop, aborting");}
  390. function play() {
  391. if (game_in_progress == true) {
  392. $("#btn-bet-dice, #btn-bet-start-pilot-dice, #btn-bet-start-fast-dice").button("reset");
  393. return false;
  394. }
  395. game_in_progress = true;
  396. if (autobet_mode == false) {
  397. var amount = $("#amount").val();
  398. var condition = $("#condition-input").val();
  399. var game = $("#game-input").val();
  400. }
  401. else {
  402. var amount = auto_amount;
  403. var condition = auto_condition;
  404. var game = auto_game;
  405. }
  406. amount = round_float(amount, devise_decimal);
  407. var profit = parseFloat($("#profit").val());
  408. var balance = parseFloat($("#balance-"+devise).val());
  409. var error = false;
  410. var error_value = "";
  411. var error_title = "";
  412. var error_info = "";
  413. if (auto_stats_profit > stopAmount) {
  414. if (again == "2"){
  415. error_title = "Got your profit";
  416. error_info = "You got the profit you want!";
  417. error_value = "Play again or have a nice day (clasher.7526@gmail.com) Christian";
  418. error = true;}
  419. else {
  420. roll_by_condition();
  421. $('#btn-bet-stop-pilot-dice').click();
  422. $('#btn-bet-start-pilot-dice').click();
  423. }
  424. }
  425. else if (amount > balance) {
  426. error_title = "Bet amount";
  427. error_info = "Maximum bet: "+number_format(balance, devise_decimal);
  428. error_value = "Bet amount - Maximum bet: "+number_format(balance, devise_decimal);
  429. error = true;
  430. }
  431. else if (amount > bet_max) {
  432. error_title = "Bet amount";
  433. error_info = "Maximum bet: "+number_format(bet_max, devise_decimal);
  434. error_value = "Bet amount - Maximum bet: "+number_format(bet_max, devise_decimal);
  435. error = true;
  436. }
  437. else if (amount < bet_min) {
  438. error_title = "Bet amount";
  439. error_info = "Minimum bet: "+number_format(bet_min, devise_decimal);
  440. error_value = "Bet amount - Minimum bet: "+number_format(bet_min, devise_decimal);
  441. error = true;
  442. }
  443. if (error == true) {
  444. game_in_progress = false;
  445. $("#btn-bet-dice, #btn-bet-start-pilot-dice, #btn-bet-start-fast-dice").button("reset");
  446. if (autobet_mode == true) {
  447. if (number_bet_done >= 1) {
  448. $("#modal-stop-autobet-numbers").html(number_bet_done);
  449. $("#modal-stop-autobet-value").html(error_value);
  450. $("#modal-stop-autobet-reason").modal("show");
  451. }
  452. else {
  453. showErrorNotification(error_title, error_info);
  454. }
  455. stop_pilot_mode();
  456. }
  457. else {
  458. showErrorNotification(error_title, error_info);
  459. }
  460. return;
  461. }
  462. $.ajax({
  463. type: "POST",
  464. url: server_front_name+"/api/bet",
  465. data: {
  466. access_token : access_token,
  467. username : user_username,
  468. type : "dice",
  469. amount : amount,
  470. condition : condition,
  471. game : game,
  472. devise : devise
  473. },
  474. success: function(text) {
  475. var val = JSON.parse(text);
  476. if (val.return.success == 'true') {
  477. bet_nb_errors = 0;
  478. var username = val.return.username;
  479. var id = val.return.id;
  480. var type = val.return.type;
  481. var devise = val.return.devise;
  482. var ts = val.return.ts;
  483. var time = val.return.time;
  484. var winning_chance = val.return.winning_chance;
  485. var roll_number = val.return.roll_number;
  486. var amount_return = val.return.amount_return;
  487. var new_balance = val.return.new_balance;
  488. var show = val.return.show;
  489. var amount = val.return.amount;
  490. var condition = val.return.condition;
  491. var game = val.return.game;
  492. var payout = val.return.payout;
  493. $("#won-bet span").html(amount_return);
  494. $("#won-bet span").removeClass("text-danger text-success");
  495. if (amount_return >= 0) {
  496. $("#won-bet span").addClass("text-success");
  497. $("#won-bet span").html("+"+number_format(round_float(amount_return, 8), 8));
  498. }
  499. else {
  500. $("#won-bet span").addClass("text-danger");
  501. $("#won-bet span").html(number_format(round_float(amount_return, 8), 8));
  502. }
  503. show_result_bet();
  504. $("#balance-"+devise).val(round_float(new_balance, 12));
  505. if (amount_return >= 0)
  506. $(".balance-"+devise+"-html").addClass("result-bet-win");
  507. else
  508. $(".balance-"+devise+"-html").addClass("result-bet-lose");
  509. $(".balance-"+devise+"-html").html(round_float(new_balance, 8));
  510. if (amount_return >= 0)
  511. setTimeout(function() { $(".balance-"+devise+"-html").removeClass("result-bet-win"); }, 350);
  512. else
  513. setTimeout(function() { $(".balance-"+devise+"-html").removeClass("result-bet-lose"); }, 350);
  514. addBetHistory("my-bets", type, id, username, time, amount, devise, winning_chance, roll_number, amount_return, condition, game, payout);
  515. var notifications = val.return.notifications;
  516. for (var prop in notifications) {
  517. if (notifications[prop].name == "rcvJackpotDice")
  518. rcvJackpotDice(notifications[prop]);
  519. else {
  520. rcvnotificationbet(notifications[prop]);
  521. }
  522. }
  523. var time_delay = getTimeDelay(amount, devise, "dice");
  524. if (autobet_mode == false) {
  525. setTimeout(function() {
  526. $("#btn-bet-dice, #btn-bet-start-pilot-dice, #btn-bet-start-fast-dice").button("reset");
  527. }, time_delay);
  528. }
  529. else {
  530. number_bet_done++;
  531. if (unlimited_bet == false) {
  532. number_rolls--;
  533. $("#limit-rolls-input").val(number_rolls);
  534. var pourcBarre = ((number_rolls_total-number_rolls)/number_rolls_total)*100;
  535. $("#progress-bar-pilot-mode div").css("width", pourcBarre+"%");
  536. }
  537. if (amount_return >= 0) {
  538. auto_stats_won++;
  539. }
  540. else {
  541. auto_stats_lost++;
  542. }
  543. auto_stats_lucky = ((((parseInt(auto_stats_won)/parseInt(number_bet_done))*100)/parseFloat(winning_chance))*100).toFixed(2);
  544. auto_stats_wagered = parseFloat(auto_stats_wagered)+parseFloat(amount);
  545. auto_stats_profit = parseFloat(auto_stats_profit)+parseFloat(amount_return);
  546. if (on_win == "id-bet-win" && amount_return >= 0) {
  547. auto_amount = parseFloat(auto_amount)+parseFloat(auto_amount*(pourc_on_win/100));
  548. }
  549. else if (amount_return >= 0) {
  550. auto_amount = auto_amount_var;
  551. }
  552. if (on_lose == "id-bet-lose" && amount_return < 0) {
  553. auto_amount = parseFloat(auto_amount)+parseFloat(auto_amount*(pourc_on_lose/100));
  554. }
  555. else if (amount_return < 0) {
  556. auto_amount = auto_amount_var;
  557. }
  558. var tmp = Math.pow(10, 8);
  559. auto_amount = Math.round(auto_amount*tmp)/tmp;
  560. update_stats_auto();
  561. if ((number_bet_done < number_rolls_total) || unlimited_bet == true) {
  562. var speed_bet_val = $("#speed-bet").val();
  563. var time_by_bet = parseInt(time_delay/50);
  564. if (autobet_stop == false) {
  565. setTimeout(function() { play(); }, time_by_bet);
  566. }
  567. else {
  568. stop_pilot_mode();
  569. }
  570. }
  571. else {
  572. stop_pilot_mode();
  573. }
  574. }
  575. game_in_progress = false;
  576. if (val.return.event == true) {
  577. socket.emit("event", {});
  578. }
  579. }
  580. else {
  581. game_in_progress = false;
  582. if (val.return.type != "abort") {
  583. if (autobet_mode == false) {
  584. showErrorNotification(val.return.value, val.return.info);
  585. $("#btn-bet-dice, #btn-bet-start-pilot-dice, #btn-bet-start-fast-dice").button("reset");
  586. }
  587. else {
  588. if (number_bet_done >= 1) {
  589. $("#modal-stop-autobet-numbers").html(number_bet_done);
  590. $("#modal-stop-autobet-value").html(val.return.value);
  591. $("#modal-stop-autobet-reason").modal("show");
  592. }
  593. else {
  594. showErrorNotification(val.return.value, val.return.info);
  595. }
  596. stop_pilot_mode();
  597. }
  598. }
  599. else {
  600. if (bet_nb_errors >= 2) {
  601. bet_nb_errors = 0;
  602. if (autobet_mode == false) {
  603. showErrorNotification(val.return.value, val.return.info);
  604. $("#btn-bet-dice, #btn-bet-start-pilot-dice, #btn-bet-start-fast-dice").button("reset");
  605. }
  606. else {
  607. if (number_bet_done >= 1) {
  608. $("#modal-stop-autobet-numbers").html(number_bet_done);
  609. $("#modal-stop-autobet-value").html(val.return.value);
  610. $("#modal-stop-autobet-reason").modal("show");
  611. }
  612. else {
  613. showErrorNotification(val.return.value, val.return.info);
  614. }
  615. stop_pilot_mode();
  616. }
  617. }
  618. else {
  619. bet_nb_errors++;
  620. setTimeout(function() { play(); }, 1000);
  621. }
  622. }
  623. }
  624. },
  625. error: function (xhr, ajaxOptions, thrownError) {game_in_progress = false;setTimeout(function() { play(); }, 1000);},
  626. timeout: function (xhr, ajaxOptions, thrownError) {game_in_progress = false;setTimeout(function() { play(); }, 1000);},
  627. abort: function (xhr, ajaxOptions, thrownError) {game_in_progress = false;setTimeout(function() { play(); }, 1000);}
  628. });
  629. }

comments powered by Disqus