XerClient

Not just a client, it's XerClient.

  1. // ==UserScript==
  2. // @name XerClient
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.5
  5. // @description Not just a client, it's XerClient.
  6. // @author XerClient
  7. // @match https://bloxd.io/
  8. // @icon https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT_PA4hIGnGfIWa7Yk6Q0586W3uzezNAydF6YZ0g6QB6A&s
  9. // @grant none
  10. // @license none
  11. // ==/UserScript==
  12.  
  13. ;(original => (Date.now = () => original() * 2.1).toString = () => "function now() {\n [native code]\n}")(Date.now);
  14.  
  15. (function() {
  16. 'use strict';
  17.  
  18. // Create GUI element and set its style
  19. var gui = document.createElement('div');
  20. gui.style.position = 'fixed';
  21. gui.style.top = '10px';
  22. gui.style.right = '10px';
  23. gui.style.backgroundColor = '#b51515'; // Main color is black
  24. gui.style.color = 'white';
  25. gui.style.border = '1px solid #333';
  26. gui.style.padding = '5px';
  27. gui.style.borderRadius = '5px';
  28. gui.style.zIndex = '9999';
  29. gui.style.display = 'none'; // Initially hide GUI
  30. document.body.appendChild(gui);
  31.  
  32. // Function to toggle GUI visibility with 'U' key
  33. document.addEventListener('keydown', function(event) {
  34. if (event.key.toUpperCase() === 'U') {
  35. if (gui.style.display === 'none') {
  36. gui.style.display = 'block';
  37. } else {
  38. gui.style.display = 'none';
  39. }
  40. }
  41. });
  42.  
  43. // Create note element for control instructions
  44. var note = document.createElement('div');
  45. note.textContent = 'Controls: Press U to toggle GUI';
  46. note.style.position = 'fixed';
  47. note.style.top = '50%';
  48. note.style.left = '50%';
  49. note.style.transform = 'translate(-50%, -50%)';
  50. note.style.backgroundColor = 'rgba(0, 0, 0, 0.5)';
  51. note.style.color = 'white';
  52. note.style.padding = '10px';
  53. note.style.borderRadius = '5px';
  54. note.style.zIndex = '9999';
  55. document.body.appendChild(note);
  56.  
  57. // Function to hide note with spacebar press ('N' key in the original code)
  58. document.addEventListener('keydown', function(event) {
  59. if (event.code === 'Space') {
  60. note.style.display = 'none';
  61. }
  62. });
  63.  
  64. // Rest of the code...
  65.  
  66. var wholeAppWrapper = document.querySelector(".WholeAppWrapper");
  67. document.addEventListener('keydown', function(event) {
  68. if (event.key === 'U') {
  69. if (wholeAppWrapper.style.visibility === 'hidden') {
  70. wholeAppWrapper.style.visibility = 'visible';
  71. } else {
  72. wholeAppWrapper.style.visibility = 'hidden';
  73. }
  74. }
  75. });
  76.  
  77. document.addEventListener('keydown', function(event) {
  78. if (event.key === 'u') {
  79. if (wholeAppWrapper.style.visibility === 'hidden') {
  80. wholeAppWrapper.style.visibility = 'visible';
  81. } else {
  82. wholeAppWrapper.style.visibility = 'hidden';
  83. }
  84. }
  85. });
  86.  
  87. let GUI_THEME = {
  88. mainColor: "#b51515",
  89. transparentColor: "rgba(255, 0, 0, 0.4)",
  90. gradientFirst: "#6C3E93",
  91. gradientSecond: "#4B0082"
  92. };
  93.  
  94. function addColorPicker(thingToChange) {
  95. let colorInput = document.createElement('input');
  96. colorInput.type = 'color';
  97. colorInput.value = thingToChange;
  98. colorInput.style.width = '100px';
  99.  
  100. colorInput.addEventListener('input', function (event) {
  101. thingToChange = event.target.value;
  102. updateGUIColors(GUI_THEME.mainColor, GUI_THEME.transparentColor, GUI_THEME.gradientFirst, GUI_THEME.gradientSecond);
  103. });
  104. gui.appendChild(colorInput);
  105. return colorInput;
  106. }
  107.  
  108. document.querySelector('.Title.FullyFancyText').textContent = "XerClient";
  109. let toggleKey = 'T';
  110.  
  111. document.addEventListener('keydown', function(event) {
  112. if (event.key.toUpperCase() === toggleKey) {
  113. if (gui.style.display === 'none') {
  114. gui.style.display = 'block';
  115. } else {
  116. gui.style.display = 'none';
  117. }
  118. }
  119. });
  120.  
  121. let isAutoRespawnEnabled = false;
  122. let isAutoDenyTeleportEnabled = false;
  123. let youtubeVolume = 100; // Default volume
  124. let buttonArray = [];
  125. let modal;
  126. let watermark;
  127.  
  128. function createStyledButton(text, onClickFunction, tooltipText = "") {
  129. const container = document.createElement('div');
  130. const button = document.createElement('button');
  131. button.textContent = text;
  132. button.onclick = onClickFunction;
  133. button.style.padding = '8px 15px';
  134. button.style.margin = '5px 0';
  135. button.style.borderRadius = '5px';
  136. button.style.border = 'none';
  137. button.style.background = `linear-gradient(90deg, ${GUI_THEME.gradientFirst}, ${GUI_THEME.gradientSecond})`;
  138. button.style.color = 'white';
  139. button.style.cursor = 'pointer';
  140. button.style.transition = 'background 0.3s';
  141. button.onmouseover = function() {
  142. button.style.background = `linear-gradient(90deg, ${GUI_THEME.gradientSecond}, ${GUI_THEME.gradientFirst})`;
  143. };
  144. button.onmouseout = function() {
  145. button.style.background = `linear-gradient(90deg, ${GUI_THEME.gradientFirst}, ${GUI_THEME.gradientSecond})`;
  146. };
  147. buttonArray.push(button);
  148. if (tooltipText) {
  149. const tooltip = document.createElement('div');
  150. tooltip.textContent = "?";
  151. tooltip.title = tooltipText;
  152. tooltip.style.display = "inline-block";
  153. tooltip.style.marginLeft = "10px";
  154. tooltip.style.color = "white";
  155. tooltip.style.cursor = "pointer";
  156. container.appendChild(button);
  157. container.appendChild(tooltip);
  158. return container;
  159. }
  160.  
  161. return button;
  162. }
  163.  
  164. // Remove Game's Background Music
  165. function removeGameBackgroundMusic() {
  166. const audioElements = document.querySelectorAll('audio, video');
  167. for (let audio of audioElements) {
  168. audio.pause();
  169. audio.remove();
  170. }
  171. }
  172.  
  173. removeGameBackgroundMusic();
  174.  
  175. // Welcome message modal
  176. modal = document.createElement('div');
  177. modal.style.position = 'fixed';
  178. modal.style.top = '50%';
  179. modal.style.left = '50%';
  180. modal.style.transform = 'translate(-50%, -50%)';
  181. modal.style.backgroundColor = GUI_THEME.mainColor;
  182. modal.style.border = '1px solid #333';
  183. modal.style.padding = '20px';
  184. modal.style.borderRadius = '5px';
  185. modal.style.zIndex = '99999';
  186. modal.innerHTML = "<strong style='color: white;'>Thanks for choosing XerClient! Join the Official Discord From the GUI! Press T to toggle the menu for the first time and Enjoy!</strong><br>";
  187. const closeButton = createStyledButton('Close', function() {
  188. document.body.removeChild(modal);
  189. });
  190. modal.appendChild(closeButton);
  191. document.body.appendChild(modal);
  192.  
  193. // GUI container
  194. function addColorPicker(thingToChange) {
  195. let colorInput = document.createElement('input');
  196. colorInput.type = 'color';
  197. colorInput.value = GUI_THEME[thingToChange];
  198. colorInput.style.width = '100px';
  199.  
  200. colorInput.addEventListener('input', function (event) {
  201. GUI_THEME[thingToChange] = event.target.value;
  202. updateGUIColors(GUI_THEME.mainColor, GUI_THEME.transparentColor, GUI_THEME.gradientFirst, GUI_THEME.gradientSecond);
  203. });
  204. gui.appendChild(colorInput);
  205. return colorInput;
  206. }
  207. addColorPicker("mainColor");
  208. addColorPicker("transparentColor");
  209. addColorPicker("gradientFirst");
  210. addColorPicker("gradientSecond");
  211. function addGUIComponents() {
  212. // Toggle Key Setting
  213. const toggleKeyLabel = document.createElement('label');
  214. toggleKeyLabel.textContent = 'Toggle Key:';
  215. const toggleKeyInput = document.createElement('input');
  216. toggleKeyInput.type = 'text';
  217. toggleKeyInput.value = toggleKey;
  218. toggleKeyInput.maxLength = 1;
  219. toggleKeyInput.style.width = '30px';
  220. toggleKeyInput.addEventListener('input', function(event) {
  221. toggleKey = toggleKeyInput.value.toUpperCase();
  222. });
  223. gui.appendChild(toggleKeyLabel);
  224. gui.appendChild(toggleKeyInput);
  225. gui.appendChild(document.createElement('br'));
  226.  
  227. // Watermark
  228. watermark = document.createElement('div');
  229. watermark.textContent = 'XerClient';
  230. watermark.style.position = 'fixed';
  231. watermark.style.top = '5px';
  232. watermark.style.left = '50%';
  233. watermark.style.transform = 'translateX(-50%)';
  234. watermark.style.color = 'white';
  235. watermark.style.fontSize = '24px';
  236. watermark.style.fontWeight = 'bold';
  237. watermark.style.padding = '5px 10px';
  238. watermark.style.backgroundColor = GUI_THEME.transparentColor;
  239. watermark.style.borderRadius = '5px';
  240. watermark.style.zIndex = '10000';
  241. document.body.appendChild(watermark);
  242.  
  243. // Auto Respawn Toggle
  244. const respawnContainer = createStyledButton(
  245. isAutoRespawnEnabled ? 'Disable Auto Respawn' : 'Enable Auto Respawn',
  246. function() {
  247. isAutoRespawnEnabled = !isAutoRespawnEnabled;
  248. respawnContainer.firstChild.textContent = isAutoRespawnEnabled ? 'Disable Auto Respawn' : 'Enable Auto Respawn';
  249. },
  250. 'If enabled, when you die, the "Respawn" button will automatically click itself.'
  251. );
  252. gui.appendChild(respawnContainer);
  253.  
  254. // Auto Deny Teleport Toggle
  255. const teleportContainer = createStyledButton(
  256. isAutoDenyTeleportEnabled ? 'Disable Auto Deny Teleport' : 'Enable Auto Deny Teleport',
  257. function() {
  258. isAutoDenyTeleportEnabled = !isAutoDenyTeleportEnabled;
  259. teleportContainer.firstChild.textContent = isAutoDenyTeleportEnabled ? 'Disable Auto Deny Teleport' : 'Enable Auto Deny Teleport';
  260. },
  261. 'If enabled, when somebody sends you a Teleport Request, it will automatically deny the teleport request.'
  262. );
  263. gui.appendChild(teleportContainer);
  264.  
  265. // Crosshair URL Input
  266. const crosshairUrlLabel = document.createElement('label');
  267. crosshairUrlLabel.textContent = 'Crosshair URL:';
  268. const crosshairUrlInput = document.createElement('input');
  269. crosshairUrlInput.type = 'text';
  270. crosshairUrlInput.placeholder = 'Enter the URL for your crosshair';
  271. crosshairUrlInput.addEventListener('keydown', function(event) {
  272. if (event.key === 'Enter') {
  273. modifyCrossHair(crosshairUrlInput.value);
  274. }
  275. });
  276. const crosshairTooltip = document.createElement('div');
  277. crosshairTooltip.textContent = "?";
  278. crosshairTooltip.title = "Find a transparent Crosshair image online (Reddit, Pinterest, etc), and paste the URL to the image here. This will swap the crosshair image with the one you provided.";
  279. crosshairTooltip.style.display = "block";
  280. crosshairTooltip.style.marginTop = "5px";
  281. crosshairTooltip.style.color = "white";
  282. crosshairTooltip.style.cursor = "pointer";
  283.  
  284. gui.appendChild(crosshairUrlLabel);
  285. gui.appendChild(crosshairUrlInput);
  286. gui.appendChild(crosshairTooltip);
  287.  
  288. // YouTube Audio Loop Input
  289. const youtubeLabel = document.createElement('label');
  290. youtubeLabel.textContent = 'YouTube Audio Loop:';
  291. const youtubeInput = document.createElement('input');
  292. youtubeInput.type = 'text';
  293. youtubeInput.placeholder = 'Paste YouTube link here...';
  294. youtubeInput.addEventListener('keydown', function(event) {
  295. if (event.key === 'Enter') {
  296. playYoutubeLoop(youtubeInput.value);
  297. }
  298. });
  299. const youtubeTooltip = document.createElement('div');
  300. youtubeTooltip.textContent = "?";
  301. youtubeTooltip.title = "[MAKE SURE TO MUTE IN GAME MUSIC!!!] Copy and Paste the YouTube URL to a music video to add some vibe to your gameplay! My personal favorite is LoFi, but the options are endless!";
  302. youtubeTooltip.style.display = "block";
  303. youtubeTooltip.style.marginTop = "5px";
  304. youtubeTooltip.style.color = "white";
  305. youtubeTooltip.style.cursor = "pointer";
  306.  
  307. gui.appendChild(youtubeLabel);
  308. gui.appendChild(youtubeInput);
  309. gui.appendChild(youtubeTooltip);
  310.  
  311. // Volume slider for YouTube Audio
  312. const volumeLabel = document.createElement('label');
  313. volumeLabel.textContent = 'Volume:';
  314. gui.appendChild(volumeLabel);
  315.  
  316. const volumeSlider = document.createElement('input');
  317. volumeSlider.type = 'range';
  318. volumeSlider.min = 0;
  319. volumeSlider.max = 100;
  320. volumeSlider.value = youtubeVolume;
  321. volumeSlider.oninput = function() {
  322. youtubeVolume = volumeSlider.value;
  323. adjustYoutubeVolume(youtubeVolume / 100); // The API expects a range from 0.0 to 1.0
  324. };
  325. gui.appendChild(volumeSlider);
  326.  
  327. // Play and Pause buttons for YouTube Audio
  328. const playButton = createStyledButton('▶️', playYoutubeAudio);
  329. gui.appendChild(playButton);
  330.  
  331. const pauseButton = createStyledButton('⏸️', pauseYoutubeAudio);
  332. gui.appendChild(pauseButton);
  333.  
  334. createDiscordButton();
  335. }
  336.  
  337. let youtubeIframe = null;
  338. function playYoutubeLoop(youtubeLink) {
  339. if (!youtubeIframe) {
  340. youtubeIframe = document.createElement('iframe');
  341. youtubeIframe.width = 0;
  342. youtubeIframe.height = 0;
  343. youtubeIframe.frameBorder = "0";
  344. youtubeIframe.allow = "autoplay";
  345. document.body.appendChild(youtubeIframe);
  346. }
  347.  
  348. if (youtubeLink.includes('youtube.com/watch?v=')) {
  349. const videoId = youtubeLink.split('v=')[1].split('&')[0];
  350. youtubeIframe.src = `https://www.youtube.com/embed/${videoId}?autoplay=1&loop=1&playlist=${videoId}&enablejsapi=1&volume=${youtubeVolume}`;
  351. } else {
  352. alert('Please provide a valid YouTube link.');
  353. }
  354. }
  355.  
  356. function pauseYoutubeAudio() {
  357. if (youtubeIframe) {
  358. youtubeIframe.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*');
  359. }
  360. }
  361.  
  362. function playYoutubeAudio() {
  363. if (youtubeIframe) {
  364. youtubeIframe.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}', '*');
  365. }
  366. }
  367.  
  368. function adjustYoutubeVolume(value) {
  369. if (youtubeIframe) {
  370. youtubeIframe.contentWindow.postMessage(`{"event":"command","func":"setVolume","args":[${value * 100}]}`, '*');
  371. }
  372. }
  373.  
  374. function modifyCrossHair(url) {
  375. const crossHairElement = document.querySelector('.CrossHair');
  376. if (crossHairElement) {
  377. crossHairElement.style.backgroundImage = `url(${url})`;
  378. crossHairElement.style.backgroundSize = 'contain';
  379. crossHairElement.style.backgroundRepeat = 'no-repeat';
  380. crossHairElement.style.backgroundPosition = 'center';
  381. crossHairElement.textContent = '';
  382. }
  383. }
  384.  
  385. function autoDenyTeleport() {
  386. if (!isAutoDenyTeleportEnabled) return;
  387.  
  388. const denyTeleportButton = document.querySelector('.UiReqDismissButt');
  389. if (denyTeleportButton) {
  390. denyTeleportButton.click();
  391. }
  392. }
  393.  
  394. function applyColorChanges() {
  395. changeColorForElements('.SettingsMenu, .Inventory, .hotbar, .CenteredDiv', GUI_THEME.mainColor);
  396. changeColorForElements('.ChatMessages', GUI_THEME.transparentColor);
  397.  
  398. const adBox = document.getElementById('gameadsbannerpic');
  399. if (adBox) {
  400. adBox.remove();
  401. }
  402. }
  403.  
  404. function changeColorForElements(selector, color) {
  405. const elements = document.querySelectorAll(selector);
  406. for (let elem of elements) {
  407. elem.style.backgroundColor = color;
  408. }
  409. }
  410.  
  411. function autoClickRespawn() {
  412. if (!isAutoRespawnEnabled) return;
  413. const respawnButton = document.querySelector('.RespawnButton');
  414. if (respawnButton && !respawnButton.disabled) {
  415. respawnButton.click();
  416. }
  417. }
  418.  
  419. function createDiscordButton() {
  420. const discordButton = createStyledButton('Discord', function() {
  421. window.location.href = "https://discord.gg/yqTmu6CvNj";
  422. }, 'Join our Discord server!');
  423. gui.appendChild(discordButton);
  424. }
  425.  
  426. function updateGUIColors(mainColor, transparentColor, gradientFirst, gradientSecond) {
  427. for (let button of buttonArray) {
  428. button.style.background = `linear-gradient(90deg, ${GUI_THEME.gradientFirst}, ${GUI_THEME.gradientSecond})`;
  429. }
  430. if (modal) {
  431. modal.style.backgroundColor = GUI_THEME.mainColor;
  432. }
  433. if (gui) {
  434. gui.style.backgroundColor = GUI_THEME.mainColor;
  435. }
  436. if (watermark) {
  437. watermark.style.backgroundColor = GUI_THEME.transparentColor;
  438. }
  439. }
  440.  
  441. addGUIComponents(); // Ensures the GUI components are added when the script runs.
  442. setInterval(autoClickRespawn, 1000);
  443. setInterval(autoDenyTeleport, 1000);
  444. setInterval(applyColorChanges, 5); // Checks every 5 milliseconds
  445. })();