Moonstone Client for bloxd.io

this is cool

当前为 2024-02-17 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Moonstone Client for bloxd.io
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.5
  5. // @description this is cool
  6. // @author someone
  7. // @match https://bloxd.io/
  8. // @grant GM_addStyle
  9. // @grant unsafeWindow
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. function getCookie(cname) {
  14. let name = cname + "=";
  15. let decodedCookie = decodeURIComponent(document.cookie);
  16. let ca = decodedCookie.split(';');
  17. for(let i = 0; i <ca.length; i++) {
  18. let c = ca[i];
  19. while (c.charAt(0) == ' ') {
  20. c = c.substring(1);
  21. }
  22. if (c.indexOf(name) == 0) {
  23. return c.substring(name.length, c.length);
  24. }
  25. }
  26. return "";
  27. }
  28.  
  29. if (getCookie("modsEnabled") == "") {
  30. document.cookie = "modsEnabled=[]";
  31. }
  32.  
  33. setInterval(function() {
  34. 'use strict';
  35. if (JSON.parse(getCookie("modsEnabled")).includes('googclassroom')) {
  36. document.title = "Google Classroom";
  37.  
  38. var link = document.querySelector("link[rel~='icon']");
  39. link.remove();
  40. link = document.createElement('link');
  41. link.rel = 'icon';
  42. document.head.appendChild(link);
  43. link.href = '//ssl.gstatic.com/classroom/ic_product_classroom_144.png';
  44. } else {
  45. document.title = "Bloxd";
  46. }
  47. const maintext = document.querySelector('.Title.FullyFancyText');
  48. maintext.style.fontFamily = "Reglisse-Fill, serif";
  49. maintext.style.textShadow = "none";
  50. maintext.style.webkitTextStroke = "none";
  51.  
  52. document.querySelector('.Title.FullyFancyText').textContent = "Moonstone Client";
  53. let background = document.getElementsByClassName("Background");
  54. background[0].src = "https://i.imgur.com/Vg1T5ap.png";
  55. let names = document.getElementsByClassName("AvailableGameText");
  56. let imgs = document.getElementsByClassName("AvailableGameImg")
  57. let imgedits = document.getElementsByClassName("AvailableGame");
  58. (function() {
  59. 'use strict';
  60. const fontLink = document.createElement('link');
  61. fontLink.href = 'https://fonts.googleapis.com/css2?family=Ubuntu:wght@700&display=swap';
  62. fontLink.rel = 'stylesheet';
  63.  
  64. })
  65.  
  66. // Crosshair
  67. setInterval(function() {
  68. const crosshair = document.querySelector(".CrossHair");
  69. if (crosshair) {
  70. crosshair.textContent = "⨀";
  71. crosshair.style.width = "30px";
  72. crosshair.style.height = "30px";
  73. }
  74. }, 1000);
  75.  
  76. document.querySelectorAll('.AvailableGame').forEach(item => {
  77. item.style.border = "none";
  78. })
  79.  
  80.  
  81. names[0].textContent = "Survival";
  82. names[0].style.textShadow = "none";
  83. imgs[0].src = "https://i.imgur.com/G9bUnQO.png";
  84. names[1].textContent = "Peaceful";
  85. names[1].style.textShadow = "none";
  86. imgs[1].src = "https://i.imgur.com/xC9jltf.png";
  87. names[2].textContent = "Creative";
  88. names[2].style.textShadow = "none";
  89. imgs[2].src = "https://i.imgur.com/BQEsCog.png";
  90. names[3].textContent = "Bedwars Squads";
  91. names[3].style.textShadow = "none";
  92. imgs[3].src = "https://i.imgur.com/TaF7UmB.png";
  93. names[4].textContent = "Bedwars Duos";
  94. names[4].style.textShadow = "none";
  95. imgs[4].src = "https://i.imgur.com/QqM1WwQ.png";
  96. names[5].textContent = "Skywars";
  97. names[5].style.textShadow = "none";
  98. imgs[5].src = "https://i.imgur.com/1EvgKmL.png";
  99. names[6].textContent = "Oneblock";
  100. names[6].style.textShadow = "none";
  101. imgs[6].src = "https://i.imgur.com/aXstUVN.png";
  102. names[7].textContent = "Greenville";
  103. names[7].style.textShadow = "none";
  104. imgs[7].src = "https://i.imgur.com/YQsbnFc.png";
  105. names[8].textContent = "Cube Warfare";
  106. names[8].style.textShadow = "none";
  107. imgs[8].src = "https://i.imgur.com/heFKXJ6.png";
  108. names[9].textContent = "Eviltower";
  109. names[9].style.textShadow = "none";
  110. imgs[9].src = "https://i.imgur.com/Gpm1cvW.png";
  111. names[10].textContent = "Doodlecube";
  112. names[10].style.textShadow = "none";
  113. imgs[10].src = "https://i.imgur.com/hjUAKVI.png";
  114. names[11].textContent = "BloxdHop";
  115. names[11].style.textShadow = "none";
  116. imgs[11].src = "https://i.imgur.com/MPRY80l.png";
  117. names[12].textContent = "Hide & Seek";
  118. names[12].style.textShadow = "none";
  119. imgs[12].src = "https://i.imgur.com/UXVWqA5.png";
  120. names[14].textContent = "Plots(superflat)";
  121. imgs[14].src = "https://i.imgur.com/mMwt42i.png";
  122. names[14].style.textShadow = "none";
  123. names[16].textContent = "Worlds";
  124. imgs[16].src = "https://i.imgur.com/TWCWlyP.png";
  125. names[16].style.textShadow = "none";
  126.  
  127. imgedits[0].style.border = "none";
  128. imgedits[0].style.boxShadow = "0px 10px 20px rgba(0, 0, 0, 0.3)";
  129. imgedits[1].style.border = "none";
  130. imgedits[1].style.boxShadow = "0px 10px 20px rgba(0, 0, 0, 0.3)";
  131. imgedits[2].style.border = "none";
  132. imgedits[2].style.boxShadow = "0px 10px 20px rgba(0, 0, 0, 0.3)";
  133. imgedits[3].style.border = "none";
  134. imgedits[3].style.boxShadow = "0px 10px 20px rgba(0, 0, 0, 0.3)";
  135. imgedits[4].style.border = "none";
  136. imgedits[4].style.boxShadow = "0px 10px 20px rgba(0, 0, 0, 0.3)";
  137. imgedits[5].style.border = "none";
  138. imgedits[5].style.boxShadow = "0px 10px 20px rgba(0, 0, 0, 0.3)";
  139. imgedits[6].style.border = "none";
  140. imgedits[6].style.boxShadow = "0px 10px 20px rgba(0, 0, 0, 0.3)";
  141. imgedits[7].style.border = "none";
  142. imgedits[7].style.boxShadow = "0px 10px 20px rgba(0, 0, 0, 0.3)";
  143. imgedits[8].style.border = "none";
  144. imgedits[8].style.boxShadow = "0px 10px 20px rgba(0, 0, 0, 0.3)";
  145. imgedits[9].style.border = "none";
  146. imgedits[9].style.boxShadow = "0px 10px 20px rgba(0, 0, 0, 0.3)";
  147. imgedits[10].style.border = "none";
  148. imgedits[10].style.boxShadow = "0px 10px 20px rgba(0, 0, 0, 0.3)";
  149. imgedits[11].style.border = "none";
  150. imgedits[11].style.boxShadow = "0px 10px 20px rgba(0, 0, 0, 0.3)";
  151. imgedits[12].style.border = "none";
  152. imgedits[12].style.boxShadow = "0px 10px 20px rgba(0, 0, 0, 0.3)";
  153. imgedits[13].style.border = "none";
  154. imgedits[13].style.boxShadow = "0px 10px 20px rgba(0, 0, 0, 0.3)";
  155. imgedits[14].style.border = "none";
  156. imgedits[14].style.boxShadow = "0px 10px 20px rgba(0, 0, 0, 0.3)";
  157. imgedits[15].style.border = "none";
  158. imgedits[15].style.boxShadow = "0px 10px 20px rgba(0, 0, 0, 0.3)";
  159.  
  160. },100);
  161.  
  162. //Ad Blocker
  163. document.getElementsByClassName('partnersAndCredits SmallTextLight')[0].remove();
  164. document.getElementsByClassName('SmallTextLight')[0].remove();
  165. document.getElementsByClassName('AdContainer')[0].remove();
  166.  
  167. (function() {
  168. unsafeWindow.moonstone_mods_save = function() {
  169. var checkBoxesSelected = document.getElementById("moonstone_mods").querySelectorAll('[type="checkbox"]:checked');
  170. var modsEnabled = [];
  171. for (i = 0; i < checkBoxesSelected.length; i++) {
  172. var mod = checkBoxesSelected[i];
  173. modsEnabled.push(mod.name);
  174. }
  175. document.cookie = "modsEnabled=" + JSON.stringify(modsEnabled);
  176. console.log(JSON.parse(getCookie("modsEnabled")));
  177. window.location.reload();
  178. }
  179. })();
  180.  
  181. (function() {
  182. 'use strict';
  183. const fontLink = document.createElement('link');
  184. fontLink.href = 'https://db.onlinewebfonts.com/c/68c9057f4e4dc415b2648f88526aeea7?family=Reglisse-Fill';
  185. fontLink.rel = 'stylesheet';
  186.  
  187. document.head.appendChild(fontLink);
  188.  
  189. var googclassroom_mod_checked = "";
  190. var test_mod_checked = "";
  191.  
  192. if (JSON.parse(getCookie("modsEnabled")).includes('googclassroom')) {
  193. googclassroom_mod_checked = " checked";
  194. }
  195.  
  196. if (JSON.parse(getCookie("modsEnabled")).includes('test')) {
  197. test_mod_checked = " checked";
  198. }
  199.  
  200.  
  201.  
  202. const div = document.createElement('div');
  203. div.id="moonstone_mods";
  204. div.style.position = "fixed";
  205. div.style.color = "#fff";
  206. div.innerHTML = "Moonstone Client - Mods<br><br><div><input type='checkbox' id='googclassroom' name='googclassroom' value=''" + googclassroom_mod_checked + "><label for='googclassroom'> It's Google Classroom!</label></div><br><div><input type='checkbox' id='test' name='test' value=''" + test_mod_checked + "><label for='test'> Testing</label></div><br><br><button id='mods_save_btn' onclick='window.moonstone_mods_save()'>Save</button>";
  207. div.style.top = "30%";
  208. div.style.left = "50%";
  209. div.style.zIndex = "2";
  210. div.style.fontWeight = "bold";
  211. div.style.borderRadius = "15px";
  212. div.style.fontSize = "18px";
  213. div.style.height = "6vh";
  214. div.style.paddingTop = "0.1rem";
  215. div.style.justifyContent = "center";
  216. div.style.width = "60vw";
  217. div.style.height = "50vh";
  218. div.style.transform = "translateX(-50%)";
  219. div.style.textAlign = "center";
  220. div.style.lineHeight = "50px";
  221. div.style.backgroundColor = "black";
  222. div.style.cursor = "pointer";
  223. div.style.display = "none";
  224.  
  225. document.body.appendChild(div);
  226.  
  227. document.addEventListener("keypress", function(event) {
  228. if (event.key === "=") {
  229. var div = document.getElementById("moonstone_mods");
  230. if (div.style.display == "none") {
  231. div.style.display = "block";
  232. } else {
  233. div.style.display = "none";
  234. }
  235. }
  236. });
  237.  
  238.  
  239.  
  240. const mods_bottomright_btn = document.createElement('button');
  241. mods_bottomright_btn.innerText = "Mods";
  242. mods_bottomright_btn.style = "background-color: #fff; background-position: 12px 11px; background-repeat: no-repeat; border: none; box-shadow: 0 -1px 0 rgba(0,0,0,.04),0 1px 1px rgba(0,0,0,.25); color: #757575; cursor: pointer; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif; font-size: 14px; font-weight: 500; padding: 12px 16px 12px 15px; transition: background-color .3s,box-shadow .3s;";
  243. document.getElementsByClassName("HomeScreenBottomRight")[0].appendChild(mods_bottomright_btn);
  244.  
  245. mods_bottomright_btn.addEventListener("click", function(event) {
  246. var div = document.getElementById("moonstone_mods");
  247. if (div.style.display == "none") {
  248. div.style.display = "block";
  249. } else {
  250. div.style.display = "none";
  251. }
  252. });
  253. })();
  254.  
  255. // Hotbar
  256. (function() {
  257. 'use strict';
  258.  
  259. setInterval(function() {
  260. const hotbarslots = document.querySelectorAll(".item");
  261. const selectedslot = document.querySelectorAll(".SelectedItem");
  262. if (hotbarslots) {
  263. hotbarslots.forEach(function(hotbar) {
  264. hotbar.style.borderRadius = "8px";
  265. hotbar.style.borderColor = "#303a5900";
  266. hotbar.style.backgroundColor = "#D13D2E";
  267. hotbar.style.boxShadow = "inset -2px -2px 10px 0px rgb(133, 0, 0), inset 0.3px 0.3px 5px 0px rgb(255, 255, 255)"
  268. hotbar.style.outline = "transparent"
  269. });
  270. }
  271. if (selectedslot) {
  272. selectedslot.forEach(function(slot) {
  273. slot.style.backgroundColor = "#c9991c";
  274. slot.style.boxShadow = "inset -2px -2px 10px 0px rgb(210, 183, 45), inset 0.3px 0.3px 5px 0px rgb(255, 255, 255)";
  275. slot.style.borderColor = "#b88c1a";
  276. slot.style.outline = "transparent";
  277. });
  278. }
  279. }, 1);
  280. })();