Advertisement
iiBuggzZz

Shell Shockers Better FPS [May Work]

Apr 5th, 2022 (edited)
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.88 KB | None | 0 0
  1. // ==UserScript==
  2. // @name         Get better FPS in shell shockers!
  3. // @version      0.1
  4. // @author       iiBuggzZz
  5. // @description  May or may not improve your fps in shell shockers.
  6. // @match        *://shellshock.io/*
  7. // @run-at       document-start
  8. // @grant        unsafeWindow
  9. // @namespace    https://greasyfork.org/users/815159
  10. // ==/UserScript==
  11. (function () {
  12.     unsafeWindow.hookScene = function () {
  13.         BABYLON.Scene = new Proxy(BABYLON.Scene, {
  14.             construct: function (func, args) {
  15.                 const product = new func(...args);
  16.  
  17.                 ["probesEnabled", "particlesEnabled", "texturesEnabled", "fogEnabled", "lightsEnabled", "postProcessesEnabled", "lensFlaresEnabled", "renderTargetsEnabled", "shadowsEnabled", "proceduralTexturesEnabled"].forEach(a => Object.defineProperty(product, a, {
  18.                     get: () => false
  19.                 }));
  20.  
  21.                 return product;
  22.             },
  23.         })
  24.     }
  25.     unsafeWindow.XMLHttpRequest = class extends XMLHttpRequest {
  26.         constructor() {
  27.             super(...arguments)
  28.         }
  29.         open() {
  30.             if (arguments[1] && arguments[1].includes("src/shellshock.js")) {
  31.                this.scriptMatch = true;
  32.             }
  33.  
  34.             super.open(...arguments);
  35.         }
  36.         get response() {
  37.  
  38.             if (this.scriptMatch) {
  39.                 let responseText = super.response;
  40.  
  41.                 let match = responseText.match(/else console.log\(window\),"undefined"==typeof window\?(\w).BABYLON=(\w\(\w,\w,\w\)).(\w)=\w\(\w,\w,\w\)/);
  42.                 if (match) {
  43.                     responseText = responseText.replace(match[0], `else{${match[1]}.BABYLON=${match[2]};${match[3]}=${match[1]}.BABYLON,window.hookScene()}`);
  44.                 }
  45.                 return responseText;
  46.             }
  47.             return super.response;
  48.         }
  49.     };
  50. }())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement