Mod Panel for Shell Shockers

Feat. RAINBOW CROSSHAIR, FOG MOD, SKIN MOD, SKY COLOR MOD

  1. // ==UserScript==
  2. // @name Mod Panel for Shell Shockers
  3. // @version 0.2
  4. // @author A3+++
  5. // @description Feat. RAINBOW CROSSHAIR, FOG MOD, SKIN MOD, SKY COLOR MOD
  6. // @match *://shellshock.io/*
  7. // @namespace https://gf.qytechs.cn/users/815159
  8. // @run-at document-start
  9. // @grant none
  10. // ==/UserScript==
  11. (function () {
  12. const shellMod = {
  13. interval: null,
  14. gui: null,
  15. storedData: {
  16. scene: null,
  17. camera: null,
  18. reticle: null,
  19. rainbowCrosshairEnabled: false,
  20. colorDelta: 0.89,
  21. colorIdx: 0,
  22. colors: [[], [], []],
  23. skyColor: "#FFFFFF",
  24. skyBoxAlpha: 1,
  25. useSkyColor: false,
  26. fogDensity: 0.01,
  27. fogColor: "#FFFFFF",
  28. },
  29. replacements: {
  30. unlockSkins: {
  31. regex: /inventory\[[A-z]\].id===[A-z].id\)return!0;return!1/,
  32. replace: "rep = `${match[0]}||true`"
  33. },
  34. camera: {
  35. regex: /.push\(([A-z]+)\),\w+.maxZ=100/,
  36. replace: "rep = `${match[0]},window.modHelper.camera=${match[1]}`"
  37. },
  38. scene: {
  39. regex: /([A-z][A-z])\.fogDensity=.01\)/,
  40. replace: "rep = `${match[0]};window.modHelper.scene=${match[1]}`"
  41. },
  42. crosshairs: {
  43. regex: /document.getElementById\("reticleDot"\)/,
  44. replace: "rep = `${match[0]};window.modHelper.reticle=this;${atob('ZG9jdW1lbnQudGl0bGU=')}=atob('U2hlbGwgU2hvY2tlcnMgfCBNb2RkZWQgYnkgQTMgfCBieSBCbHVlIFdpemFyZCBEaWdpdGFs');`"
  45. }
  46. },
  47. updateSky: function () {
  48. if (!this.storedData.scene) return;
  49. let skyMesh = this.storedData.scene.getMeshByID("skyBox");
  50. if (skyMesh) {
  51. if (!skyMesh.oldTexture) skyMesh.oldTexture = skyMesh.material.reflectionTexture;
  52. if (this.storedData.useSkyColor) {
  53. skyMesh.material.emissiveColor.set(...this.hexToRgb(this.storedData.skyColor));
  54. skyMesh.material.reflectionTexture = null;
  55. skyMesh.material.alpha = this.storedData.skyBoxAlpha;
  56. } else {
  57. skyMesh.material.emissiveColor.set(...this.hexToRgb("#000000"));
  58. skyMesh.material.reflectionTexture = skyMesh.oldTexture;
  59. skyMesh.material.alpha = 1;
  60. }
  61. }
  62. },
  63. updateFog: function () {
  64. if (!this.storedData.scene) return;
  65. this.storedData.scene.fogColor.set(...this.hexToRgb(this.storedData.fogColor));
  66. this.storedData.scene.fogDensity = this.storedData.fogDensity;
  67. },
  68. hexToRgb: function (hex) {
  69. let result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
  70. return result ? [parseInt(result[1], 16) / 255, parseInt(result[2], 16) / 255, parseInt(result[3], 16) / 255] : [];
  71. },
  72. doHooks: function () {
  73. window.XMLHttpRequest = class extends window.XMLHttpRequest {
  74. constructor() {
  75. super(...arguments);
  76. }
  77. open() {
  78. if (arguments[1] && arguments[1].includes("shellshock.js")) this.scriptMatch = true;
  79. super.open(...arguments);
  80. }
  81. get response() {
  82. if (this.scriptMatch) {
  83. let responseText = super.response;
  84. let rep;
  85. for (let key of Object.keys(shellMod.replacements)) {
  86. let replacement = shellMod.replacements[key];
  87. let match = responseText.match(replacement.regex);
  88. if (match) responseText = responseText.replace(match[0], eval(replacement.replace));
  89. }
  90. return responseText;
  91. }
  92. return super.response;
  93. }
  94. };
  95. },
  96. createGUI: function () {
  97. this.gui = new guify({
  98. title: "<b>Mod Panel</b>",
  99. theme: "dark",
  100. align: "left",
  101. width: 300,
  102. barMode: "none",
  103. panelMode: "none",
  104. opacity: 0.90,
  105. root: window.container,
  106. open: true
  107. });
  108. this.gui.Register([{
  109. type: "folder",
  110. label: "Fog Controls",
  111. open: false
  112. }, {
  113. type: "folder",
  114. label: "Sky Color",
  115. open: false
  116. }, {
  117. type: "folder",
  118. label: "Rainbow Crosshair",
  119. open: false
  120. }]);
  121. this.gui.Register([{
  122. type: "checkbox",
  123. label: "Enabled",
  124. object: this.storedData,
  125. property: "useSkyColor",
  126. onChange: () => this.updateSky()
  127. }, {
  128. type: "color",
  129. label: "Sky Color:",
  130. format: "hexColor",
  131. object: this.storedData,
  132. property: "skyColor",
  133. onChange: () => this.updateSky()
  134. }, {
  135. type: "range",
  136. label: "Alpha:",
  137. min: 0, max: 1,
  138. object: this.storedData,
  139. property: "skyBoxAlpha",
  140. onChange: () => this.updateSky()
  141. }], {
  142. folder: "Sky Color"
  143. });
  144. this.gui.Register([{
  145. type: "range",
  146. label: "Fog Density:",
  147. min: 0, max: 1,
  148. object: this.storedData,
  149. property: "fogDensity",
  150. onChange: () => this.updateFog()
  151. }, {
  152. type: "color",
  153. label: "Fog Color:",
  154. format: "hexColor",
  155. object: this.storedData,
  156. property: "fogColor",
  157. onChange: () => this.updateFog()
  158. }], {
  159. folder: "Fog Controls"
  160. });
  161. this.gui.Register([{
  162. type: "checkbox",
  163. label: "Enabled:",
  164. object: this.storedData,
  165. property: "rainbowCrosshairEnabled",
  166. }, {
  167. type: "range",
  168. label: "Delta:",
  169. min: 0, max: 2.5,
  170. object: this.storedData,
  171. property: "colorDelta",
  172. }], {
  173. folder: "Rainbow Crosshair"
  174. });
  175. this.gui.Register({
  176. type: "title",
  177. label: "Created by A3+++"
  178. }).container.align = "center";
  179. this.gui.panel.menuButton.style.opacity = 0.3;
  180. },
  181. loadMod: function () {
  182. const addScript = function () {
  183. let script = document.createElement('script');
  184. script.onload = function () { shellMod.createGUI() };
  185. script.src = "https://unpkg.com/guify@0.12.0/lib/guify.min.js";
  186. document.body.appendChild(script);
  187. }
  188. document.body ? addScript() : document.addEventListener("DOMContentLoaded", addScript);
  189. this.doHooks();
  190. function HSVtoRGB(h, s, v) {
  191. var r, g, b, i, f, p, q, t;
  192. i = Math.floor(h * 6);
  193. f = h * 6 - i;
  194. p = v * (1 - s);
  195. q = v * (1 - f * s);
  196. t = v * (1 - (1 - f) * s);
  197. switch (i % 6) {
  198. case 0: r = v, g = t, b = p; break;
  199. case 1: r = q, g = v, b = p; break;
  200. case 2: r = p, g = v, b = t; break;
  201. case 3: r = p, g = q, b = v; break;
  202. case 4: r = t, g = p, b = v; break;
  203. case 5: r = v, g = p, b = q; break;
  204. }
  205. return { r: Math.round(r * 255), g: Math.round(g * 255), b: Math.round(b * 255) };
  206. }
  207. for (let wl = 0; wl < 100; wl++) {
  208. const { r, g, b } = HSVtoRGB(wl / 100.0 * 0.85, 1.0, 1.0);
  209. this.storedData.colors[0].push(r);
  210. this.storedData.colors[1].push(g);
  211. this.storedData.colors[2].push(b);
  212. }
  213. if (!this.interval) {
  214. this.interval = setInterval(function () {
  215. if (shellMod.storedData.rainbowCrosshairEnabled && typeof extern !== "undefined" && extern.inGame) {
  216. for (let i = 0; i < 4; i++) {
  217. let ch = shellMod.storedData.reticle.crosshairs[i];
  218. const idx = Math.mod(Math.floor(shellMod.storedData.colorIdx + 30 * i), 100);
  219. const rgbString = `rgb(${shellMod.storedData.colors[0][idx]}, ${shellMod.storedData.colors[1][idx]}, ${shellMod.storedData.colors[2][idx]})`;
  220. ch.style.backgroundColor = rgbString;
  221. ch.style.color = rgbString;
  222. }
  223. shellMod.storedData.colorIdx += shellMod.storedData.colorDelta;
  224. if (shellMod.storedData.colorIdx >= 100) shellMod.storedData.colorIdx = 0;
  225. }
  226. if (typeof window?.extern?.account !== "undefined" && typeof vueApp !== "undefined") {
  227. if (!vueApp.isUpgraded || !extern.account.isSubscriber) { vueApp.setAccountUpgraded(true, ""); extern.account.isSubscriber = true; }
  228. }
  229. }, 33);
  230. }
  231. }
  232. }
  233. window.modHelper = {
  234. set scene(c) { shellMod.storedData.scene = c },
  235. set camera(c) { shellMod.storedData.camera = c },
  236. set reticle(c) { shellMod.storedData.reticle = c }
  237. }
  238. shellMod.loadMod();
  239. }())

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址