ScrollMacro Sploop.io

With this script, you can quickly scroll through the store with caps! When you click on the buttons, the store will automatically open and scroll the ScrollBar to the desired header ! Keys: B-BerserkerGear, C-BoostHat, T-CrystalGear, V-ImmunityGear, Esc-Menu.

Verze ze dne 26. 09. 2021. Zobrazit nejnovější verzi.

  1. // ==UserScript==
  2. // @name ScrollMacro Sploop.io
  3. // @namespace none
  4. // @version 1
  5. // @description With this script, you can quickly scroll through the store with caps! When you click on the buttons, the store will automatically open and scroll the ScrollBar to the desired header ! Keys: B-BerserkerGear, C-BoostHat, T-CrystalGear, V-ImmunityGear, Esc-Menu.
  6. // @author 00100110#6361
  7. // @match *://sploop.io/*
  8. // @grant none
  9. // @require http://code.jquery.com/jquery-3.3.1.min.js
  10. // @require https://code.jquery.com/ui/1.12.0/jquery-ui.min.js
  11. // ==/UserScript==
  12. document.addEventListener('keydown', e => {
  13. if (e.keyCode == 27) {
  14. if ($('#bind-key-menu').css('display') == 'none') $('#bind-key-menu').animate({top: 'show'}, 100)
  15. else $('#bind-key-menu').animate({top: 'hide'}, 100)
  16. }
  17. })
  18. const html = `
  19. <div id="bind-key-menu">
  20. <div id="block-bind">
  21. <Text>Crystral: <input type="text" id="crystalBind" onKeyPress=SupressInput(event); oncontextmenu="return false" style="width: 75px;" value="KeyT" class="inputTxt"></Text>
  22. <br>
  23. <Text>Berserker: <input type="text" id="berserkerBind" onKeyPress=SupressInput(event); oncontextmenu="return false" style="width: 75px;" value="KeyB" class="inputTxt"></Text>
  24. <br>
  25. <Text>Boost: <input type="text" id="boostBind" onKeyPress=SupressInput(event); oncontextmenu="return false" style="width: 75px;" value="KeyC" class="inputTxt"></Text>
  26. <br>
  27. <Text>Immunity: <input type="text" id="immunityBind" onKeyPress=SupressInput(event); oncontextmenu="return false" style="width: 75px;" value="KeyV" class="inputTxt"></Text>
  28. </div>
  29. </div>
  30. <style>
  31. Text {
  32. font-size: 22px;
  33. color: #fff;
  34. }
  35. #block-bind {
  36. width: 100%;
  37. height: auto;
  38. padding: 8px;
  39. background: rgba(0, 0, 0, 0.25);
  40. box-shadow: inset 0 5px 0 rgb(20 20 20 / 40%);
  41. border-radius: 15px;
  42. border: 5px solid #141414;
  43. }
  44. #bind-key-menu {
  45. text-align: left;
  46. padding: 20px;
  47. padding-top: 50px;
  48. position: absolute;
  49. display: none;
  50. background: rgba(0, 0, 0, 0.25);
  51. bottom: 35%;
  52. left: 39.9%;
  53. border-radius: 15px;
  54. width: 325px;
  55. height: 250px;
  56. border: 5px solid #141414;
  57. box-shadow: inset 0 4px 0 #4e5645, inset 0 -4px 0 #384825, 0px 2px 0 5px rgb(20 20 20 / 30%), 0px 0px 0 15px rgb(20 20 20 / 10%);
  58. }
  59. .inputTxt {
  60. cursor: text;
  61. vertical-align: middle;
  62. user-select: none;
  63. box-sizing: border-box;
  64. text-align: center;
  65. outline: 0;
  66. display: inline-block;
  67. border: none;
  68. border: 5px solid rgba(0, 0, 0, 0);
  69. box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.08), 0 2px 10px 0 rgba(0, 0, 0, 0.06);
  70. border-radius: 10px;
  71. transition: all 1s;
  72. }
  73. </style>
  74. <script>
  75. function SupressInput($event) {
  76. $event.preventDefault();
  77. }
  78. let use = false, codeKey, use2 = false, codeKey2, use3 = false, codeKey3, use4 = false, codeKey4
  79. document.getElementById("boostBind").addEventListener("mousedown", e => {
  80. if (e.button == 0) {
  81. $("#boostBind").val("Select")
  82. use = true
  83. }
  84. if (e.button == 2) {
  85. $("#boostBind").val("...")
  86. use = false
  87. }
  88. })
  89. document.getElementById("boostBind").addEventListener('keydown', e => {
  90. if ($("#boostBind").focus()) {
  91. if (use) {
  92. use = false
  93. codeKey = (e.code).toString()
  94. $("#boostBind").val(codeKey)
  95. }
  96. }
  97. })
  98. document.getElementById("immunityBind").addEventListener("mousedown", e => {
  99. if (e.button == 0) {
  100. $("#immunityBind").val("Select")
  101. use2 = true
  102. }
  103. if (e.button == 2) {
  104. $("#immunityBind").val("...")
  105. use2 = false
  106. }
  107. })
  108. document.getElementById("immunityBind").addEventListener('keydown', e => {
  109. if ($("#immunityBind").focus()) {
  110. if (use2) {
  111. use2 = false
  112. codeKey2 = (e.code).toString()
  113. $("#immunityBind").val(codeKey2)
  114. }
  115. }
  116. })
  117. document.getElementById("berserkerBind").addEventListener("mousedown", e => {
  118. if (e.button == 0) {
  119. $("#berserkerBind").val("Select")
  120. use3 = true
  121. }
  122. if (e.button == 2) {
  123. $("#berserkerBind").val("...")
  124. use3 = false
  125. }
  126. })
  127. document.getElementById("berserkerBind").addEventListener('keydown', e => {
  128. if ($("#berserkerBind").focus()) {
  129. if (use3) {
  130. use3 = false
  131. codeKey3 = (e.code).toString()
  132. $("#berserkerBind").val(codeKey3)
  133. }
  134. }
  135. })
  136. document.getElementById("crystalBind").addEventListener("mousedown", e => {
  137. if (e.button == 0) {
  138. $("#crystalBind").val("Select")
  139. use4 = true
  140. }
  141. if (e.button == 2) {
  142. $("#crystalBind").val("...")
  143. use4 = false
  144. }
  145. })
  146. document.getElementById("crystalBind").addEventListener('keydown', e => {
  147. if ($("#crystalBind").focus()) {
  148. if (use4) {
  149. use4 = false
  150. codeKey4 = (e.code).toString()
  151. $("#crystalBind").val(codeKey4)
  152. }
  153. }
  154. })
  155. </script>
  156. `
  157. $("body").append(html)
  158.  
  159. document.title = "ScrollMacro"
  160. let getElement = [document.getElementById("hat-menu"), document.getElementById("hat_menu_content")]
  161. document.addEventListener('keydown', (e)=>{
  162. switch (e.code) {
  163. case $("#crystalBind").val(): // Crystral Gear
  164. getElement[0].style.display = "flex"
  165. getElement[1].scrollTo(0, 75)
  166. break
  167. case $("#berserkerBind").val(): // Berserker Gear
  168. getElement[0].style.display = "flex"
  169. getElement[1].scrollTo(0, 0)
  170. break
  171. case $("#boostBind").val(): // Boost Hat
  172. getElement[0].style.display = "flex"
  173. getElement[1].scrollTo(0, 220)
  174. break
  175. case $("#immunityBind").val(): // Immunity Gear
  176. getElement[0].style.display = "flex"
  177. getElement[1].scrollTo(0, 185)
  178. break
  179. }
  180. })
  181. getElement[0].addEventListener('dblclick', function (e) {
  182. getElement[0].style.display = "none"
  183. })