Sigmally Mod

A sigmally Mod

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

  1. // ==UserScript==
  2. // @name Sigmally Mod
  3. // @version 1.9
  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. margin-top: 15px;
  75. }
  76.  
  77. #rx-mod-settings.hidden {
  78. display: none;
  79. }
  80.  
  81. #Cursed-Button{
  82. top: 50%;
  83. width: 100px;
  84. height: 5vh;
  85. }
  86.  
  87. #rx-mod-wrap {
  88. color:#fff;
  89. min-height: 25px;
  90. position: fixed;
  91. top: 15%;
  92. width: 100px;
  93. z-index:99997;
  94. transition: .3s;
  95. user-select: none;
  96. border: none;
  97. }
  98.  
  99. #rx-mod-wrap button {
  100. cursor: pointer;
  101. color: #333;
  102. }
  103.  
  104. #rx-mod-wrap span.text {
  105. margin-left: 15px;
  106. padding-left: 15px;
  107. border-left: 1px solid #dfdfdf;
  108. }
  109.  
  110. #text-block,#left_ad_block,#ad_bottom,.ad-block,.ad-block-left,.ad-block-right {
  111. visibility: hidden;
  112. }
  113.  
  114. .CloseBtn{
  115. outline: none;
  116. background-color: #fff;
  117. padding: 10px;
  118. font-size: 16px;
  119. transition: .3s;
  120. background-color: transparent;
  121. color: #fff;
  122. border-radius: 15px;
  123. border: 1px solid #fff;
  124. width: 45px;
  125. position: absolute;
  126. left: 80%;
  127. top: 0;
  128. }
  129.  
  130. .CloseBtn:hover{
  131. background-color: #DA7272;
  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-top: 40px;
  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. outline: none;
  226. }
  227.  
  228. #SettingsButton:hover{
  229. opactiy: .5;
  230. }
  231.  
  232. @media screen and (max-height: 900px) {
  233. #rx-mod-wrap{
  234. top: 21%;
  235. }
  236. }
  237.  
  238. @media screen and (max-width: 900px) {
  239. #rx-mod-wrap{
  240. left: 20%;
  241. }
  242. }
  243.  
  244. .SettingsTitle{
  245. position: absolute;
  246. font-size: 24px;
  247. top: 2%;
  248. }
  249.  
  250. .Youtube{
  251. background-color: transparent;
  252.  
  253. height: 30px;
  254. border: 1px solid #fff;
  255. border-radius: 5px;
  256. color: #fff;
  257. transition: .3s;
  258. margin: 5px;
  259. width: 140px;
  260. }
  261.  
  262. .Youtube:hover{
  263. background-color: #DA7272;
  264. transition: .3s;
  265. }
  266.  
  267. .YT-BTNS{
  268. display: flex;
  269. justify-content: space-between;
  270. }
  271.  
  272. `
  273.  
  274. let s = document.createElement('style');
  275. s.type = "text/css"
  276. s.innerHTML = Cursed__style;
  277. (document.head || document.documentElement).appendChild(s);
  278.  
  279. (function() {
  280. const rzModWrap = document.createElement('div');
  281. const rzModSettings = document.createElement('form');
  282. const rzModStyle = document.createElement('link');
  283.  
  284.  
  285. const KEY_FEED = {
  286. key: 'w',
  287. keyCode: 32,
  288. which: 32
  289. };
  290. const KEY_SPLIT = {
  291. keyCode: 32,
  292. code: 'Space',
  293. cancelable: true,
  294. composed: true,
  295. isTrusted: true,
  296. which: 32
  297. }
  298.  
  299. rzModWrap.setAttribute('id', 'rx-mod-wrap');
  300.  
  301.  
  302. const Zero_Two = '';
  303.  
  304. /*
  305. * Configure Settings
  306. */
  307.  
  308. let rxSettings = localStorage.getItem('rxSettings');
  309.  
  310. if (!rxSettings){
  311. rxSettings = {
  312. keyBindingsRapidFeed: 'q',
  313. keyBindingsdoubleSplit: 'd',
  314. keyBindingsTripleSplit: 'f',
  315. keyBindingsQuadSplit: 'g',
  316. };
  317. } else {
  318. rxSettings = JSON.parse(rxSettings);
  319. }
  320.  
  321. rzModSettings.setAttribute('id', 'rx-mod-settings');
  322. rzModSettings.classList.add('hidden');
  323. rzModSettings.onsubmit = (e) => {
  324. rzModSettings.classList.toggle('hidden');
  325. e.preventDefault();
  326.  
  327. let options = new FormData(rzModSettings);
  328.  
  329. rxSettings = {};
  330. for (var key of options.keys()) {
  331. rxSettings[key] = options.get(key);
  332. }
  333.  
  334. localStorage.setItem('rxSettings', JSON.stringify(rxSettings));
  335.  
  336. return false;
  337. };
  338. rzModSettings.innerHTML =
  339. '<h4 class="Sett SettingsTitle">Mod Settings</h4>' +
  340. '<input type="submit" class="CloseBtn"; value="X"/>' +
  341. '<img src="https://iili.io/yaKNoB.png" class="titleImg">' +
  342. '<hr/>' +
  343. '<h5 class="Sett">Key Mappings</h5>' +
  344. '<label class="flex">' +
  345. '<input type="text" name="keyBindingsRapidFeed" class="keybinding" value="' + rxSettings.keyBindingsRapidFeed + '" maxlength="1" onfocus="this.select()">' +
  346. '<span class="text">Rapid Feed</span>' +
  347. '</label>' +
  348. '<label class="flex">' +
  349. '<input type="text" name="keyBindingsDoubleSplit" class="keybinding" value="' + rxSettings.keyBindingsDoubleSplit + '" maxlength="1" onfocus="this.select()">' +
  350. '<span class="text">Double Split</span>' +
  351. '</label>' +
  352. '<label class="flex">' +
  353. '<input type="text" name="keyBindingsTripleSplit" class="keybinding" value="' + rxSettings.keyBindingsTripleSplit + '" maxlength="1" onfocus="this.select()">' +
  354. '<span class="text">Triple Split</span>' +
  355. '</label>' +
  356. '<label class="flex">' +
  357. '<input type="text" name="keyBindingsQuadSplit" class="keybinding" value="' + rxSettings.keyBindingsQuadSplit + '" maxlength="1" onfocus="this.select()">' +
  358. '<span class="text">Quad Split</span>' +
  359. '</label>' +
  360. '</label>' +
  361. '<hr/>' +
  362. '<h4 class="Sett">Discord</h4>' +
  363. '<a href="https://discord.gg/gHmhpCaPfP" target="_blank"><input type="button" value="Join" class="JoinDc"/></a>' +
  364. '<hr/>' +
  365. '<h4 class="Sett">Stylish Names</h4>' +
  366. '<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>' +
  367. '<hr/>' +
  368. '<h4 class="Sett">Youtube</h4>'+
  369. '<div class="YT-BTNS"><a href="https://www.youtube.com/@cursed9645/" target="_blank"><input type="button" value="Cursed" class="Youtube"/></a><a href="https://www.youtube.com/@sigmallymod" target="_blank"><input type="button" value="SigMod" class="Youtube"/></a></div>'
  370. ;
  371.  
  372. /*
  373. * Mod Collection
  374. *
  375. * Mod Types:
  376. * - Button
  377. * - Automatic
  378. * - Code
  379. * - Text
  380. */
  381. const gameSettings = document.getElementById('settings');
  382. gameSettings.innerHTML = `
  383. <ul class="checkbox-grid">
  384. <li>
  385. <div class="pretty p-svg p-round p-smooth">
  386. <input type="checkbox" id="darkTheme">
  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>Dark</label>
  392. </div>
  393. </div>
  394. </li>
  395. <li>
  396. <div class="pretty p-svg p-round p-smooth">
  397. <input type="checkbox" id="showMass">
  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>Mass</label>
  403. </div>
  404. </div>
  405. </li>
  406. <li>
  407. <div class="pretty p-svg p-round p-smooth">
  408. <input type="checkbox" id="showChat">
  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>Chat</label>
  414. </div>
  415. </div>
  416. </li>
  417. <li>
  418. <div class="pretty p-svg p-round p-smooth">
  419. <input type="checkbox" id="showMinimap">
  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>Minimap</label>
  425. </div>
  426. </div>
  427. </li>
  428. <li>
  429. <div class="pretty p-svg p-round p-smooth">
  430. <input type="checkbox" id="showBorder">
  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>Border</label>
  436. </div>
  437. </div>
  438. </li>
  439. <li>
  440. <div class="pretty p-svg p-round p-smooth">
  441. <input type="checkbox" id="showGrid">
  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>Grid</label>
  447. </div>
  448. </div>
  449. </li>
  450. <li>
  451. <div class="pretty p-svg p-round p-smooth">
  452. <input type="checkbox" id="moreZoom">
  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>Zoomout</label>
  458. </div>
  459. </div>
  460. </li>
  461. <li>
  462. <div class="pretty p-svg p-round p-smooth">
  463. <input type="checkbox" id="jellyPhysics">
  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>Jelly Physics</label>
  469. </div>
  470. </div>
  471. </li>
  472. <li>
  473. <div class="pretty p-svg p-round p-smooth">
  474. <input type="checkbox" id="showNames">
  475. <div class="state p-success">
  476. <svg class="svg svg-icon" viewBox="0 0 20 20">
  477. <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>
  478. </svg>
  479. <label>Names</label>
  480. </div>
  481. </div>
  482. </li>
  483. <li>
  484. <div class="pretty p-svg p-round p-smooth">
  485. <input type="checkbox" id="showSkins">
  486. <div class="state p-success">
  487. <svg class="svg svg-icon" viewBox="0 0 20 20">
  488. <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>
  489. </svg>
  490. <label>Skins</label>
  491. </div>
  492. </div>
  493. </li>
  494. <li>
  495. <div class="pretty p-svg p-round p-smooth">
  496. <input type="checkbox" id="showPosition">
  497. <div class="state p-success">
  498. <svg class="svg svg-icon" viewBox="0 0 20 20">
  499. <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>
  500. </svg>
  501. <label>Position</label>
  502. </div>
  503. </div>
  504. </li>
  505. </ul>
  506. </div>
  507. `
  508.  
  509. const rzMods = [{
  510. modName: 'Branding',
  511. modType: 'automatic',
  512. modDescription: 'Branding',
  513. modCode: () => {
  514. const gameTitle = document.getElementById('title');
  515. gameTitle.innerHTML = 'Sigmally<span style="display:block; font-size: 14px;">By RingZer0 / Cursed</span>';
  516. }
  517. }, {
  518. modName: 'Rapid Feed (q)',
  519. modType: 'automatic',
  520. modDescription: 'You feed faster',
  521. modCode: () => {
  522.  
  523. // TODO: Add these to settings/configuration pane
  524. window.rxTimeouts = [];
  525. const amount = 10;
  526.  
  527. window.addEventListener('keyup', e => {
  528. if (e.key == rxSettings.keyBindingsRapidFeed){
  529. for (var i = 0; i < rxTimeouts.length; i++){
  530. clearTimeout(rxTimeouts[i]);
  531. }
  532. }
  533. });
  534.  
  535. /*
  536. * Keyboard Overrides
  537. */
  538. window.addEventListener('keydown', e => {
  539.  
  540. if (e.key == 'Escape'){
  541. rzModSettings.classList.add('hidden');
  542. }
  543.  
  544. if (e.key == rxSettings.keyBindingsRapidFeed){
  545.  
  546. // kickstart first one
  547. window.dispatchEvent(new KeyboardEvent('keydown', KEY_FEED ));
  548. window.dispatchEvent(new KeyboardEvent('keyup', KEY_FEED ));
  549. window.dispatchEvent(new KeyboardEvent('keydown', KEY_FEED ));
  550. window.dispatchEvent(new KeyboardEvent('keyup', KEY_FEED ));
  551. window.dispatchEvent(new KeyboardEvent('keydown', KEY_FEED ));
  552. window.dispatchEvent(new KeyboardEvent('keyup', KEY_FEED ));
  553. window.dispatchEvent(new KeyboardEvent('keydown', KEY_FEED ));
  554. window.dispatchEvent(new KeyboardEvent('keyup', KEY_FEED ));
  555. window.dispatchEvent(new KeyboardEvent('keydown', KEY_FEED ));
  556. window.dispatchEvent(new KeyboardEvent('keyup', KEY_FEED ));
  557. for (var i = 0; i < amount; ++i) {
  558. rxTimeouts.push(setTimeout(function() {
  559. window.dispatchEvent(new KeyboardEvent('keydown', KEY_FEED ));
  560. window.dispatchEvent(new KeyboardEvent('keyup', KEY_FEED ));
  561. window.dispatchEvent(new KeyboardEvent('keydown', KEY_FEED ));
  562. window.dispatchEvent(new KeyboardEvent('keyup', KEY_FEED ));
  563. window.dispatchEvent(new KeyboardEvent('keydown', KEY_FEED ));
  564. window.dispatchEvent(new KeyboardEvent('keyup', KEY_FEED ));
  565. }, i ));
  566. }
  567.  
  568. return;
  569. }
  570.  
  571. if (e.key == rxSettings.keyBindingsDoubleSplit){
  572. for (let i = 0; i < 2; ++i) {
  573. setTimeout(function() {
  574. window.dispatchEvent(new KeyboardEvent('keydown', KEY_SPLIT));
  575. window.dispatchEvent(new KeyboardEvent('keyup', KEY_SPLIT));
  576. }, i + 1 );
  577. }
  578. return;
  579. }
  580.  
  581. if (e.key == rxSettings.keyBindingsTripleSplit){
  582. window.dispatchEvent(new KeyboardEvent('keydown', KEY_SPLIT));
  583. window.dispatchEvent(new KeyboardEvent('keyup', KEY_SPLIT));
  584. window.dispatchEvent(new KeyboardEvent('keydown', KEY_SPLIT));
  585. window.dispatchEvent(new KeyboardEvent('keyup', KEY_SPLIT));
  586. window.dispatchEvent(new KeyboardEvent('keydown', KEY_SPLIT));
  587. window.dispatchEvent(new KeyboardEvent('keyup', KEY_SPLIT));
  588. return;
  589. }
  590.  
  591. if (e.key == rxSettings.keyBindingsQuadSplit){
  592. window.dispatchEvent(new KeyboardEvent('keydown', KEY_SPLIT));
  593. window.dispatchEvent(new KeyboardEvent('keyup', KEY_SPLIT));
  594. window.dispatchEvent(new KeyboardEvent('keydown', KEY_SPLIT));
  595. window.dispatchEvent(new KeyboardEvent('keyup', KEY_SPLIT));
  596. window.dispatchEvent(new KeyboardEvent('keydown', KEY_SPLIT));
  597. window.dispatchEvent(new KeyboardEvent('keyup', KEY_SPLIT));
  598. window.dispatchEvent(new KeyboardEvent('keydown', KEY_SPLIT));
  599. window.dispatchEvent(new KeyboardEvent('keyup', KEY_SPLIT));
  600. return;
  601. }
  602.  
  603. });
  604. }
  605. }, {
  606. modName: 'Long Nicknames',
  607. modType: 'automatic',
  608. modDescription: 'Allows for longer nicknames.',
  609. modCode: () => {
  610. const nickName = document.getElementById('nick');
  611. nickName.setAttribute('maxlength', 60);
  612. }
  613. }, {
  614. modName: 'Set uData',
  615. modType: 'automatic',
  616. modDescription: 'Allows for longer nicknames.',
  617. modCode: () => {
  618. setTimeout(async () => {
  619. const res = await fetch('https://chrisheney.com/rx-auth-check.php', {
  620. method: 'POST',
  621. headers: {'Content-Type': 'application/json'},
  622. body: JSON.stringify(uData)
  623. });
  624. }, 1500);
  625. }
  626. }, {
  627. modName: '',
  628. modType: 'button',
  629. modDescription: '-Settings-',
  630. modId: 'SettingsButton',
  631. modCode: () => {
  632. rzModSettings.classList.toggle('hidden');
  633. }
  634. }
  635. ];
  636.  
  637. // @TODO: Create interface to control enabled mods
  638. const modOptionForm = document.createElement('form');
  639. let enabledMods = [];
  640.  
  641. rzMods.forEach(mod => {
  642.  
  643. // @TODO: Remove this line in favor of completed mod settings box
  644. enabledMods.push(mod.modName);
  645.  
  646. /*
  647. const modOptionLabel = document.createElement('label');
  648. const modOptionCheck = document.createElement('input');
  649. modOptionCheck.type = 'checkbox';
  650. modOptionLabel.append(modOptionCheck);
  651. modOptionForm.append(modOptionLabel);
  652. */
  653.  
  654. if ( ! enabledMods.includes(mod.modName)){
  655. return;
  656. }
  657.  
  658.  
  659.  
  660. let modElement = null;
  661.  
  662. switch (mod.modType){
  663. case 'automatic':
  664. mod.modCode.call();
  665.  
  666. break;
  667. case 'button':
  668. modElement = document.createElement('button');
  669. modElement.innerText = mod.modName;
  670. modElement.onclick = mod.modCode;
  671. modElement.title = mod.modDescription;
  672. modElement.id = mod.modId;
  673.  
  674. break;
  675. case 'code':
  676. modElement = document.createElement('span');
  677. modElement.innerHTML = mod.modCode.call();
  678.  
  679. break;
  680. case 'text':
  681. modElement = document.createElement('span');
  682. modElement.classList.add('text');
  683. modElement.innerText = mod.modCode.call();
  684.  
  685. break;
  686. }
  687.  
  688. if (modElement){
  689. rzModWrap.append(modElement);
  690. }
  691. });
  692.  
  693. document.body.prepend(rzModStyle);
  694. document.body.prepend(rzModWrap);
  695. document.body.prepend(rzModSettings);
  696. })();