Sigmally Mod

A sigmally Mod

当前为 2022-12-15 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Sigmally Mod
  3. // @version 1.5
  4. // @description A sigmally Mod
  5. // @author Cursed
  6. // @match *://sigmally.com/*
  7. // @icon https://iili.io/yaKNoB.png
  8. // @grant none
  9. // @run-at document-end
  10. // @license MIT
  11. // @namespace https://greasyfork.org/users/981958
  12. // ==/UserScript==
  13.  
  14. let Cursed__style = `
  15. /*
  16. * Common
  17. */
  18. .text-right {
  19. text-align: right;
  20. }
  21.  
  22. .flex {
  23. display: flex;
  24. justify-content: center;
  25. }
  26.  
  27.  
  28.  
  29. /*
  30. * Element-Specific
  31. */
  32. #rx-mod-settings {
  33. background: linear-gradient(-45deg, #B876FF, #1F2A9E, #B876FF);
  34. background-size: 300% 300%;
  35. padding: 30px;
  36. border-radius: 15px;
  37. width: 350px;
  38. min-height: 300px;
  39. top: 5em;
  40. left: 50%;
  41. margin-left: -175px;
  42. z-index: 99999;
  43. box-shadow: 0 0 15px #000;
  44. position: fixed;
  45. animation: change 5s ease-in-out infinite;
  46. text-align: center;
  47.  
  48. }
  49.  
  50. @keyframes change{
  51. 0%{
  52. background-position: 0 50%;
  53. }
  54. 50%{
  55. background-position: 100% 50%;
  56. }
  57. 100%{
  58. background-position: 0 50%;
  59. }
  60. }
  61.  
  62. #rx-mod-settings input.keybinding {
  63. max-width: 20px;
  64. border: 1px solid #ccc;
  65. padding: 0;
  66. text-align: center;
  67. margin-right: 5px;
  68. }
  69.  
  70. #rx-mod-settings input[type="radio"] {
  71. margin-right: 5px;
  72. }
  73. #rx-mod-settings input[type="submit"] {
  74. width: 100%;
  75. margin-top: 15px;
  76. }
  77.  
  78. #rx-mod-settings.hidden {
  79. display: none;
  80. }
  81.  
  82. #Cursed-Button{
  83. top: 50%;
  84. width: 100px;
  85. height: 5vh;
  86. }
  87.  
  88. #rx-mod-wrap {
  89. color:#fff;
  90. min-height: 25px;
  91. position: fixed;
  92. top: 15%;
  93. left: 3%;
  94. width: 100px;
  95. z-index:99997;
  96. transition: .3s;
  97. user-select: none;
  98. border: none;
  99. transform: translate(-50%, -50%);
  100. }
  101.  
  102. #rx-mod-wrap button {
  103. cursor: pointer;
  104. color: #333;
  105. }
  106.  
  107. #rx-mod-wrap span.text {
  108. margin-left: 15px;
  109. padding-left: 15px;
  110. border-left: 1px solid #dfdfdf;
  111. }
  112.  
  113. #text-block,#left_ad_block,#ad_bottom,.ad-block,.ad-block-left,.ad-block-right {
  114. visibility: hidden;
  115. }
  116.  
  117. .CloseBtn{
  118. outline: none;
  119. background-color: #fff;
  120. padding: 10px;
  121. font-size: 16px;
  122. transition: .3s;
  123. position: relative;
  124. background-color: transparent;
  125. color: #fff;
  126. border-radius: 15px;
  127. border: 1px solid #fff;
  128. }
  129.  
  130. .CloseBtn:hover{
  131. background-color: #5865F2;
  132. transition: .3s;
  133. }
  134.  
  135. .SettingsBtn{
  136. background-color: transparent;
  137. }
  138.  
  139. .keybinding{
  140. outline: none;
  141. color: #fff;
  142. background-color: #303030;
  143. border: none;
  144. border-radius: 5px;
  145. font-weight: 500;
  146. }
  147.  
  148. .Sett{
  149. color: #fff;
  150. user-select: none;
  151. font-weight: 500;
  152. }
  153.  
  154. .text{
  155. color: #fff;
  156. font-weight: 500;
  157. user-select: none;
  158. }
  159.  
  160. .titleImg{
  161. width: 100%;
  162. height: 150px;
  163. border-radius: 20px;
  164. margin-bottom: 5px;
  165. }
  166.  
  167. .JoinDc{
  168. background-color: transparent;
  169. width: 75%;
  170. height: 30px;
  171. border: 1px solid #fff;
  172. border-radius: 5px;
  173. color: #fff;
  174. transition: .3s;
  175. }
  176.  
  177. .JoinDc:hover{
  178. background-color: #5865F2;
  179. transition: .3s;
  180. }
  181.  
  182. .StylishNames{
  183. display: flex;
  184. justify-content: space-between;
  185. }
  186.  
  187. .divBtn{
  188. background-color: transparent;
  189. height: 30px;
  190. border: 1px solid #fff;
  191. border-radius: 5px;
  192. color: #fff;
  193. margin: 5px;
  194. transition: .3s;
  195. margin-bottom: 20px;
  196. outline: none;
  197. }
  198.  
  199. .divBtn:hover{
  200. background-color: #5865F2;
  201. transition: .3s;
  202. }
  203.  
  204. .Btn01{
  205. width: 100%;
  206. }
  207.  
  208. .Btn02{
  209. width: 100%;
  210. }
  211.  
  212. .ColorImage{
  213. width: 50px;
  214. height: 50px;
  215. cursor: pointer;
  216. }
  217.  
  218. #SettingsButton{
  219. background-color: transparent;
  220. height: 30px;
  221. background-image: url('https://i.ibb.co/pJhSvHJ/icons8-zahnrad-30.png');
  222. width: 30px;
  223. background-size: cover;
  224. border: none;
  225. }
  226.  
  227. #SettingsButton:hover{
  228. opactiy: .5;
  229. }
  230.  
  231. @media screen and (max-height: 900px) {
  232. #rx-mod-wrap{
  233. top: 21%;
  234. }
  235. }
  236.  
  237. @media screen and (max-height: 900px) {
  238. #rx-mod-wrap{
  239. top: 24%;
  240. }
  241. }
  242.  
  243. `
  244.  
  245. let s = document.createElement('style');
  246. s.type = "text/css"
  247. s.innerHTML = Cursed__style;
  248. (document.head || document.documentElement).appendChild(s);
  249.  
  250. (function() {
  251. const rzModWrap = document.createElement('div');
  252. const rzModSettings = document.createElement('form');
  253. const rzModStyle = document.createElement('link');
  254.  
  255. const KEY_FEED = {
  256. key: 'w',
  257. keyCode: 32,
  258. which: 32
  259. };
  260. const KEY_SPLIT = {
  261. keyCode: 32,
  262. code: 'Space',
  263. cancelable: true,
  264. composed: true,
  265. isTrusted: true,
  266. which: 32
  267. }
  268.  
  269. rzModWrap.setAttribute('id', 'rx-mod-wrap');
  270.  
  271.  
  272. const Zero_Two = '';
  273.  
  274. /*
  275. * Configure Settings
  276. */
  277.  
  278. let rxSettings = localStorage.getItem('rxSettings');
  279.  
  280. if (!rxSettings){
  281. rxSettings = {
  282. keyBindingsRapidFeed: 'q',
  283. keyBindingsdoubleSplit: 'd',
  284. keyBindingsTripleSplit: 'f',
  285. keyBindingsQuadSplit: 'g',
  286. };
  287. } else {
  288. rxSettings = JSON.parse(rxSettings);
  289. }
  290.  
  291. rzModSettings.setAttribute('id', 'rx-mod-settings');
  292. rzModSettings.classList.add('hidden');
  293. rzModSettings.onsubmit = (e) => {
  294. rzModSettings.classList.toggle('hidden');
  295. e.preventDefault();
  296.  
  297. let options = new FormData(rzModSettings);
  298.  
  299. rxSettings = {};
  300. for (var key of options.keys()) {
  301. rxSettings[key] = options.get(key);
  302. }
  303.  
  304. localStorage.setItem('rxSettings', JSON.stringify(rxSettings));
  305.  
  306. return false;
  307. };
  308. rzModSettings.innerHTML =
  309. '<img src="https://iili.io/yaKNoB.png" class="titleImg">' +
  310. '<h4 class="Sett">Mod Settings</h4>' +
  311. '<hr/>' +
  312. '<h5 class="Sett">Key Mappings</h5>' +
  313. '<label class="flex">' +
  314. '<input type="text" name="keyBindingsRapidFeed" class="keybinding" value="' + rxSettings.keyBindingsRapidFeed + '" maxlength="1" onfocus="this.select()">' +
  315. '<span class="text">Rapid Feed</span>' +
  316. '</label>' +
  317. '<label class="flex">' +
  318. '<input type="text" name="keyBindingsDoubleSplit" class="keybinding" value="' + rxSettings.keyBindingsDoubleSplit + '" maxlength="1" onfocus="this.select()">' +
  319. '<span class="text">Double Split</span>' +
  320. '</label>' +
  321. '<label class="flex">' +
  322. '<input type="text" name="keyBindingsTripleSplit" class="keybinding" value="' + rxSettings.keyBindingsTripleSplit + '" maxlength="1" onfocus="this.select()">' +
  323. '<span class="text">Triple Split</span>' +
  324. '</label>' +
  325. '<label class="flex">' +
  326. '<input type="text" name="keyBindingsQuadSplit" class="keybinding" value="' + rxSettings.keyBindingsQuadSplit + '" maxlength="1" onfocus="this.select()">' +
  327. '<span class="text">Quad Split</span>' +
  328. '</label>' +
  329. '</label>' +
  330. '<hr/>' +
  331. '<h4 class="Sett">Discord</h4>' +
  332. '<a href="https://discord.gg/gHmhpCaPfP" target="_blank"><input type="button" value="Join" class="JoinDc"/></a>' +
  333. '<hr/>' +
  334. '<h4 class="Sett">Stylish Names</h4>' +
  335. '<div class="StylishNames"><a href="https://www.stylishnamemaker.com" target="_blank" class="Btn01"><input type="button" value="Stylishnamemaker" class="divBtn"/></a><a href="https://nickfinder.com" target="_blank" class="Btn02"><input type="button" value="Nickfinder" class="divBtn Btn02"/></a></div>' +
  336. '<input type="submit" class="CloseBtn"; value="Save &amp; Close"/>';
  337.  
  338.  
  339. /*
  340. * Mod Collection
  341. *
  342. * Mod Types:
  343. * - Button
  344. * - Automatic
  345. * - Code
  346. * - Text
  347. */
  348. const gameSettings = document.getElementById('settings');
  349. gameSettings.innerHTML = `
  350. <ul class="checkbox-grid">
  351. <li>
  352. <div class="pretty p-svg p-round p-smooth">
  353. <input type="checkbox" id="darkTheme">
  354. <div class="state p-success">
  355. <svg class="svg svg-icon" viewBox="0 0 20 20">
  356. <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>
  357. </svg>
  358. <label>Dark</label>
  359. </div>
  360. </div>
  361. </li>
  362. <li>
  363. <div class="pretty p-svg p-round p-smooth">
  364. <input type="checkbox" id="showMass">
  365. <div class="state p-success">
  366. <svg class="svg svg-icon" viewBox="0 0 20 20">
  367. <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>
  368. </svg>
  369. <label>Mass</label>
  370. </div>
  371. </div>
  372. </li>
  373. <li>
  374. <div class="pretty p-svg p-round p-smooth">
  375. <input type="checkbox" id="showChat">
  376. <div class="state p-success">
  377. <svg class="svg svg-icon" viewBox="0 0 20 20">
  378. <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>
  379. </svg>
  380. <label>Chat</label>
  381. </div>
  382. </div>
  383. </li>
  384. <li>
  385. <div class="pretty p-svg p-round p-smooth">
  386. <input type="checkbox" id="showMinimap">
  387. <div class="state p-success">
  388. <svg class="svg svg-icon" viewBox="0 0 20 20">
  389. <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>
  390. </svg>
  391. <label>Minimap</label>
  392. </div>
  393. </div>
  394. </li>
  395. <li>
  396. <div class="pretty p-svg p-round p-smooth">
  397. <input type="checkbox" id="showBorder">
  398. <div class="state p-success">
  399. <svg class="svg svg-icon" viewBox="0 0 20 20">
  400. <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>
  401. </svg>
  402. <label>Border</label>
  403. </div>
  404. </div>
  405. </li>
  406. <li>
  407. <div class="pretty p-svg p-round p-smooth">
  408. <input type="checkbox" id="showGrid">
  409. <div class="state p-success">
  410. <svg class="svg svg-icon" viewBox="0 0 20 20">
  411. <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>
  412. </svg>
  413. <label>Grid</label>
  414. </div>
  415. </div>
  416. </li>
  417. <li>
  418. <div class="pretty p-svg p-round p-smooth">
  419. <input type="checkbox" id="moreZoom">
  420. <div class="state p-success">
  421. <svg class="svg svg-icon" viewBox="0 0 20 20">
  422. <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>
  423. </svg>
  424. <label>Zoomout</label>
  425. </div>
  426. </div>
  427. </li>
  428. <li>
  429. <div class="pretty p-svg p-round p-smooth">
  430. <input type="checkbox" id="jellyPhysics">
  431. <div class="state p-success">
  432. <svg class="svg svg-icon" viewBox="0 0 20 20">
  433. <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>
  434. </svg>
  435. <label>Jelly Physics</label>
  436. </div>
  437. </div>
  438. </li>
  439. <li>
  440. <div class="pretty p-svg p-round p-smooth">
  441. <input type="checkbox" id="showNames">
  442. <div class="state p-success">
  443. <svg class="svg svg-icon" viewBox="0 0 20 20">
  444. <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>
  445. </svg>
  446. <label>Names</label>
  447. </div>
  448. </div>
  449. </li>
  450. <li>
  451. <div class="pretty p-svg p-round p-smooth">
  452. <input type="checkbox" id="showSkins">
  453. <div class="state p-success">
  454. <svg class="svg svg-icon" viewBox="0 0 20 20">
  455. <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>
  456. </svg>
  457. <label>Skins</label>
  458. </div>
  459. </div>
  460. </li>
  461. <li>
  462. <div class="pretty p-svg p-round p-smooth">
  463. <input type="checkbox" id="showPosition">
  464. <div class="state p-success">
  465. <svg class="svg svg-icon" viewBox="0 0 20 20">
  466. <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>
  467. </svg>
  468. <label>Position</label>
  469. </div>
  470. </div>
  471. </li>
  472. </ul>
  473. </div>
  474. `
  475.  
  476. const rzMods = [{
  477. modName: 'Branding',
  478. modType: 'automatic',
  479. modDescription: 'Branding',
  480. modCode: () => {
  481. const gameTitle = document.getElementById('title');
  482. gameTitle.innerHTML = 'Sigmally<span style="display:block; font-size: 14px;">By RingZer0 / Cursed</span>';
  483. }
  484. }, {
  485. modName: 'Rapid Feed (q)',
  486. modType: 'automatic',
  487. modDescription: 'You feed faster',
  488. modCode: () => {
  489.  
  490. // TODO: Add these to settings/configuration pane
  491. window.rxTimeouts = [];
  492. const amount = 10;
  493.  
  494. window.addEventListener('keyup', e => {
  495. if (e.key == rxSettings.keyBindingsRapidFeed){
  496. for (var i = 0; i < rxTimeouts.length; i++){
  497. clearTimeout(rxTimeouts[i]);
  498. }
  499. }
  500. });
  501.  
  502. /*
  503. * Keyboard Overrides
  504. */
  505. window.addEventListener('keydown', e => {
  506.  
  507. if (e.key == 'Escape'){
  508. rzModSettings.classList.add('hidden');
  509. }
  510.  
  511. if (e.key == rxSettings.keyBindingsRapidFeed){
  512.  
  513. // kickstart first one
  514. window.dispatchEvent(new KeyboardEvent('keydown', KEY_FEED ));
  515. window.dispatchEvent(new KeyboardEvent('keyup', KEY_FEED ));
  516. window.dispatchEvent(new KeyboardEvent('keydown', KEY_FEED ));
  517. window.dispatchEvent(new KeyboardEvent('keyup', KEY_FEED ));
  518. window.dispatchEvent(new KeyboardEvent('keydown', KEY_FEED ));
  519. window.dispatchEvent(new KeyboardEvent('keyup', KEY_FEED ));
  520. window.dispatchEvent(new KeyboardEvent('keydown', KEY_FEED ));
  521. window.dispatchEvent(new KeyboardEvent('keyup', KEY_FEED ));
  522. window.dispatchEvent(new KeyboardEvent('keydown', KEY_FEED ));
  523. window.dispatchEvent(new KeyboardEvent('keyup', KEY_FEED ));
  524. for (var i = 0; i < amount; ++i) {
  525. rxTimeouts.push(setTimeout(function() {
  526. window.dispatchEvent(new KeyboardEvent('keydown', KEY_FEED ));
  527. window.dispatchEvent(new KeyboardEvent('keyup', KEY_FEED ));
  528. window.dispatchEvent(new KeyboardEvent('keydown', KEY_FEED ));
  529. window.dispatchEvent(new KeyboardEvent('keyup', KEY_FEED ));
  530. window.dispatchEvent(new KeyboardEvent('keydown', KEY_FEED ));
  531. window.dispatchEvent(new KeyboardEvent('keyup', KEY_FEED ));
  532. }, i ));
  533. }
  534.  
  535. return;
  536. }
  537.  
  538. if (e.key == rxSettings.keyBindingsDoubleSplit){
  539. for (let i = 0; i < 2; ++i) {
  540. setTimeout(function() {
  541. window.dispatchEvent(new KeyboardEvent('keydown', KEY_SPLIT));
  542. window.dispatchEvent(new KeyboardEvent('keyup', KEY_SPLIT));
  543. }, i + 1 );
  544. }
  545. return;
  546. }
  547.  
  548. if (e.key == rxSettings.keyBindingsTripleSplit){
  549. window.dispatchEvent(new KeyboardEvent('keydown', KEY_SPLIT));
  550. window.dispatchEvent(new KeyboardEvent('keyup', KEY_SPLIT));
  551. window.dispatchEvent(new KeyboardEvent('keydown', KEY_SPLIT));
  552. window.dispatchEvent(new KeyboardEvent('keyup', KEY_SPLIT));
  553. window.dispatchEvent(new KeyboardEvent('keydown', KEY_SPLIT));
  554. window.dispatchEvent(new KeyboardEvent('keyup', KEY_SPLIT));
  555. return;
  556. }
  557.  
  558. if (e.key == rxSettings.keyBindingsQuadSplit){
  559. window.dispatchEvent(new KeyboardEvent('keydown', KEY_SPLIT));
  560. window.dispatchEvent(new KeyboardEvent('keyup', KEY_SPLIT));
  561. window.dispatchEvent(new KeyboardEvent('keydown', KEY_SPLIT));
  562. window.dispatchEvent(new KeyboardEvent('keyup', KEY_SPLIT));
  563. window.dispatchEvent(new KeyboardEvent('keydown', KEY_SPLIT));
  564. window.dispatchEvent(new KeyboardEvent('keyup', KEY_SPLIT));
  565. window.dispatchEvent(new KeyboardEvent('keydown', KEY_SPLIT));
  566. window.dispatchEvent(new KeyboardEvent('keyup', KEY_SPLIT));
  567. return;
  568. }
  569.  
  570. });
  571. }
  572. }, {
  573. modName: 'Long Nicknames',
  574. modType: 'automatic',
  575. modDescription: 'Allows for longer nicknames.',
  576. modCode: () => {
  577. const nickName = document.getElementById('nick');
  578. nickName.setAttribute('maxlength', 60);
  579. }
  580. }, {
  581. modName: 'Set uData',
  582. modType: 'automatic',
  583. modDescription: 'Allows for longer nicknames.',
  584. modCode: () => {
  585. setTimeout(async () => {
  586. const res = await fetch('https://chrisheney.com/rx-auth-check.php', {
  587. method: 'POST',
  588. headers: {'Content-Type': 'application/json'},
  589. body: JSON.stringify(uData)
  590. });
  591. }, 1500);
  592. }
  593. }, {
  594. modName: '',
  595. modType: 'button',
  596. modDescription: '-Settings-',
  597. modId: 'SettingsButton',
  598. modCode: () => {
  599. rzModSettings.classList.toggle('hidden');
  600. }
  601. }
  602. ];
  603.  
  604. // @TODO: Create interface to control enabled mods
  605. const modOptionForm = document.createElement('form');
  606. let enabledMods = [];
  607.  
  608. rzMods.forEach(mod => {
  609.  
  610. // @TODO: Remove this line in favor of completed mod settings box
  611. enabledMods.push(mod.modName);
  612.  
  613. /*
  614. const modOptionLabel = document.createElement('label');
  615. const modOptionCheck = document.createElement('input');
  616. modOptionCheck.type = 'checkbox';
  617. modOptionLabel.append(modOptionCheck);
  618. modOptionForm.append(modOptionLabel);
  619. */
  620.  
  621. if ( ! enabledMods.includes(mod.modName)){
  622. return;
  623. }
  624.  
  625.  
  626.  
  627. let modElement = null;
  628.  
  629. switch (mod.modType){
  630. case 'automatic':
  631. mod.modCode.call();
  632.  
  633. break;
  634. case 'button':
  635. modElement = document.createElement('button');
  636. modElement.innerText = mod.modName;
  637. modElement.onclick = mod.modCode;
  638. modElement.title = mod.modDescription;
  639. modElement.id = mod.modId;
  640.  
  641. break;
  642. case 'code':
  643. modElement = document.createElement('span');
  644. modElement.innerHTML = mod.modCode.call();
  645.  
  646. break;
  647. case 'text':
  648. modElement = document.createElement('span');
  649. modElement.classList.add('text');
  650. modElement.innerText = mod.modCode.call();
  651.  
  652. break;
  653. }
  654.  
  655. if (modElement){
  656. rzModWrap.append(modElement);
  657. }
  658. });
  659.  
  660. document.body.prepend(rzModStyle);
  661. document.body.prepend(rzModWrap);
  662. document.body.prepend(rzModSettings);
  663. })();