Moonstone Client for bloxd.io

this is cool

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