melon client || bloxd.io cheats

like steroids for bloxd.io

目前为 2024-12-21 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name melon client || bloxd.io cheats
  3. // @namespace http://bloxd.io
  4. // @version 2024-12-21
  5. // @description like steroids for bloxd.io
  6. // @author officiallymelon
  7. // @match https://bloxd.io/*
  8. // @icon https://github.com/OfficiallyMelon/files-cdn/blob/main/bloxd_io/melon.png?raw=true
  9. // @grant none
  10. // @run-at document-start
  11. // @license GPL-3.0-or-later
  12. // ==/UserScript==
  13.  
  14. (function () {
  15. 'use strict';
  16.  
  17. const loggedScripts = new Set();
  18.  
  19. function extractPrefix(filename) {
  20. const prefix = filename.split('.')[0];
  21. return prefix;
  22. }
  23.  
  24. function extractFilename(url) {
  25. const urlObject = new URL(url);
  26. const path = urlObject.pathname;
  27. const filename = path.substring(path.lastIndexOf('/') + 1);
  28. return filename;
  29. }
  30.  
  31. function checkGitHubPrefix(prefix) {
  32. fetch('https://api.github.com/repos/OfficiallyMelon/files-cdn/contents/bloxd_io/bloxd.io/static/js')
  33. .then(response => response.json())
  34. .then(data => {
  35. let foundPrefix = false;
  36.  
  37. data.forEach(item => {
  38. const filename = item.name;
  39. if (filename.startsWith(prefix)) {
  40. foundPrefix = true;
  41. }
  42. });
  43.  
  44. if (!foundPrefix) {
  45. alert('Script Down: Please wait for an update!')
  46. }
  47. })
  48. .catch(error => console.error('Error fetching data from GitHub API:', error));
  49. }
  50.  
  51. // Function to log bloxd.io script prefixes
  52. function logBloxdScripts() {
  53. const scripts = document.querySelectorAll('script[src]');
  54. scripts.forEach((script) => {
  55. if (
  56. script.src.includes('bloxd.io') &&
  57. !loggedScripts.has(script.src)
  58. ) {
  59. loggedScripts.add(script.src);
  60. const filename = extractFilename(script.src);
  61. const prefix = extractPrefix(filename);
  62. console.log('Bloxd.io script prefix:', prefix);
  63.  
  64. checkGitHubPrefix(prefix);
  65. }
  66. });
  67. }
  68.  
  69. const observer = new MutationObserver((mutations) => {
  70. mutations.forEach((mutation) => {
  71. if (mutation.type === 'childList') {
  72. mutation.addedNodes.forEach((node) => {
  73. if (node.tagName === 'SCRIPT' && node.src.includes('bloxd.io')) {
  74. logBloxdScripts();
  75. }
  76. });
  77. }
  78. });
  79. });
  80.  
  81. observer.observe(document.body, { childList: true, subtree: true });
  82.  
  83. function waitForFirstScript() {
  84. const firstScript = document.querySelector('script[src]');
  85. if (firstScript) {
  86. console.log('First script found:', firstScript.src);
  87. logBloxdScripts();
  88. } else {
  89. setTimeout(waitForFirstScript, 500);
  90. }
  91. }
  92.  
  93. waitForFirstScript();
  94. })();
  95.  
  96. (function() {
  97. (() => {
  98. const img = document.createElement('img');
  99. img.src = 'https://github.com/OfficiallyMelon/files-cdn/blob/main/Credits.png?raw=true';
  100. img.style.position = 'fixed';
  101. img.style.bottom = '10px';
  102. img.style.right = '10px';
  103. img.style.width = '350px';
  104. img.style.height = 'auto';
  105. img.style.zIndex = '10000';
  106. document.body.appendChild(img);
  107. })();
  108.  
  109. const loadGoogleFont = (fontName) => {
  110. const link = document.createElement('link');
  111. link.href = `https://fonts.googleapis.com/css2?family=${fontName.replace(/ /g, '+')}`;
  112. link.rel = 'stylesheet';
  113. document.head.appendChild(link);
  114. };
  115. loadGoogleFont('Roboto');
  116.  
  117. const MelonMenu = () => {
  118. alert('Thank you for using Melon Client (cheats), we require local overrides to be added for this cheat to work, you can find more info on the greasyfork description.')
  119. const menu = document.createElement('div');
  120. menu.style.position = 'fixed';
  121. menu.style.top = '20px';
  122. menu.style.left = '20px';
  123. menu.style.width = '500px';
  124. menu.style.backgroundColor = '#F7B2BD';
  125. menu.style.border = '2px solid #ffffff';
  126. menu.style.color = '#ffffff';
  127. menu.style.fontFamily = "'Roboto', Arial, sans-serif";
  128. menu.style.fontSize = '14px';
  129. menu.style.boxShadow = '0 0 10px rgba(0, 0, 0, 0.5)';
  130. menu.style.borderRadius = '8px';
  131. menu.style.zIndex = '10000';
  132. menu.style.padding = '10px';
  133. menu.style.cursor = 'move';
  134.  
  135. const tabs = ['Combat', 'Player', 'Movement'];
  136. const tabContainer = document.createElement('div');
  137. tabContainer.style.display = 'flex';
  138. tabContainer.style.justifyContent = 'space-around';
  139. tabContainer.style.backgroundColor = '#E34A6F';
  140. tabContainer.style.padding = '5px';
  141. tabContainer.style.borderRadius = '5px 5px 0 0';
  142. tabContainer.style.marginBottom = '10px';
  143.  
  144. tabs.forEach((tab) => {
  145. const tabElement = document.createElement('div');
  146. tabElement.textContent = tab;
  147. tabElement.style.color = '#ffffff';
  148. tabElement.style.cursor = 'pointer';
  149. tabElement.style.padding = '5px 10px';
  150. tabElement.style.fontWeight = 'bold';
  151. tabElement.style.borderRadius = '4px';
  152. tabElement.style.transition = 'background-color 0.3s';
  153. tabElement.style.fontFamily = "'Roboto', Arial, sans-serif";
  154. tabContainer.appendChild(tabElement);
  155. });
  156.  
  157. menu.appendChild(tabContainer);
  158.  
  159. const columnsContainer = document.createElement('div');
  160. columnsContainer.style.display = 'flex';
  161. columnsContainer.style.justifyContent = 'space-between';
  162. columnsContainer.style.gap = '10px';
  163.  
  164. const columnData = [
  165. ['Anti Knockback', 'Anti Cam Shake', 'Reach', 'Auto Clicker'],
  166. ['Scaffold', 'Account Gen'],
  167. ['Speed', 'High Jump', 'Infinite Jump', 'Secure Edge'],
  168. ];
  169.  
  170. const loadButtonStates = () => {
  171. return JSON.parse(localStorage.getItem('buttonStates') || '{}');
  172. };
  173.  
  174. const saveButtonStates = (states) => {
  175. localStorage.setItem('buttonStates', JSON.stringify(states));
  176. };
  177.  
  178. const buttonStates = loadButtonStates();
  179. const buttonsMap = {};
  180.  
  181. columnData.forEach((columnItems) => {
  182. const column = document.createElement('div');
  183. column.style.flex = '1';
  184. column.style.backgroundColor = '#F7B2BD';
  185. column.style.padding = '0px';
  186. column.style.borderRadius = '0px';
  187.  
  188. columnItems.forEach((item) => {
  189. const itemElement = document.createElement('div');
  190. itemElement.textContent = item;
  191. itemElement.style.backgroundColor = buttonStates[item] ? '#4E954F' : '#F7B2BD';
  192. itemElement.style.margin = '0px 0';
  193. itemElement.style.padding = '5px';
  194. itemElement.style.borderRadius = '0px';
  195. itemElement.style.textAlign = 'center';
  196. itemElement.style.cursor = 'pointer';
  197. itemElement.style.transition = 'background-color 0.1s';
  198. itemElement.style.fontFamily = "'Roboto', Arial, sans-serif";
  199.  
  200. let isSelected = !!buttonStates[item];
  201.  
  202. itemElement.onmouseover = () => {
  203. if (!isSelected) itemElement.style.backgroundColor = '#4E954F';
  204. };
  205. itemElement.onmouseout = () => {
  206. if (!isSelected) itemElement.style.backgroundColor = '#F7B2BD';
  207. };
  208.  
  209. itemElement.onclick = () => {
  210. isSelected = !isSelected;
  211. itemElement.style.backgroundColor = isSelected ? '#4E954F' : '#F7B2BD';
  212. buttonStates[item] = isSelected;
  213. saveButtonStates(buttonStates);
  214.  
  215. // Apply the button actions based on saved state
  216. if (item === 'Account Gen') {
  217. document.cookie.split(';').forEach((cookie) => {
  218. if (cookie.trim().startsWith('___Secure-3PSIDMC=')) {
  219. document.cookie = cookie.split('=')[0] + '=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/';
  220. }
  221. });
  222. location.reload();
  223. }
  224. if (item === 'Speed') {
  225. window.GlobalSpeed = isSelected ? 7.5 : 5;
  226. }
  227. if (item === 'Infinite Jump') {
  228. window.AirJump = isSelected ? 999999999999 : 0;
  229. }
  230. if (item === 'High Jump') {
  231. window.JumpAmount = isSelected ? 3 : 0;
  232. }
  233. if (item === 'Reach') {
  234. window.reach = isSelected ? 25 : 1;
  235. }
  236. if (item === 'Scaffold') {
  237. window.scaffold = isSelected ? true : false;
  238. }
  239. if (item == 'Anti Knockback') {
  240. window.antiknock = isSelected ? true : false;
  241. }
  242. if (item == 'Anti Cam Shake') {
  243. window.camshake = isSelected ? true : false;
  244. }
  245. if (item == 'Secure Edge') {
  246. window.preventfalloff = isSelected ? true : false;
  247. }
  248. if (item == 'Auto Clicker') {
  249. window.autoclick = isSelected ? true : false
  250. }
  251. };
  252.  
  253. column.appendChild(itemElement);
  254. buttonsMap[item] = itemElement;
  255.  
  256. // Apply initial button state to global variables when the page loads
  257. if (buttonStates[item]) {
  258. itemElement.click();
  259. }
  260. });
  261.  
  262. columnsContainer.appendChild(column);
  263. });
  264.  
  265. menu.appendChild(columnsContainer);
  266.  
  267. let isDragging = false;
  268. let offsetX, offsetY;
  269.  
  270. menu.addEventListener('mousedown', (e) => {
  271. isDragging = true;
  272. offsetX = e.clientX - menu.offsetLeft;
  273. offsetY = e.clientY - menu.offsetTop;
  274. menu.style.transition = 'none';
  275. });
  276.  
  277. document.addEventListener('mousemove', (e) => {
  278. if (isDragging) {
  279. menu.style.left = `${e.clientX - offsetX}px`;
  280. menu.style.top = `${e.clientY - offsetY}px`;
  281. }
  282. });
  283.  
  284. document.addEventListener('mouseup', () => {
  285. isDragging = false;
  286. });
  287.  
  288. document.body.appendChild(menu);
  289.  
  290. document.addEventListener('keydown', (e) => {
  291. if (e.ctrlKey && e.key.toLowerCase() === 'c') {
  292. const scaffoldButton = buttonsMap['Scaffold'];
  293. if (scaffoldButton) {
  294. scaffoldButton.click();
  295. }
  296. }
  297. });
  298. };
  299. MelonMenu();
  300. })();