BITSLER ROLLHUNT BOUNTY SCRIPT

The best BITSLER SCRIPT

  1. // ==UserScript==
  2. // @name BITSLER ROLLHUNT BOUNTY SCRIPT
  3. // @name:en BITSLER ROLLHUNT BOUNTY SCRIPT
  4. // @version 14.882281-Release
  5. // @description The best BITSLER SCRIPT
  6. // @description:en 2
  7. // @copyright 2019, ADMINBITSLERAHUESOS
  8. // @author ADMINBITSLERAHUESOS
  9. // @match https://www.bitsler.app/*/dice
  10. // @match https://www.bitsler.com/*/dice
  11. // @grant none
  12. // @license MIT
  13. // @namespace 1
  14. // @require http://code.jquery.com/jquery-3.4.1.min.js
  15. // ==/UserScript==
  16.  
  17.  
  18.  
  19. (function ()
  20. {
  21. 'use strict';
  22. window.addEventListener('load', function()
  23. {
  24. for (let i = 0; i < 10; i++)
  25. {
  26. var input = document.createElement("input");
  27. input.type = "text";
  28. input.id = "roll"+i;
  29. input.size = 5;
  30. document.querySelector("#game-controls-box").appendChild(input);
  31. }
  32. var checkbox = document.createElement('input');
  33. checkbox.type = "checkbox";
  34. checkbox.id = "work";
  35. document.querySelector("#game-controls-box").appendChild(checkbox);
  36. demo();
  37. }, false);
  38. function sleep(ms) {
  39. return new Promise(resolve => setTimeout(resolve, ms));
  40. }
  41. async function demo()
  42. {
  43. while(true)
  44. {
  45. await sleep(1500);
  46. var rolls = [];
  47. for (let i = 0; i < 10; i++)
  48. {
  49. var roll = parseFloat(document.querySelector('#roll'+i).value);
  50. if(!isNaN(roll))
  51. {
  52. rolls.push(roll);
  53. }
  54. }
  55. if(rolls.length>0)
  56. {
  57. var matches = document.querySelectorAll('div.di-bg > div > div.game-top > div.di-top-wrapper.clearfix > div > ul > li');
  58. matches.forEach(function(item, i, matches)
  59. {
  60. var roll_id = parseFloat(item.getElementsByTagName('a')[0].href.replace(/\D/g,""));
  61. var roll_number = parseFloat(item.getElementsByTagName('span')[0].innerText);
  62. rolls.forEach(function(itm, j, rolls)
  63. {
  64. if(Math.abs(itm-roll_number)<=0.05)
  65. {
  66. if(document.querySelector('#work').checked)
  67. {
  68. if(Math.abs(itm-roll_number)==0)
  69. {
  70. for (let y = 0; y < 10; y++)
  71. {
  72. var roll = parseFloat(document.querySelector('#roll'+y).value);
  73. if(!isNaN(roll))
  74. {
  75. if(Math.abs(roll-roll_number)<=0.05)
  76. {
  77. document.querySelectorAll('iframe')[0].contentWindow.document.querySelector('#msg-input').value='#'+roll_id+' '+roll_number;
  78. console.log('#'+roll_id+' '+roll_number);
  79. }
  80. }
  81. }
  82. }
  83. }
  84. else
  85. {
  86. for (let y = 0; y < 10; y++)
  87. {
  88. var roll = parseFloat(document.querySelector('#roll'+y).value);
  89. if(!isNaN(roll))
  90. {
  91. if(Math.abs(roll-roll_number)<=0.05)
  92. {
  93. document.querySelectorAll('iframe')[0].contentWindow.document.querySelector('#msg-input').value='#'+roll_id+' '+roll_number;
  94. console.log('#'+roll_id+' '+roll_number);
  95. }
  96. }
  97. }
  98. }
  99.  
  100. }
  101. });
  102. });
  103. }
  104. }
  105. }
  106. })();