// ==UserScript== // @name Change FOV in Shell Shockers! // @version 0.1 // @description Implemented slider to change fov in shell shockers! // @match *://shellshock.io/* // @author A3+++ // @run-at document-start // @grant unsafeWindow // @namespace https://greasyfork.org/users/815159 // @downloadURL none // ==/UserScript== (function () { const degToRad = (deg) => deg * (Math.PI / 180); let fovToRadian = 1.25; unsafeWindow.fixCamera = function (camera) { Object.defineProperty(camera, "fov", { get: () => fovToRadian || 1.25 }); } unsafeWindow.resetFov = function () { fovToRadian = 1.25; display.innerText = "71.62\u00B0"; slider.value = "71.62\u00B0"; } unsafeWindow.XMLHttpRequest = class extends unsafeWindow.XMLHttpRequest { constructor() { super(...arguments); } open() { if (arguments[1] && arguments[1].includes("src/shellshock.js")) { this.scriptMatch = true; } super.open(...arguments); } get response() { if (this.scriptMatch) { let responseText = super.response; let match = responseText.match(/.push\(([A-z])\),\w.maxZ=100/); if (match) responseText = responseText.replace(match[0], match[0] + `,window.fixCamera(${match[1]})`); return responseText; } return super.response; } }; let html = [``, `
`, ``].join(); let display, slider; let interval = setInterval(function () { let pauseButtons = document.getElementById("pauseButtons"); if (pauseButtons) { clearInterval(interval); let fovDiv = document.createElement("div"); fovDiv.innerHTML = '