Sploop.io-Modifications [ CactusMod ] -

Cactus's are cool

  1. // ==UserScript==
  2. // @name Sploop.io-Modifications [ CactusMod ] -
  3. // @namespace -
  4. // @version 1.0.0
  5. // @description Cactus's are cool
  6. // @author cactus
  7. // @match *://sploop.io/*
  8. // @grant none
  9. // @icon https://i.imgur.com/1lJkd0L.png
  10. // ==/UserScript==
  11.  
  12.  
  13. document.title = 'Cactus.io - Cactus Mod';
  14. document.querySelector("link[rel='icon']").href = "https://i.imgur.com/1lJkd0L.png";
  15. document.getElementById("logo").src = "https://svgur.com/i/15Mw.svg";
  16.  
  17.  
  18.  
  19. //
  20. var FPS,cps = 0,Mcps = 0,Hue = 0;
  21. (function() {
  22. var UPDATE_DELAY = 700;
  23. var lastUpdate = 0;
  24. var frames = 0;
  25. var pingValue = 0;
  26. function updateCounter() {
  27. var now = Date.now();
  28. var elapsed = now - lastUpdate;
  29. if (elapsed < UPDATE_DELAY) {
  30. ++frames;
  31. } else {
  32. FPS = Math.round(frames / (elapsed / 1000));
  33. frames = 0;
  34. lastUpdate = now;
  35. }
  36. requestAnimationFrame(updateCounter);
  37. }
  38. lastUpdate = Date.now();
  39. requestAnimationFrame(updateCounter);
  40. })();
  41. document.addEventListener("mousedown", click, false);
  42. document.addEventListener("mouseup", endclick, false);
  43. function click(e) {
  44. if (e.button == 0 || 1 || 2) {
  45. cps++
  46. setTimeout(() => {
  47. cps--
  48. }, 900);
  49. }
  50. if (e.button == 0) { document.getElementById("LeftClick").style.backgroundColor = "white";}
  51. if (e.button == 2) { document.getElementById("RightClick").style.backgroundColor = "white";}
  52. }
  53. function endclick(e) {
  54. if (e.button == 0) {document.getElementById("LeftClick").style.backgroundColor = "rgba(0, 0, 0, 0.4)";}
  55. if (e.button == 2) {document.getElementById("RightClick").style.backgroundColor = "rgba(0, 0, 0, 0.4)";}
  56. }
  57. document.addEventListener('keydown', (e)=>{
  58. if (e.keyCode == 32) {document.getElementById("SpaceBar").style.backgroundColor = "white";}
  59. if (e.keyCode == 87) {document.getElementById("keyW").style.backgroundColor = "white";}
  60. if (e.keyCode == 65) {document.getElementById("keyA").style.backgroundColor = "white";}
  61. if (e.keyCode == 83) {document.getElementById("keyS").style.backgroundColor = "white";}
  62. if (e.keyCode == 68) {document.getElementById("keyD").style.backgroundColor = "white";}
  63. })
  64. document.addEventListener('keyup', (e)=>{
  65. if (e.keyCode == 32) {document.getElementById("SpaceBar").style.backgroundColor = "rgba(0, 0, 0, 0.4)";}
  66. if (e.keyCode == 87) {document.getElementById("keyW").style.backgroundColor = "rgba(0, 0, 0, 0.4)";}
  67. if (e.keyCode == 65) {document.getElementById("keyA").style.backgroundColor = "rgba(0, 0, 0, 0.4)";}
  68. if (e.keyCode == 83) {document.getElementById("keyS").style.backgroundColor = "rgba(0, 0, 0, 0.4)";}
  69. if (e.keyCode == 68) {document.getElementById("keyD").style.backgroundColor = "rgba(0, 0, 0, 0.4)";}
  70. })
  71.  
  72. setInterval(() => {
  73. if (cps > Mcps) Mcps = cps
  74. Hue += Math.random() * .4
  75. Show.style.color = `white`
  76. Panel.style.color = `hsl(${Hue}, 100%, 70%)`
  77. Creator.style.color = `hsl(${Hue}, 100%, 70%)`
  78. Show.innerHTML = `${FPS}FPS<br>${cps}CPS<br>${Mcps}MCPS`
  79. }, 0);
  80. let Show = document.createElement("div");
  81. Show.id = "SHOW"
  82. document.body.prepend(Show);
  83. let Panel = document.createElement("div");
  84. let Creator = document.createElement('div');
  85.  
  86. Creator.innerHTML = `
  87. <div id='Creator'>
  88. <div id='01e'>CactusMod</div>`
  89. document.body.appendChild(Creator)
  90.  
  91. Panel.innerHTML = `
  92. <div id="Panel">
  93. <div id="keyW">W</div>
  94. <div id="keyA">A</div>
  95. <div id="keyS">S</div>
  96. <div id="keyD">D</div>
  97. <div id="LeftClick">LMB</div>
  98. <div id="RightClick">RMB</div>
  99. <div id="SpaceBar">______</div>
  100. </div>`
  101. document.body.appendChild(Panel)
  102.  
  103. let popUI = document.querySelector('#pop-ui');
  104. let settings = document.querySelector('#pop-settings');
  105.  
  106.  
  107. // === STYLING FOR HAT MENU ===
  108. document.querySelector('#game-content').style.justifyContent = 'center';
  109. document.querySelector('#main-content').style.width = 'auto';
  110. document.getElementById('hat-menu').style.background = "rgba(0,0,0,0)"
  111. document.getElementById('hat-menu').style.opacity = "0.9"
  112. document.getElementById('clan-menu').style.background = "rgba(0,0,0,0)"
  113. document.getElementById('clan-menu').style.opacity = "0.9"
  114. document.getElementById("hat_menu_content").style.background = "rgba(0,0,0,0)"
  115. document.getElementById("clan_menu_content").style.background = "rgba(0,0,0,0)"
  116.  
  117. var hatMenu = document.getElementById("hat-menu");
  118. if (hatMenu) {
  119. hatMenu.style.opacity = "0.6";
  120. }
  121.  
  122. // == style ==
  123. var styleItem = document.createElement("style");
  124. styleItem.type = "text/css";
  125. styleItem.appendChild(document.createTextNode(`
  126.  
  127. create_clan *, #pop-ui {
  128. background-color: transparent;
  129. }
  130. #pop-settings {
  131. background: rgba(0,0,0,0.5);
  132. opacity: 0.95;
  133. }
  134.  
  135. #Creator{
  136. position: fixed !important;
  137. width: 10vw;
  138. height: 5vh;
  139. top: 96.4vh;
  140. left: -1.25vw;
  141. z-index: 100000022;
  142. display: block;
  143. text-align: center;
  144. opacity: 0;
  145. }
  146.  
  147. #01e{
  148. position: fixed !important;
  149. width: 50px;
  150. height: 45px;
  151. top: 45px;
  152. left: 0;
  153. background-color: rgba(0, 0, 0, 0.4);
  154. box-shadow: 0 0 2px #6dd1ff,0 0 0 3px #353535, 0 0 0 3px #3e3e3e, inset 0 0 7px rgba(0, 0, 0, 1), 0 2px 10px rgba(0,0,0,.5), inset 0 0 10px rgba(0,0,0,.2);
  155. border-top-left-radius: 10px;
  156. }
  157.  
  158. #SHOW {
  159. font-size: 18px;
  160. position: absolute;
  161. width: 90px;
  162. height: 78px;
  163. top:55px;
  164. left:10px;
  165. z-index:1000000;
  166. display: block;
  167. text-align: center;
  168. border-radius: 20px;
  169. background-color: rgba(0, 0, 0, 0.4);
  170.  
  171. }
  172.  
  173. #Panel {
  174. position: relative;
  175. width: 150px;
  176. height: 180px;
  177. top: 10px;
  178. left: 130px;
  179. z-index: 1000000;
  180. display: block;
  181. text-align: center;
  182. opacity: 0.6;
  183. }
  184.  
  185.  
  186.  
  187.  
  188. #millWarningDiv{
  189. font-size: 18px;
  190. position: absolute;
  191. height: auto;
  192. top:80vh;
  193. left:0vh;
  194. z-index:1000000;
  195. display: block;
  196. opacity: 0.9;
  197. text-align: center;
  198. border-radius: 20px;
  199. display: none;
  200. background-color: rgba(0, 0, 0, 0.4);
  201. box-shadow: 0 0 2px #6dd1ff,0 0 0 3px #353535, 0 0 0 3px #3e3e3e, inset 0 0 7px rgba(0, 0, 0, 1), 0 2px 10px rgba(0,0,0,.5), inset 0 0 10px rgba(0,0,0,.2);
  202. border-top-left-radius: 10px;
  203. border-top-right-radius: 10px;
  204. padding:10px;
  205. color: white;
  206. }
  207.  
  208.  
  209. #keyW {
  210. position: absolute;
  211. width: 50px;
  212. height: 45px;
  213. top: 0;
  214. left: 50px;
  215. background-color: rgba(0, 0, 0, 0.4);
  216. box-shadow: 0 0 2px #6dd1ff,0 0 0 3px #353535, 0 0 0 3px #3e3e3e, inset 0 0 7px rgba(0, 0, 0, 1), 0 2px 10px rgba(0,0,0,.5), inset 0 0 10px rgba(0,0,0,.2);
  217. border-top-left-radius: 10px;
  218. border-top-right-radius: 10px;
  219. }
  220.  
  221. #keyA {
  222. position: absolute;
  223. width: 50px;
  224. height: 45px;
  225. top: 45px;
  226. left: 0;
  227. background-color: rgba(0, 0, 0, 0.4);
  228. box-shadow: 0 0 2px #6dd1ff,0 0 0 3px #353535, 0 0 0 3px #3e3e3e, inset 0 0 7px rgba(0, 0, 0, 1), 0 2px 10px rgba(0,0,0,.5), inset 0 0 10px rgba(0,0,0,.2);
  229. border-top-left-radius: 10px;
  230. }
  231.  
  232. #keyS {
  233. position: absolute;
  234. width: 50px;
  235. height: 45px;
  236. top: 45px;
  237. left: 50px;
  238. background-color: rgba(0, 0, 0, 0.4);
  239. box-shadow: 0 0 2px #6dd1ff,0 0 0 3px #353535, 0 0 0 3px #3e3e3e, inset 0 0 7px rgba(0, 0, 0, 1), 0 2px 10px rgba(0,0,0,.5), inset 0 0 10px rgba(0,0,0,.2);
  240. }
  241.  
  242. #keyD {
  243. position: absolute;
  244. width: 50px;
  245. height: 45px;
  246. top: 45px;
  247. right: 0;
  248. background-color: rgba(0, 0, 0, 0.4);
  249. box-shadow: 0 0 2px #6dd1ff,0 0 0 3px #353535, 0 0 0 3px #3e3e3e, inset 0 0 7px rgba(0, 0, 0, 1), 0 2px 10px rgba(0,0,0,.5), inset 0 0 10px rgba(0,0,0,.2);
  250. border-top-right-radius: 10px;
  251. }
  252.  
  253. #LeftClick {
  254. position: absolute;
  255. width: 75px;
  256. height: 45px;
  257. top: 90px;
  258. left: 0;
  259. background-color: rgba(0, 0, 0, 0.4);
  260. box-shadow: 0 0 2px #6dd1ff,0 0 0 3px #353535, 0 0 0 3px #3e3e3e, inset 0 0 7px rgba(0, 0, 0, 1), 0 2px 10px rgba(0,0,0,.5), inset 0 0 10px rgba(0,0,0,.2);
  261. }
  262.  
  263. #RightClick {
  264. position: absolute;
  265. width: 75px;
  266. height: 45px;
  267. top: 90px;
  268. right: 0;
  269. background-color: rgba(0, 0, 0, 0.4);
  270. box-shadow: 0 0 2px #6dd1ff,0 0 0 3px #353535, 0 0 0 3px #3e3e3e, inset 0 0 7px rgba(0, 0, 0, 1), 0 2px 10px rgba(0,0,0,.5), inset 0 0 10px rgba(0,0,0,.2);
  271. }
  272.  
  273. #SpaceBar {
  274. position: absolute;
  275. width: 150px;
  276. height: 45px;
  277. bottom: 0;
  278. left: 0;
  279. border-bottom-left-radius: 10px;
  280. border-bottom-right-radius: 10px;
  281. background-color: rgba(0, 0, 0, 0.4);
  282. box-shadow: 0 0 2px #6dd1ff,0 0 0 3px #353535, 0 0 0 3px #3e3e3e, inset 0 0 7px rgba(0, 0, 0, 1), 0 2px 10px rgba(0,0,0,.5), inset 0 0 10px rgba(0,0,0,.2);
  283. }
  284.  
  285. #top-wrap-left {
  286. position: fixed;
  287. top: 50px;
  288. left: 96%;
  289. transform: translateX(-50%);
  290. width: 58px;
  291. height:58px;
  292. }
  293.  
  294. #hat-menu {
  295.  
  296. height: 348px;
  297. width: 430px;
  298. }
  299. #hat-menu .green-button, #clan-menu .green-button {
  300. background-color: rgba(0,0,0,0);
  301. box-shadow:none;
  302. }
  303. #hat-menu .green-button:hover, #clan-menu .green-button:hover {
  304. background-color: rgba(0,0,0,0.2);
  305. }
  306. .subcontent-bg {
  307. border-color: transparent;
  308. box-shadow: none;
  309. background: transparent;
  310. }
  311. .menu .content .menu-item .menu-pricing .action {
  312. border-color: grey;
  313. }
  314. .menu .content .menu-item {
  315. border-bottom-color: transparent;
  316. }
  317. #hat-menu, #clan-menu {
  318. box-shadow: none;
  319. border: 1px solid black
  320. }
  321.  
  322. #clan_menu_content .subcontent-bg {
  323. margin: 1px 0px 1px 0px;
  324. }
  325.  
  326. #create_clan *, #pop-ui {
  327. background-color: transparent;
  328. }
  329.  
  330. #pop-settings {
  331. background: rgba(0,0,0,0.5);
  332. opacity: 0.95;
  333. }
  334.  
  335. .scrollbar::-webkit-scrollbar {
  336. background: rgba(0, 0, 0, 0);
  337. border-radius: 2px;
  338. border: 2px solid rgba(0, 0, 0, 0.9);
  339. }
  340. .scrollbar::-webkit-scrollbar-thumb {
  341. background: rgba(255,255,255, 0.7);
  342. border-radius: 2px;
  343. border: 2px solid #141414;
  344. box-shadow: inset 0 1px 0 white, inset 0 -1px 0 #4e5645,
  345. 0 1px 1px rgb(20 20 20 / 50%);
  346. }
  347.  
  348. `))
  349.  
  350.  
  351. // == ping-shower ==
  352. var checkbox = document.getElementById('display-ping-toggle');
  353. checkbox.checked = true;
  354. checkbox.dispatchEvent(new Event('change'));
  355.  
  356. // == remove ads ==
  357. const idsToDelete = ['game-bottom-content', 'da-left', 'da-right', 'game-left-content-main', "game-right-content-main", "discord", 'alsoTryLink', 'cross-promo']; // Array of IDs to delete
  358. idsToDelete.forEach(id => {
  359. const elementToRemove = document.getElementById(id);
  360. if (elementToRemove) {
  361. elementToRemove.parentNode.removeChild(elementToRemove);
  362. } else {
  363. console.error(`Element with ID ${id} not found!`);
  364. }
  365. });
  366. const container = document.getElementById('game-content');
  367. const elementToRealign = document.getElementById('game-middle-main');
  368. const leftOffset = (container.offsetWidth - elementToRealign.offsetWidth) / 2;
  369. elementToRealign.style.left = leftOffset + 'px';
  370.  
  371.  
  372. // == Homepage Blur ==
  373. function blur() {
  374. const homepage = document.getElementById("homepage");
  375. homepage.style.display = "flex";
  376. // Set a fixed blur value
  377. const blurValue = 1.5;
  378. homepage.style.backdropFilter = `blur(${blurValue}px)`;
  379. }
  380.  
  381. setTimeout(blur, 2000);
  382.  
  383. // == Watermark/Username ==*customizeable - line 86*
  384.  
  385. let gridToggle = true; // change this value to false if you want to keep grid off
  386.  
  387. function toggleGrid() {
  388. const grid = document.querySelector('#grid-toggle');
  389. grid.click();
  390. }
  391. toggleGrid();
  392. function handlePlayButtonClick() {
  393. if (gridToggle) {
  394. toggleGrid();
  395. gridToggle = false;
  396. }
  397. }
  398. var xe1 = false;
  399.  
  400. function toggleCreatorVisibility() {
  401. var creatorDiv = document.getElementById('Creator');
  402. if (creatorDiv.style.opacity === '0.5') return;
  403.  
  404. if (!creatorDiv.dataset.clicked) {
  405. creatorDiv.dataset.clicked = true;
  406. creatorDiv.style.opacity = '0.5';
  407. return;
  408. }
  409. creatorDiv.style.opacity = '1';
  410. }
  411.  
  412. function playButtonClickHandler() {
  413. toggleCreatorVisibility();
  414. handlePlayButtonClick();
  415. var creatorDiv = document.getElementById('Creator');
  416. creatorDiv.style.transition = 'opacity 0.5s ease';
  417.  
  418. // Print "Worked" to the console
  419. console.log("Worked");
  420.  
  421. // Remove event listener after action happens
  422. if (xe1) {
  423. document.getElementById('play').removeEventListener('click', playButtonClickHandler);
  424. } else {
  425. xe1 = true;
  426. }
  427. }
  428.  
  429. document.getElementById('play').addEventListener('click', playButtonClickHandler);
  430.  
  431. // == Access Settings ingame ==
  432. document.addEventListener('keydown', e =>{
  433. if(e.keyCode == 27) {
  434. if(document.querySelector('#hat-menu').style.display !== "flex" && document.querySelector('#clan-menu').style.display !== "flex" && document.querySelector('#homepage').style.display !== "flex" && document.querySelector('#chat-wrapper').style.display !== "block") {
  435. if(!popUI.classList.contains('fade-in')) {
  436. popUI.classList.add('fade-in');
  437. popUI.style.display = "flex";
  438. settings.style.display = "flex";
  439. return;
  440. }
  441. popUI.classList.remove('fade-in');
  442. popUI.style.display = "none";
  443. settings.style.display = "none";
  444. }
  445. }
  446. });
  447.  
  448. // == Custom Health + Clan Colour ==
  449.  
  450. const originalFillRect = CanvasRenderingContext2D.prototype.fillRect;
  451.  
  452. CanvasRenderingContext2D.prototype.fillRect = function (x, y, width, height) {
  453. if (this.fillStyle === "#a4cc4f") {
  454. this.fillStyle = "#13a8ec";
  455. this.shadowColor = "rgba(0, 0, 0, 0.7)";
  456. this.shadowBlur = 3;
  457. }
  458. originalFillRect.call(this, x, y, width, height);
  459. };
  460.  
  461. CanvasRenderingContext2D.prototype.fillText = new Proxy(CanvasRenderingContext2D.prototype.fillText, {
  462. apply: function (target, thisArg, argumentsList) {
  463. thisArg.lineWidth = 8;
  464. thisArg.strokeStyle = "black";
  465. thisArg.strokeText.apply(thisArg, argumentsList);
  466. return target.apply(thisArg, argumentsList);
  467. }
  468. });
  469.  
  470.  
  471. CanvasRenderingContext2D.prototype.fillText = new Proxy(CanvasRenderingContext2D.prototype.fillText, {
  472. apply: function (target, thisArg, argumentsList) {
  473. if (typeof argumentsList[0] == 'string' && argumentsList[0].includes('[')) {
  474. thisArg.fillStyle = "#6ee0dc";
  475. thisArg.shadowColor = "rgba(0, 0, 0, 0.7)";
  476. thisArg.shadowBlur = 6;
  477. }
  478. return target.apply(thisArg, argumentsList);
  479. }
  480. });
  481.  
  482.  
  483.  
  484.  
  485. // == Miscellaneous ==
  486.  
  487. // Clan custom title
  488. var phrases = [,"/ Clan /", "| Clan |", "- Clan -", "/ Clan /"];
  489. var currentIndex = 0;
  490.  
  491. setInterval(function() {
  492. var element = document.getElementById('clan-title');
  493. if (element) {
  494. element.textContent = phrases[currentIndex];
  495. currentIndex = (currentIndex + 1) % phrases.length;
  496. }
  497. }, 200);
  498.  
  499.  
  500.  
  501. // Instant leave
  502.  
  503. (function() {
  504. 'use strict';
  505.  
  506. document.addEventListener("keydown", function(event) {
  507. var homepage = document.getElementById("homepage");
  508. var isPlayerInGame = homepage.style.display === "none";
  509.  
  510. if (isPlayerInGame && event.code === "ArrowUp") {
  511. event.preventDefault();
  512.  
  513. var ffaMode = document.getElementById("ffa-mode");
  514. var sandboxMode = document.getElementById("sandbox-mode");
  515. var popProgressLoss = document.getElementById("pop-progress-loss");
  516. var changeServer = document.getElementById("change-server");
  517.  
  518. if (isPlayerInGame) {
  519. var activeButton = ffaMode.classList.contains("dark-blue-button-3-active") ? sandboxMode : ffaMode;
  520. homepage.style.display = "flex";
  521. activeButton.click();
  522. }
  523.  
  524. if (popProgressLoss.style.display === "flex") {
  525. changeServer.click();
  526. }
  527. }
  528. });
  529.  
  530. })();
  531.  
  532. // Game-Homepage
  533.  
  534.  
  535. (function() {
  536. 'use strict';
  537.  
  538. const styleElement = document.head.appendChild(document.createElement('style'));
  539. styleElement.type = 'text/css';
  540. styleElement.appendChild(document.createTextNode(`#cross-promo, #bottom-wrap, #google_play, #game-left-content-main, #game-bottom-content, #game-right-content-main, #right-content { display: none !important; }`));
  541.  
  542. const gameContent = document.querySelector('#game-content');
  543. gameContent.style.justifyContent = 'center';
  544.  
  545. const mainContent = document.querySelector('#main-content');
  546. mainContent.style.width = 'auto';
  547.  
  548. const popUi = document.getElementById('pop-ui');
  549. popUi.style.opacity = '0.7';
  550.  
  551. const homepage = document.getElementById('homepage');
  552. homepage.style.opacity = '0.7';
  553.  
  554. const rankingMiddleMain = document.getElementById('ranking-middle-main');
  555. rankingMiddleMain.style.height = '380px';
  556.  
  557. const rankingRanksContainer = document.getElementById('ranking-ranks-container');
  558. rankingRanksContainer.style.height = '295px';
  559.  
  560. const ranking2MiddleMain = document.getElementById('ranking2-middle-main');
  561. ranking2MiddleMain.style.height = '380px';
  562.  
  563. const rankingRankContainer = document.getElementById('ranking-rank-container');
  564. rankingRankContainer.style.height = '295px';
  565.  
  566. const profileLeftMain = document.getElementById('profile-left-main');
  567. profileLeftMain.style.width = '650px';
  568.  
  569. const changeUsername = document.getElementById('change-username');
  570. changeUsername.style.width = '200px';
  571.  
  572. const popBoxes = document.querySelectorAll('.pop-box');
  573. popBoxes.forEach((box) => {
  574. box.style.boxShadow = "inset 0 4px 0 #4e564500, inset 0 -4px 0 #38482500, 0px 2px 0 5px rgb(20 20 20 / 0%), 0px 0px 0 15px rgb(20 20 20 / 0%)";
  575. });
  576.  
  577. const popHomepage = document.getElementById('homepage');
  578. document.addEventListener('keydown', e => {
  579. if (e.key === 'Alt' && popHomepage) {
  580. popHomepage.style.display = (popHomepage.style.display === 'flex' || popHomepage.style.display === '') ? 'none' : 'flex';
  581. e.preventDefault();
  582. e.stopPropagation();
  583. }});
  584. })();
  585.  
  586.  
  587. const { fillText } = CanvasRenderingContext2D.prototype;
  588. const cursing = ["cunt", "whore", "fuck", "shit", "faggot", "nigger", "nigga", "dick", "vagina", "minge", "cock", "rape", "cum", "sex", "tits", "penis", "clit", "pussy", "jizz", "prune", "douche", "wanker", "damn", "bitch", "dick", "fag", "bastard"],
  589. replace = ["cxxx", "wxxxx", "fxxx", "sxxx", "fxxxxx", "nxxxxx", "nxxxx", "dxxx", "vxxxxx", "mxxxx", "cxxx", "rxxx", "cxx", "sxx", "txxx", "pxxxx", "cxxx", "pxxxx", "jxxx", "pxxxx", "dxxxxx", "wxxxxx", "dxxx", "bxxxx", "dxxx", "fxx", "bxxxxxx"];
  590. CanvasRenderingContext2D.prototype.fillText = function (word) {
  591. if (typeof word == "string") {
  592. var tmpString;
  593. for (var i = 0; i < cursing.length; ++i) {
  594. if (word.toLowerCase().indexOf(cursing[i]) > -1) {
  595. tmpString = replace[i];
  596. var re = new RegExp(cursing[i], "ig");
  597. word = word.replace(re, tmpString);
  598. }
  599. }
  600. }
  601. fillText.call(this, ...arguments);
  602. };
  603.  
  604.  
  605.  
  606.  
  607.  
  608. // emojies
  609.  
  610. const emojiMappings = {
  611. ":skull:": "💀",
  612. ":heart:": "❤️",
  613. ":smile:": "😄",
  614. ":thumbu:": "👍",
  615. ":thumbd:": "👎",
  616.  
  617. };
  618.  
  619. function replaceTextWithEmojis(text) {
  620. let replacedText = text;
  621. for (const pattern in emojiMappings) {
  622. if (emojiMappings.hasOwnProperty(pattern)) {
  623. replacedText = replacedText.replace(new RegExp(pattern, "g"), emojiMappings[pattern]);
  624. }
  625. }
  626. return replacedText;
  627. }
  628.  
  629. document.getElementById("chat").addEventListener("keydown", function(event) {
  630. if (event.key === "Enter") {
  631. const chatInput = event.target;
  632. const text = chatInput.value;
  633. const replacedText = replaceTextWithEmojis(text);
  634. chatInput.value = replacedText;
  635. }
  636. });
  637. document.getElementById("chat-wrapper").addEventListener("keydown", function(event) {
  638. if (event.key === " ") {
  639. event.stopPropagation();
  640. }
  641. });
  642. document.getElementById("nickname").addEventListener("keydown", function(event) {
  643. if (event.key === " ") {
  644. event.stopPropagation();
  645. }
  646. });
  647.  
  648. // dagger fix
  649.  
  650. (function() {
  651. const { drawImage } = CanvasRenderingContext2D.prototype
  652.  
  653. CanvasRenderingContext2D.prototype.drawImage = function(image, x, y, width, height) {
  654. if (/dagger/.test(image?.src) && (y === 5 || y > window.screen.availHeight - 100)) {
  655. this.save()
  656. this.strokeStyle = "rgba(45, 49, 49, .5)"
  657. this.lineWidth = 6
  658.  
  659. this.roundRect(x + 3, y + 3, 95, 95, 16)
  660. this.stroke()
  661. this.restore()
  662.  
  663. arguments[3] = arguments[4] = 80
  664. arguments[1] += 11
  665. arguments[2] += 11
  666. }
  667.  
  668. drawImage.apply(this, arguments)
  669. }
  670. })()
  671.  
  672. document.head.appendChild(styleItem);