UI MASTER

A Bloxd.io custom client.

  1. // ==UserScript==
  2. // @name UI MASTER
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description A Bloxd.io custom client.
  6. // @author my_name_chinese
  7. // @match http://staging.bloxd,io//
  8. // @match http://bloxd,io//
  9. // @match *://*/*
  10. // @icon https://imgur.com/NLAKmI9.png
  11. // @grant none
  12. // @license GPLv3
  13. // ==/UserScript==
  14.  
  15. (function() {
  16. 'use strict';
  17.  
  18.  
  19. // Define Main Menu
  20. let clientMainMenu;
  21. clientMainMenu = document.createElement("div");
  22. clientMainMenu.textContent = "UI MASTER";
  23. clientMainMenu.style.position = "fixed";
  24. clientMainMenu.style.color = "#1B4F72";
  25. clientMainMenu.style.textShadow = "3px 3px 4px white";
  26. clientMainMenu.style.top = "50%";
  27. clientMainMenu.style.left = "50%";
  28. clientMainMenu.style.transform = "translate(-50%, -50%)";
  29. clientMainMenu.style.zIndex = "10000";
  30. clientMainMenu.style.borderRadius = "10px";
  31. clientMainMenu.style.backgroundImage = "url(https://i.postimg.cc/9FxdHSZc/NLAKmI9.png)";
  32. clientMainMenu.style.backgroundRepeat = "no-repeat";
  33. clientMainMenu.style.backgroundSize = "cover";
  34. clientMainMenu.style.backgroundPosition = "center";
  35. clientMainMenu.style.boxShadow = "0px 0px 20px rgba(0, 0, 0, 0.5)";
  36. clientMainMenu.style.fontSize = "24px";
  37. clientMainMenu.style.height = "600px";
  38. clientMainMenu.style.width = "500px";
  39. clientMainMenu.style.textAlign = "center";
  40. clientMainMenu.style.lineHeight = "50px";
  41. clientMainMenu.style.visibility = "hidden";
  42. clientMainMenu.style.opacity = "99%";
  43. clientMainMenu.style.userSelect = "none";
  44.  
  45.  
  46. // Define Button Elements
  47. let wkey;
  48. wkey = document.createElement('div');
  49. wkey.style.position = "relative";
  50. wkey.style.color = "#ffffff";
  51. wkey.textContent = "W";
  52. wkey.style.top = "0px";
  53. wkey.style.left = "0px";
  54. wkey.style.zIndex = "10000";
  55. wkey.style.fontWeight = "bold";
  56. wkey.style.borderRadius = "10px";
  57. wkey.style.backgroundColor = "#66ccff";
  58. wkey.style.fontSize = "24px";
  59. wkey.style.height = "50px";
  60. wkey.style.width = "50px";
  61. wkey.style.textAlign = "center";
  62. wkey.style.lineHeight = "50px";
  63. wkey.style.filter = "blur(1px)";
  64.  
  65.  
  66. let skey;
  67. skey = document.createElement('div');
  68. skey.style.position = "relative";
  69. skey.style.color = "#ffffff";
  70. skey.textContent = "S";
  71. skey.style.top = "5px";
  72. skey.style.left = "50%";
  73. skey.style.transform = "translateX(-50%)";
  74. skey.style.zIndex = "10000";
  75. skey.style.fontWeight = "bold";
  76. skey.style.borderRadius = "10px";
  77. skey.style.backgroundColor = "#66ccff";
  78. skey.style.fontSize = "24px";
  79. skey.style.height = "50px";
  80. skey.style.width = "50px";
  81. skey.style.textAlign = "center";
  82. skey.style.lineHeight = "50px";
  83. skey.style.filter = "blur(1px)";
  84.  
  85. let akey;
  86. akey = document.createElement('div');
  87. akey.style.position = "relative";
  88. akey.style.color = "#ffffff";
  89. akey.textContent = "A";
  90. akey.style.top = "60px";
  91. akey.style.left = "46.3%";
  92. akey.style.transform = "translateX(-50%)";
  93. akey.style.zIndex = "10000";
  94. akey.style.fontWeight = "bold";
  95. akey.style.borderRadius = "10px";
  96. akey.style.backgroundColor = "#66ccff";
  97. akey.style.fontSize = "24px";
  98. akey.style.height = "50px";
  99. akey.style.width = "50px";
  100. akey.style.textAlign = "center";
  101. akey.style.lineHeight = "50px";
  102. akey.style.filter = "blur(1px)";
  103.  
  104. let dkey;
  105. dkey = document.createElement('div');
  106. dkey.style.position = "relative";
  107. dkey.style.color = "#ffffff";
  108. dkey.textContent = "D";
  109. dkey.style.top = "60px";
  110. dkey.style.left = "53.7%";
  111. dkey.style.transform = "translateX(-50%)";
  112. dkey.style.zIndex = "10000";
  113. dkey.style.fontWeight = "bold";
  114. dkey.style.borderRadius = "10px";
  115. dkey.style.backgroundColor = "#66ccff";
  116. dkey.style.fontSize = "24px";
  117. dkey.style.height = "50px";
  118. dkey.style.width = "50px";
  119. dkey.style.textAlign = "center";
  120. dkey.style.lineHeight = "50px";
  121. dkey.style.filter = "blur(1px)";
  122.  
  123. let lmb;
  124. lmb = document.createElement('div');
  125. lmb.style.position = "relative";
  126. lmb.style.color = "#ffffff";
  127. lmb.textContent = "LMB";
  128. lmb.style.top = "115px";
  129. lmb.style.left = "50%";
  130. lmb.style.transform = "translateX(-50%)";
  131. lmb.style.zIndex = "10000";
  132. lmb.style.fontWeight = "bold";
  133. lmb.style.borderRadius = "10px";
  134. lmb.style.backgroundColor = "#66ccff";
  135. lmb.style.fontSize = "18px";
  136. lmb.style.height = "50px";
  137. lmb.style.width = "50px";
  138. lmb.style.textAlign = "center";
  139. lmb.style.lineHeight = "50px";
  140. lmb.style.filter = "blur(1px)";
  141.  
  142. let rmb;
  143. rmb = document.createElement('div');
  144. rmb.style.position = "relative";
  145. rmb.style.color = "#ffffff";
  146. rmb.textContent = "RMB";
  147. rmb.style.top = "115px";
  148. rmb.style.left = "53.7%";
  149. rmb.style.transform = "translateX(-50%)";
  150. rmb.style.zIndex = "10000";
  151. rmb.style.fontWeight = "bold";
  152. rmb.style.borderRadius = "10px";
  153. rmb.style.backgroundColor = "#66ccff";
  154. rmb.style.fontSize = "18px";
  155. rmb.style.height = "50px";
  156. rmb.style.width = "50px";
  157. rmb.style.textAlign = "center";
  158. rmb.style.lineHeight = "50px";
  159. rmb.style.filter = "blur(1px)";
  160.  
  161. // Add the elements to the body and the clientMainMenu
  162. //document.body.appendChild(wkey);
  163. //document.body.appendChild(skey);
  164. //document.body.appendChild(akey);
  165. //document.body.appendChild(dkey);
  166. //document.body.appendChild(lmb);
  167. //document.body.appendChild(rmb);
  168. document.body.appendChild(clientMainMenu);
  169.  
  170. // Add Event Listeners for the Keybinds
  171.  
  172. document.addEventListener('keydown', function(event) {
  173. if (event.key === 'w') {
  174. wkey.style.backgroundColor = "#3366ff";
  175. }
  176. if (event.key === 's') {
  177. skey.style.backgroundColor = "#3366ff";
  178. }
  179. if (event.key === 'a') {
  180. akey.style.backgroundColor = "#3366ff";
  181. }
  182. if (event.key === 'd') {
  183. dkey.style.backgroundColor = "#3366ff";
  184. }
  185. });
  186.  
  187. document.addEventListener('keyup', function(event) {
  188. if (event.key === 'w') {
  189. wkey.style.backgroundColor = "#66ccff";
  190. }
  191. if (event.key === 's') {
  192. skey.style.backgroundColor = "#66ccff";
  193. }
  194. if (event.key === 'a') {
  195. akey.style.backgroundColor = "#66ccff";
  196. }
  197. if (event.key === 'd') {
  198. dkey.style.backgroundColor = "#66ccff";
  199. }
  200. });
  201.  
  202. document.addEventListener('mousedown', function(event) {
  203. if (event.button === 0) {
  204. lmb.style.backgroundColor = "#3366ff";
  205. }
  206. if (event.button === 2) {
  207. rmb.style.backgroundColor = "#3366ff";
  208. }
  209. });
  210.  
  211. document.addEventListener('mouseup', function(event) {
  212. if (event.button === 0) {
  213. lmb.style.backgroundColor = "#66ccff";
  214. }
  215. if (event.button === 2) {
  216. rmb.style.backgroundColor = "#66ccff";
  217. }
  218. });
  219.  
  220. // Define Main Menu dragging
  221.  
  222. let isDragging = false;
  223. let offsetX = 0;
  224. let offsetY = 0;
  225.  
  226. clientMainMenu.addEventListener('mousedown', function(event) {
  227. if (event.target.nodeName !== 'INPUT') {
  228. isDragging = true;
  229. offsetX = event.clientX;
  230. offsetY = event.clientY;
  231. }
  232. });
  233.  
  234. document.addEventListener('mousemove', function(event) {
  235. if (isDragging) {
  236. const left = event.clientX;
  237. const top = event.clientY;
  238.  
  239. clientMainMenu.style.left = left + "px";
  240. clientMainMenu.style.top = top + "px";
  241. }
  242. });
  243.  
  244. document.addEventListener('mouseup', function() {
  245. isDragging = false;
  246. });
  247.  
  248. document.addEventListener('keydown', function(event) {
  249. if (event.key === 'U' || event.key === 'u') {
  250. clientMainMenu.style.visibility = clientMainMenu.style.visibility === "hidden" ? "visible" : "hidden";
  251. }
  252. });
  253.  
  254. // Define imputs and main menu text
  255.  
  256. let clientheader
  257. clientheader = document.createElement("div");
  258. clientheader.textContent = "Made By my_name_chinese";
  259. clientheader.style.position = "absolute";
  260. clientheader.style.top = "20px";
  261. clientheader.style.left = "50%";
  262. clientheader.style.transform = "translateX(-50%)";
  263. clientheader.style.fontSize = "15px";
  264. clientMainMenu.appendChild(clientheader);
  265.  
  266. // Create the button element
  267. const bilibutton = document.createElement("div");
  268. bilibutton.style.position = "absolute";
  269. bilibutton.style.top = "60px";
  270. bilibutton.style.left = "50%";
  271. bilibutton.style.transform = "translateX(-50%)";
  272. bilibutton.style.cursor = "pointer";
  273. bilibutton.style.backgroundColor = "#66ccff";
  274. bilibutton.style.backgroundImage = "linear-gradient(to bottom, #2E86C1, #AED6F1)";
  275. bilibutton.style.color = "#1B4F72";
  276. bilibutton.style.borderRadius = "10px";
  277. bilibutton.style.height = "40px";
  278. bilibutton.style.padding = "8px";
  279. bilibutton.addEventListener("click", function() {
  280. window.location.href = "https://space.bilibili.com/3546388900088449?spm_id_from=333.1007.0.0";
  281. });
  282.  
  283. // Create the text element
  284. const bilibuttonText = document.createElement("div");
  285. bilibuttonText.textContent = "my_name_bilibili_acc";
  286. bilibuttonText.style.fontSize = "20px";
  287. bilibuttonText.style.textAlign = "center";
  288. bilibuttonText.style.top = "50%";
  289. bilibuttonText.style.transform = "translateY(-25%)";
  290.  
  291. // Append the text element to the button element
  292. bilibutton.appendChild(bilibuttonText);
  293.  
  294. // Append the button element to the desired parent element
  295. clientMainMenu.appendChild(bilibutton);
  296.  
  297.  
  298. let clientsettingstext;
  299. clientsettingstext = document.createElement("div");
  300. clientsettingstext.textContent = "- Client Settings -";
  301. clientsettingstext.style.position = "absolute";
  302. clientsettingstext.style.color = "#1B4F72"
  303. clientsettingstext.style.top = "120px";
  304. clientsettingstext.style.left = "50%";
  305. clientsettingstext.style.transform = "translateX(-50%)";
  306. clientsettingstext.style.fontSize = "20px";
  307. clientMainMenu.appendChild(clientsettingstext);
  308.  
  309. let clientsettingsinput
  310. clientsettingsinput = document.createElement("input");
  311. clientsettingsinput.type = "text";
  312. clientsettingsinput.placeholder = "Client Background URL";
  313. clientsettingsinput.style.backgroundColor = '#AED6F1';
  314. clientsettingsinput.style.border = '3px double #1B4F72';
  315. clientsettingsinput.style.position = "absolute";
  316. clientsettingsinput.style.top = "160px";
  317. clientsettingsinput.style.left = "50%";
  318. clientsettingsinput.style.transform = "translateX(-50%)";
  319. clientMainMenu.appendChild(clientsettingsinput);
  320.  
  321. clientsettingsinput.addEventListener('input', function() {
  322. clientMainMenu.style.backgroundImage = `url(${clientsettingsinput.value})`;
  323. });
  324.  
  325. clientsettingsinput.addEventListener('mousedown', function(event) {
  326. event.stopPropagation();
  327. });
  328.  
  329. let hotbarsettingstext;
  330. hotbarsettingstext = document.createElement("div");
  331. hotbarsettingstext.textContent = "- HotBar Settings -";
  332. hotbarsettingstext.style.position = "absolute";
  333. hotbarsettingstext.style.top = "220px";
  334. hotbarsettingstext.style.left = "50%";
  335. hotbarsettingstext.style.transform = "translateX(-50%)";
  336. hotbarsettingstext.style.fontSize = "20px";
  337. clientMainMenu.appendChild(hotbarsettingstext);
  338.  
  339. let hotbarmaincolorinput
  340. hotbarmaincolorinput = document.createElement("input");
  341. hotbarmaincolorinput.type = "color";
  342. hotbarmaincolorinput.value = "#3d4b79"
  343. hotbarmaincolorinput.style.top = "250px";
  344. hotbarmaincolorinput.style.marginTop = "15px";
  345. hotbarmaincolorinput.style.position = "absolute";
  346. hotbarmaincolorinput.style.left = "44%";
  347. hotbarmaincolorinput.style.transform = "translateX(-50%)";
  348. clientMainMenu.appendChild(hotbarmaincolorinput);
  349.  
  350. hotbarmaincolorinput.addEventListener("input", function() {
  351. const color = hotbarmaincolorinput.value;
  352. hotbarmaincolorinput.value = color;
  353. const hotbars = document.querySelectorAll(".item");
  354.  
  355. hotbars.forEach(function(hotbar) {
  356. hotbar.style.backgroundColor = color;
  357. });
  358. });
  359.  
  360. let hotbarbordercolorinput;
  361. hotbarbordercolorinput = document.createElement("input");
  362. hotbarbordercolorinput.type = "color";
  363. hotbarbordercolorinput.style.top = "250px";
  364. hotbarbordercolorinput.value = "#303a59";
  365. hotbarbordercolorinput.style.marginTop = "15px";
  366. hotbarbordercolorinput.style.position = "absolute";
  367. hotbarbordercolorinput.style.left = "56%";
  368. hotbarbordercolorinput.style.transform = "translateX(-50%)";
  369. clientMainMenu.appendChild(hotbarbordercolorinput);
  370.  
  371. hotbarbordercolorinput.addEventListener("input", function() {
  372. const color = hotbarbordercolorinput.value;
  373. hotbarbordercolorinput.value = color;
  374. const hotbars = document.querySelectorAll(".item");
  375.  
  376. hotbars.forEach(function(hotbar) {
  377. hotbar.style.borderColor = color;
  378. });
  379. });
  380.  
  381. let hotbarborderradiusinput;
  382. hotbarborderradiusinput = document.createElement("input");
  383. hotbarborderradiusinput.type = "range";
  384. hotbarborderradiusinput.style.top = "280px";
  385. hotbarborderradiusinput.style.marginTop = "10px";
  386. hotbarborderradiusinput.style.position = "absolute";
  387. hotbarborderradiusinput.value = "0";
  388. hotbarborderradiusinput.style.left = "50%";
  389. hotbarborderradiusinput.min = "0";
  390. hotbarborderradiusinput.max = "30";
  391. hotbarborderradiusinput.style.transform = "translateX(-50%)";
  392. clientMainMenu.appendChild(hotbarborderradiusinput);
  393.  
  394. hotbarborderradiusinput.addEventListener("input", function() {
  395. const hotbarrounding = hotbarborderradiusinput.value;
  396. const hotbars = document.querySelectorAll(".item");
  397.  
  398. hotbars.forEach(function(hotbar) {
  399. hotbar.style.borderRadius = hotbarrounding + "px";
  400. });
  401. });
  402.  
  403. let crosshairsettingstext
  404. crosshairsettingstext = document.createElement("div");
  405. crosshairsettingstext.textContent = "- Crosshair Settings -";
  406. crosshairsettingstext.style.position = "absolute";
  407. crosshairsettingstext.style.top = "320px";
  408. crosshairsettingstext.style.left = "50%";
  409. crosshairsettingstext.style.transform = "translateX(-50%)";
  410. crosshairsettingstext.style.fontSize = "20px";
  411. clientMainMenu.appendChild(crosshairsettingstext);
  412.  
  413. let crosshairsettingsinput;
  414. crosshairsettingsinput = document.createElement("input");
  415. crosshairsettingsinput.type = "text";
  416. crosshairsettingsinput.placeholder = "Crosshair URL";
  417. crosshairsettingsinput.style.backgroundColor = '#AED6F1';
  418. crosshairsettingsinput.style.border = '3px double #1B4F72';
  419. crosshairsettingsinput.style.position = "absolute";
  420. crosshairsettingsinput.style.top = "360px";
  421. crosshairsettingsinput.value = "https://cdn-icons-png.flaticon.com/512/1527/1527735.png";
  422. crosshairsettingsinput.style.left = "50%";
  423. crosshairsettingsinput.style.transform = "translateX(-50%)";
  424. clientMainMenu.appendChild(crosshairsettingsinput);
  425.  
  426. let crosshairurl;
  427.  
  428. crosshairsettingsinput.addEventListener('input', function() {
  429. const crosshair = document.querySelector(".CrossHair");
  430. if (crosshair) {
  431. crosshair.style.backgroundImage = `url(${crosshairsettingsinput.value})`;
  432. crosshairurl = `url(${crosshairsettingsinput.value})`;
  433. }
  434. });
  435.  
  436. crosshairsettingsinput.addEventListener('mousedown', function(event) {
  437. event.stopPropagation();
  438. });
  439.  
  440. let keybindsettingstext;
  441. keybindsettingstext = document.createElement("div");
  442. keybindsettingstext.textContent = "- Keybind Settings -";
  443. keybindsettingstext.style.position = "absolute";
  444. keybindsettingstext.style.top = "420px";
  445. keybindsettingstext.style.left = "50%";
  446. keybindsettingstext.style.transform = "translateX(-50%)";
  447. keybindsettingstext.style.fontSize = "20px";
  448. clientMainMenu.appendChild(keybindsettingstext);
  449.  
  450. let keybindsettingbotton;
  451. keybindsettingbotton = document.createElement("div");
  452. keybindsettingbotton.textContent = "- Keybind Settings -";
  453. keybindsettingbotton.style.position = "absolute";
  454. keybindsettingbotton.style.top = "420px";
  455. keybindsettingbotton.style.left = "50%";
  456. keybindsettingbotton.style.transform = "translateX(-50%)";
  457. keybindsettingbotton.style.fontSize = "20px";
  458. clientMainMenu.appendChild(keybindsettingbotton);
  459.  
  460. // Create the button element
  461. const bindbutton = document.createElement("div");
  462. bindbutton.style.position = "absolute";
  463. bindbutton.style.top = "470px";
  464. bindbutton.style.fontSize = "20px";
  465. bindbutton.style.left = "50%";
  466. bindbutton.style.transform = "translateX(-50%)";
  467. bindbutton.style.cursor = "pointer";
  468. bindbutton.style.borderRadius = "10px";
  469. bindbutton.style.backgroundColor = "#AED6F1";
  470. bindbutton.style.color = "#1B4F72";
  471. bindbutton.style.borderRadius = "10px";
  472. bindbutton.style.height = "40px";
  473. bindbutton.style.padding = "8px";
  474. bindbutton.innerHTML = 'keybind:ON'; // 初始文本为"ON"
  475. var isOn = true; // 初始状态为true
  476. bindbutton.addEventListener("click", function() {
  477. isOn = !isOn; // 切换状态
  478. bindbutton.innerHTML = isOn ? 'keybind:ON' : 'keybind:OFF'; // 根据状态设置按钮文本
  479. });
  480.  
  481.  
  482. // Append the button element to the desired parent element
  483. clientMainMenu.appendChild(bindbutton);
  484.  
  485.  
  486.  
  487.  
  488. setInterval(function() {
  489. const color1 = hotbarmaincolorinput.value;
  490. const color2 = hotbarbordercolorinput.value
  491. const hotbarrounding = hotbarborderradiusinput.value;
  492. const hotbars = document.querySelectorAll(".item");
  493. hotbars.forEach(function(hotbar) {
  494. hotbar.style.borderRadius = hotbarrounding + "px";
  495. hotbar.style.borderColor = color2;
  496. hotbar.style.backgroundColor = color1;
  497. });
  498. const crosshair = document.querySelector(".CrossHair");
  499. if (crosshair) {
  500. crosshair.textContent = "";
  501. crosshair.style.backgroundImage = crosshairurl; // Use the crosshairurl variable here
  502. crosshair.style.backgroundRepeat = "no-repeat";
  503. crosshair.style.backgroundSize = "contain";
  504. crosshair.style.width = "30px";
  505. crosshair.style.height = "30px";
  506. }
  507. }, 1000);
  508. })();