// ==UserScript== // @name Fog Mod for Shell Shockers // @version 0.2 // @author A3+++ // @description Adjust Density and Color of the Fog in shell shockers! // @match *://shellshock.io/* // @run-at document-start // @grant unsafeWindow // @namespace https://greasyfork.org/users/815159 // @downloadURL none // ==/UserScript== (function () { function hexToRgb(hex) { var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); return result ? { r: parseInt(result[1], 16) / 255, g: parseInt(result[2], 16) / 255, b: parseInt(result[3], 16) / 255 } : null; } const savedData = [0.01, "#FFFFFF", {}, null, null, null]; unsafeWindow.adjustObj = function (e) { savedData[2] = e; savedData[0] = savedData[2].fogDensity; savedData[1] = savedData[2].fogColor; savedData[3].innerText = savedData[0]; savedData[4].value = savedData[0]; savedData[5].value = savedData[1].toHexString(); } unsafeWindow.reset = function () { savedData[2].fogDensity = savedData[0]; savedData[3].innerText = savedData[2].fogDensity; savedData[4].value = savedData[2].fogDensity; savedData[2].fogColor = savedData[1]; savedData[5].value = savedData[1].toHexString(); } unsafeWindow.XMLHttpRequest = class extends unsafeWindow.XMLHttpRequest { constructor() { super(...arguments); } open() { if (arguments[1] && arguments[1].includes("js/shellshock.js")) { this.scriptMatch = true; } super.open(...arguments); } get response() { if (this.scriptMatch) { let responseText = super.response; let match = responseText.match(/([A-z][A-z])\.fogDensity=.01\);/); if (match) responseText = responseText.replace(match[0], match[0] + `window.adjustObj(${match[1]});`); return responseText; } return super.response; } }; let html = [`
`, `Fog Color: