Johnynguyen277

Bitsler bot V1.4.5

Aug 15th, 2018
1,211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.19 KB | None | 0 0
  1. //#######################################################################################################
  2. //
  3. // [BITSLER BOT V1.4.5] by Vijay
  4. //
  5. // changelog v1.4.5:
  6. // - remove bet speed [input] {prevent bugs on betting}
  7. // - add low balance mode [beta]
  8. // - add draggable box
  9. // - add timer [control of betting time]
  10. // - add interface draggeable
  11. //
  12. // changelog v1.4:
  13. // - add restart on profit [checkbox]
  14. // - add betting speed [input]
  15. // - add change bet mode after 'x' number of loses
  16. // - add win & lose counter
  17. //
  18. // changelog v1.3:
  19. // - add doble your bet on lose [checkbox]
  20. // - fix errors on betting
  21. //
  22. // changelog v1.2:
  23. // - seprate stop profit - stake
  24. //
  25. // changelog v1.1:
  26. // - add option "restart bet on stake"
  27. // - fix stake and profit calculation
  28. //
  29. // changelog v1.0:
  30. // - start or stop button
  31. // - chance % change
  32. // - hi or lo betting
  33. // - zigzag betting
  34. // - profit or stake limitation
  35. // - user interface
  36. // - auto change seeds
  37. // - increase bet on lose
  38. //
  39. //#######################################################################################################
  40.  
  41.  
  42. var _bet, _chance, _onlost, _mode, _auto, _stopprofit, _stopstake, _start = false, _stake, _profit, _betting, _task, _seeds, _restart, _restart2, _double, _first,_betspeed = 1000, gamelose = 0, gamewin = 0, con = 0, _consecutive;
  43.  
  44.  
  45. var style = `<style>
  46. .boxDice {
  47. margin-top:3px;
  48. padding-bottom: 5px;
  49. width: 327.5px;
  50. background-color: #2e323b;
  51. color: whitesmoke;
  52. font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  53. z-index: 10;
  54. position:absolute;
  55. top:0;
  56. right:0;
  57. }
  58.  
  59. .boxTitle {
  60. text-align: center;
  61. padding: 8px 8px 5px 8px;
  62. font-weight: bold;
  63. border-bottom: solid #181a1e;
  64. }
  65.  
  66. .boxScon {
  67. text-align: center;
  68. padding: 10px 8px 5px 8px;
  69. border-bottom: solid #181a1e;
  70. }
  71.  
  72. .boxStatus {
  73. padding: 5px 0;
  74. background-color: #101215;
  75. width: 100%;
  76. font-size: 12.5px !important;
  77. border: 0;
  78. color: white;
  79. text-transform: uppercase;
  80. text-align: center;
  81. }
  82.  
  83. .boxTDtitle {
  84. padding: 3px;
  85. color: whitesmoke;
  86. text-align: center;
  87. font-size: 11px;
  88. }
  89.  
  90. .boxTDinput {
  91. padding: 3px;
  92. background-color: #101215;
  93. width: 97%;
  94. border: 0;
  95. color: white !important;
  96. margin: 2px 0;
  97. }
  98.  
  99. .boxDS {
  100. width: 200px;
  101. }
  102.  
  103. .boxWinLose {
  104. padding: 6px;
  105. text-align: center;
  106. font-size: 11px !important;
  107. }
  108.  
  109. .boxWLinput{
  110. padding:3px;
  111. text-align: center;
  112. background-color:#2e323b !important;
  113. width:97%;
  114. border:0;
  115. margin:3px 0;
  116. }
  117. .boxWin{ color: greenyellow !important; }
  118. .boxLose{ color: red !important; }
  119. .boxBalance{ color: white !important; font-size: 9.5px !important; }
  120.  
  121. .boxButton{
  122. width:97%;
  123. background-color: #101215;
  124. border: none;
  125. color: white;
  126. padding: 7px 15px;
  127. text-align: center;
  128. text-decoration: none;
  129. display: inline-block;
  130. font-size: 13px;
  131. }
  132. .timerBetting{
  133. float:right !important;
  134. font-size: 10px !important;
  135. color: yellow !important;
  136. }
  137. </style>`;
  138. var html = `<div class="boxDice">
  139. <table width="100%" border="0" cellspacing="0" cellpadding="5">
  140. <div class="boxTitle" id="isDynamic">BITSLER DICE v1.4.5
  141. <span id="timerBetting" class="timerBetting">00:00</span>
  142. </div>
  143. <div class="boxScon">
  144. <input class="boxStatus" type="text" id="_status" readonly="true">
  145. </div>
  146. <tbody>
  147. <tr>
  148. <td class="boxTDtitle">CHANCE</td>
  149. <td class="boxDS"><input class="boxTDinput" type="text" id="_chance" value="49.5"></td>
  150. </tr>
  151. <tr>
  152. <td class="boxTDtitle">INCREASE ON LOST [%]</td>
  153. <td class="boxDS"> <input class="boxTDinput" type="text" id="_onlost" value="0"></td>
  154. </tr>
  155. <tr>
  156. <td class="boxTDtitle">CHANGE BET MODE AFTER C/L</td>
  157. <td class="boxDS"><input class="boxTDinput" type="text" id="_consecutive" value="0"></td>
  158. </tr>
  159. <tr>
  160. <td class="boxTDtitle">BET MODE</td>
  161. <td class="boxDS"><input class="boxTDinput" type="text" id="_mode" placeholder="h | l | z | low"></td>
  162. </tr>
  163. <tr>
  164. <td class="boxTDtitle">BET AMOUNT</td>
  165. <td class="boxDS"><input class="boxTDinput" type="text" id="_bet" value=""></td>
  166. </tr>
  167. <tr>
  168. <td class="boxTDtitle">PROFIT</td>
  169. <td class="boxDS"><input class="boxTDinput" type="text" id="_profit" value=""></td>
  170. </tr>
  171. <tr>
  172. <td class="boxTDtitle">STAKE</td>
  173. <td class="boxDS"><input class="boxTDinput" type="text" id="_stake" value="0.00001024"></td>
  174. </tr>
  175. <tr>
  176. <td class="boxTDtitle">DOUBLE BET ON LOST </td>
  177. <td class="boxDS"><input class="boxTDinput" type="checkbox" id="_double"></td>
  178. </tr>
  179. <tr>
  180. <td class="boxTDtitle">STOP ON STAKE </td>
  181. <td class="boxDS"><input class="boxTDinput" type="checkbox" id="_stopstake"></td>
  182. </tr>
  183. <tr>
  184. <td class="boxTDtitle">STOP ON PROFIT </td>
  185. <td class="boxDS"><input class="boxTDinput" type="checkbox" id="_stopprofit"></td>
  186. </tr>
  187. <tr>
  188. <td class="boxTDtitle">RESTART BET ON STAKE</td>
  189. <td class="boxDS"><input class="boxTDinput" type="checkbox" id="_restart"></td>
  190. </tr>
  191. <tr>
  192. <td class="boxTDtitle">RESTART BET ON PROFIT</td>
  193. <td class="boxDS"><input class="boxTDinput" type="checkbox" id="_restart2"></td>
  194. </tr>
  195. <tr>
  196. <td class="boxTDtitle">AUTO CHANGE SEED</td>
  197. <td class="boxDS"><input class="boxTDinput" type="checkbox" id="_auto"></td>
  198. </tr>
  199. <tr>
  200. <td class="boxWinLose">
  201. <input id="gamewin" class="boxWLinput boxWin" type="text" readonly="true" value="0">
  202. </td>
  203. <td class="boxWinLose">
  204. <input id="gamelose" class="boxWLinput boxLose" type="text" readonly="true" value="0">
  205. </td>
  206. </tr>
  207. <tr>
  208. <td><input id="bl_update" class="boxWLinput boxBalance" type="text" readonly="true" value="0"></td>
  209. <td><button onclick="startDice();return false;" id="_start" class="boxButton"> START </button></td>
  210. </tr>
  211. </tbody>
  212. </table>
  213. </div>`;
  214.  
  215. $('head').append(style);
  216. $('body').append(html);
  217.  
  218. $('#_bet').val(bet_min.toFixed(devise_decimal));
  219. $('#_profit').val(bet_max.toFixed(devise_decimal));
  220.  
  221. // DRAG BOX
  222. var box_position, offsetBox = [0,0], isDrag = false, source, dynamic;
  223. source = document.getElementsByClassName('boxDice')[0];
  224. dynamic = document.getElementById('isDynamic');
  225.  
  226. dynamic.addEventListener('mousedown', function(e) {
  227. isDrag = true;
  228. offsetBox = [
  229. source.offsetLeft - e.clientX,
  230. source.offsetTop - e.clientY
  231. ];
  232.  
  233. }, true);
  234.  
  235. document.addEventListener('mouseup', function() {
  236. isDrag = false;
  237. }, true);
  238.  
  239. document.addEventListener('mousemove', function(event) {
  240. //event.preventDefault();
  241. if (isDrag) {
  242. box_position = {
  243. x : event.clientX,
  244. y : event.clientY
  245. };
  246.  
  247. source.style.left = (box_position.x + offsetBox[0]) + 'px';
  248. source.style.top = (box_position.y + offsetBox[1]) + 'px';
  249. }
  250. }, true);
  251. //
  252.  
  253. // Timer
  254. var timerTask, totalSeconds = 0, timerBox = document.querySelector('#timerBetting');
  255.  
  256. function setTime() {
  257. ++totalSeconds;
  258. timerBox.textContent = pad(parseInt(totalSeconds / 60)) + ':' + pad(totalSeconds % 60);
  259. }
  260.  
  261. function pad(val) {
  262. var valString = val + "";
  263. if (valString.length < 2) {
  264. return "0" + valString;
  265. } else {
  266. return valString;
  267. }
  268. }
  269.  
  270.  
  271. // #for (var it in $.cookie()) $.removeCookie(it);
  272. function startDice() {
  273. "use strict";
  274. _mode = document.getElementById('_mode').value;
  275. _bet = parseFloat(document.getElementById('_bet').value);
  276. _profit = parseFloat(document.getElementById('_profit').value);
  277. _stake = parseFloat(document.getElementById('_stake').value);
  278. _stake = -_stake;
  279. _chance = parseFloat(document.getElementById('_chance').value);
  280. _onlost = parseFloat(document.getElementById('_onlost').value);
  281. _stopprofit = document.getElementById('_stopprofit').checked;
  282. _stopstake = document.getElementById('_stopstake').checked;
  283. _double = document.getElementById('_double').checked;
  284. _auto = document.getElementById('_auto').checked;
  285. _restart = document.getElementById('_restart').checked;
  286. _restart2 = document.getElementById('_restart2').checked;
  287. _consecutive = parseInt(document.getElementById('_consecutive').value);
  288.  
  289.  
  290. //
  291. _betting = 0;
  292. gamewin = 0;
  293. gamelose= 0;
  294. con = 0;
  295. totalSeconds=0;
  296.  
  297. _first = true;
  298. updateIndex('#_status','');
  299.  
  300. if (_mode !== 'h' && _mode !== 'l' && _mode !== 'z' && _mode !== 'low') {
  301. updateIndex('#_status',"BET MODE INCORRECT USE [H - L - Z - LOW]");
  302. return;
  303. }
  304.  
  305. _start = !_start;
  306. if (_start !== true) {
  307. $('#_start').text("START");
  308. _betting = 0;
  309. clearInterval(_task);
  310. clearInterval(_seeds);
  311. clearInterval(timerTask);
  312. return;
  313. } else {
  314. $('#_start').text("STOP");
  315. }
  316.  
  317. if ($("#updated_condition").text().indexOf('>') !== -1 && _mode === 'l') {
  318. $("#updated_condition").trigger('click');
  319. } else if ($("#updated_condition").text().indexOf('<') !== -1 && _mode === 'h') {
  320. $("#updated_condition").trigger('click');
  321. }
  322.  
  323.  
  324. if(_mode === 'low') {
  325. lowBalance();
  326. }
  327. else {
  328. betSetting(_bet.toFixed(devise_decimal), _chance);
  329. }
  330.  
  331. if (_auto) {
  332. // CHANGE
  333. change_seeds();
  334.  
  335. // SET TASK
  336. _seeds = setInterval(function() {
  337. // CHANGE
  338. change_seeds();
  339.  
  340. updateIndex('#_status',"CHANGE SEED TASK = " + _seeds.toString());
  341. }, Math.round(Math.random() * (600000 - 300000) + 300000));
  342. }
  343. _betting = _bet;
  344.  
  345. //
  346. $('#btn-bet-dice').trigger('click');
  347.  
  348. // First Bet
  349. _first = false;
  350.  
  351. // Timer
  352. timerTask = setInterval(setTime, 1000);
  353. }
  354.  
  355. function increaseOnLost(bet, percent) {
  356. "use strict";
  357. return parseFloat(bet) + ((parseFloat(bet) * percent) / 100);
  358. }
  359.  
  360. function doubleOnLost(bet) {
  361. "use strict";
  362. return (bet * 2).toFixed(devise_decimal);
  363. }
  364.  
  365. function updateIndex(who, value){
  366. "use strict";
  367. $(who).val(value);
  368. }
  369.  
  370. function betSetting(bet, chance){
  371. //
  372. $('#amount').val(bet);
  373.  
  374. //
  375. $("#editable-chance").trigger('click');
  376. $("#editable-chance-field").val(chance);
  377. $("#editable-chance-field").trigger('focusout');
  378. }
  379.  
  380. var _Handle = function() {
  381. "use strict";
  382. clearInterval(_task);
  383.  
  384. var bet = 0 , lose, balance;
  385. if (_start)
  386. {
  387.  
  388. if (_first !== true)
  389. {
  390. lose = ($('#history-my-bets-dice tr td:last-child span')[0].innerText.indexOf('-') !== -1) ? true : false;
  391. _betting = parseFloat(_betting) + parseFloat($('#history-my-bets-dice tr td:last-child span')[0].innerText);
  392.  
  393. updateIndex('#bl_update', _betting.toFixed(devise_decimal));
  394. if (lose) {
  395. if (_onlost > 0 && !_double) {
  396. bet = increaseOnLost($('#amount').val(), _onlost);
  397. $('#amount').val(bet.toFixed(devise_decimal));
  398. } else if (_onlost <= 0 && _double) {
  399. var current = $('#amount').val();
  400. bet = doubleOnLost(current);
  401. $('#amount').val(bet);
  402. }
  403. else {
  404. updateIndex('#_status',"something is wrong");
  405. startDice();
  406. return;
  407. }
  408. gamelose++;
  409. con++;
  410. } else {
  411. $('#amount').val(_bet.toFixed(devise_decimal));
  412. gamewin++;
  413. con = 0;
  414. }
  415.  
  416. if (_stopprofit) {
  417. if (_betting >= _profit) {
  418. startDice();
  419. updateIndex('#_status',"PROFIT REACHED!");
  420. return;
  421. }
  422. }
  423.  
  424. if (_stopstake) {
  425. if (_betting <= _stake) {
  426. startDice();
  427. updateIndex('#_status',"STAKE REACHED!");
  428. return;
  429. }
  430.  
  431. } else {
  432. if (_betting <= _stake) {
  433. if (_restart || _restart2) {
  434. clearInterval(_task);
  435. _betting = 0;
  436. $('#amount').val(_bet.toFixed(devise_decimal));
  437. updateIndex('#_status',"STAKE REACHED, RESTARTING!");
  438. }
  439. }
  440. }
  441.  
  442. }
  443.  
  444. updateIndex('#gamewin', gamewin);
  445. updateIndex('#gamelose', gamelose);
  446.  
  447. _task = setInterval(function(e) {
  448. balance = parseFloat(document.getElementById('balances-lg').innerText);
  449. if (balance <= bet_min || parseFloat($('#amount').val()) > balance) {
  450. startDice();
  451. updateIndex('#_status', "Balance Low or Null");
  452. return;
  453. }
  454.  
  455. if (!_start) {
  456. clearInterval(_task);
  457. clearInterval(_seeds);
  458. return;
  459. }
  460.  
  461. if (_mode === 'z') {
  462. $("#updated_condition").trigger('click');
  463. }
  464. if( _consecutive > 0 && con >= _consecutive ){
  465. $("#updated_condition").trigger('click');
  466. con=0;
  467. }
  468.  
  469. $('#btn-bet-dice').trigger('click');
  470. }, _betspeed);
  471.  
  472. }
  473.  
  474. };
  475. //
  476. var timer;
  477. $('#history-my-bets-dice').unbind();
  478. $('#history-my-bets-dice').bind("DOMSubtreeModified", function(event) {
  479. "use strict";
  480. if (timer) { clearTimeout(timer); }
  481. timer = setTimeout( _Handle, 100);
  482. });
  483.  
  484.  
  485. function lowBalance(){
  486. var balance = parseFloat(document.getElementById('balances-lg').innerText);
  487. if( balance < 0.00001){
  488. betSetting("0.00000005", 15);
  489. $('#_bet').val("0.00000005");
  490. $('#_chance').val(15);
  491. $("#_onlost").val(16);
  492. $('#updated_condition').trigger('click');
  493. } else if (balance < 0.0001 && balance > 0.00001) {
  494. betSetting("0.00000002", 66);
  495. $('#_bet').val("0.00000002");
  496. $('#_chance').val(66);
  497. $("#_onlost").val(660);
  498. $('#updated_condition').trigger('click');
  499. } else if (balance < 0.001 && balance > 0.0001) {
  500. betSetting("0.00000005", 17);
  501. $('#_bet').val("0.00000005");
  502. $('#_chance').val(17);
  503. $("#_onlost").val(26);
  504. $('#updated_condition').trigger('click');
  505. } else if (balance < 0.01 && balance > 0.001) {
  506. betSetting("0.00000010", 10);
  507. $('#_bet').val("0.00000010");
  508. $('#_chance').val(10);
  509. $("#_onlost").val(12);
  510. $('#updated_condition').trigger('click');
  511. } else if (balance < 0.1 && balance > 0.01) {
  512. betSetting("0.00000100", 7.12);
  513. $('#_bet').val("0.00000100");
  514. $('#_chance').val(7.12);
  515. $("#_onlost").val(12);
  516. $('#updated_condition').trigger('click');
  517. }
  518. }
Advertisement
Add Comment
Please, Sign In to add comment