xray for starve.io and devast.io

this wont be an end of world trust me

  1. // ==UserScript==
  2. // @name xray for starve.io and devast.io
  3. // @version 2025-22-02
  4. // @description this wont be an end of world trust me
  5. // @match https://devast.io/*
  6. // @match https://starve.io/*
  7. // @require https://unpkg.com/guify@0.12.0/lib/guify.min.js
  8. // @run-at document-start
  9. // @license MIT
  10. // @grant none
  11. // @namespace https://greatest.deepsurf.us/users/1349814
  12. // ==/UserScript==
  13. let log = console.log;
  14.  
  15. let Settings = {
  16. xray: {
  17. enabled: false,
  18. key: "KeyJ",
  19. opacity: 0.40
  20. }
  21. };
  22. let quer = document.querySelectorAll;
  23. document.querySelectorAll = function (data) {
  24. if (data === `[class*="guify"]`) {
  25. return false;
  26. } else {
  27. quer.apply(this, arguments);
  28. }
  29. };
  30. document.addEventListener("keydown", (evt) => {
  31. if(evt.code === Settings.xray.key) {
  32. Settings.xray.enabled = !Settings.xray.enabled;
  33. }
  34. });
  35. let ctx
  36.  
  37. function xray() {
  38. if(window.location.href === "https://starve.io/") {
  39. ctx = document.querySelector("canvas").getContext("2d");
  40. } else {
  41. ctx = document.getElementById("can").getContext("2d");
  42. }
  43. const DrawImage = ctx.drawImage;
  44.  
  45. ctx.drawImage = function() {
  46. if(Settings.xray.enabled) {
  47. ctx.globalAlpha = Settings.xray.opacity;
  48. }
  49. DrawImage.apply(ctx, arguments);
  50. };
  51. }
  52.  
  53. const guisif = {
  54. initial: () => {
  55. let GUI = new guify({
  56. title: "Xray",
  57. theme: {
  58. name: "Triade Theme",
  59. colors: {
  60. menuBarBackground: "rgb(35, 35, 35)",
  61. menuBarText: "rgb(102, 0, 0)",
  62. panelBackground: "rgb(0, 0, 0)",
  63. componentBackground: "rgb(22, 22, 22)",
  64. componentForeground: "rgb(255, 255, 255)",
  65. textPrimary: "rgb(255, 255, 255)",
  66. textSecondary: "rgb(85, 210, 50)",
  67. textHover: "rgb(0, 0, 0)"
  68. },
  69. font: {
  70. fontFamily: 'Baloo Paaji',
  71. fontSize: '16px',
  72. fontWeight: '100'
  73. },
  74. },
  75. align: "left",
  76. width: 350,
  77. barMode: "none",
  78. panelMode: "none",
  79. opacity: .95,
  80. root: window.container,
  81. open: true,
  82. pollRateMS: 100,
  83. });
  84.  
  85. const Tab = " ";
  86. GUI.Register([{
  87. type: "checkbox",
  88. label: Tab + 'Xray',
  89. object: Settings.xray,
  90. property: 'enabled',
  91. onChange: (val) => {
  92. Settings.xray.enabled = val;
  93. }
  94. },
  95. {
  96. type: "range",
  97. label: Tab + 'Xray Opacity',
  98. min: 0,
  99. max: 1,
  100. step: 0.1,
  101. object: Settings.xray,
  102. property: 'opacity',
  103. scale: "linear",
  104. },
  105. {
  106. type: "display",
  107. label: "Xray Key:",
  108. object: Settings.xray,
  109. property: "key"
  110. },
  111. {
  112. type: "button",
  113. label: "Set Xray Key",
  114. action: () => {
  115. guisif.controls.setKeyBind("xray");
  116. }
  117. },
  118. ]);
  119. },
  120.  
  121. controls: null,
  122.  
  123. controller: class {
  124. setKeyBind(property) {
  125. Settings[property].key = "Press any key";
  126. let keyPressCount = 0;
  127.  
  128. document.addEventListener("keydown", function onKeyDown(event) {
  129. keyPressCount++;
  130. if(keyPressCount >= 1) {
  131. Settings[property].key = event.code === "Escape" ? "NONE" : event.code;
  132. document.removeEventListener("keydown", onKeyDown);
  133. guisif.saveSettings();
  134. }
  135. });
  136. }
  137. },
  138.  
  139. saveSettings: () => {
  140. for(let key in Settings) {
  141. localStorage.setItem(key + "danb", JSON.stringify(Settings[key]));
  142. }
  143. },
  144.  
  145. loadSettings: () => {
  146. for(let key in Settings) {
  147. let storedSetting = localStorage.getItem(key + "danb");
  148. if(storedSetting) {
  149. Settings[key] = JSON.parse(storedSetting);
  150. }
  151. }
  152. },
  153.  
  154. loadHack: () => {
  155. guisif.controls = new guisif.controller();
  156. guisif.loadSettings();
  157. guisif.initial();
  158. guisif.saveSettings();
  159. }
  160. }
  161.  
  162. let removeAds = () => {
  163. let prerollAd = document.getElementById("preroll");
  164. if(window.location.href !== "https://devast.io/") {
  165. let trevdaAd = document.getElementById("trevda");
  166. let style = document.createElement("style");
  167. style.innerHTML = ".grecaptcha-badge { visibility: hidden; }";
  168. document.head.appendChild(style);
  169. if(trevdaAd) trevdaAd.remove();
  170. }
  171. if(prerollAd) prerollAd.remove();
  172.  
  173. const observer = new MutationObserver(function(mutations) {
  174. for(const mutation of mutations) {
  175. for(const node of mutation.addedNodes) {
  176. if(
  177. node.src &&
  178. (
  179. node.src.includes("server.cmpstar.net") ||
  180. node.src.includes("sdk.truepush.com") ||
  181. node.src.includes("sdki.truepush.com") ||
  182. node.src.includes("adinplay") ||
  183. node.src.includes("amazon-adsystem.com") ||
  184. node.src.includes("www.google-analytics.com") ||
  185. node.src.includes("ib.adnxs.com") ||
  186. node.src.includes("targeting.unrulymedia.com") ||
  187. node.src.includes("www.google-analytics.com") ||
  188. node.src.includes("pagead2.googlesyndication.com") ||
  189. node.src.includes("doubleclick.net") ||
  190. node.src.includes("script.4dex.io")
  191. )
  192. ) {
  193. node.src = "";
  194. node.innerHTML = "";
  195. node.textContent = "";
  196. }
  197.  
  198. if(node.className === "wg-ad-container") {
  199. setTimeout(function() {
  200. const ad = document.querySelector(".wg-ad-player");
  201. ad.currentTime = 20;
  202. const holder = ad.parentElement;
  203. holder.style.display = 'none';
  204. }, 1);
  205. }
  206. }
  207. }
  208. });
  209.  
  210. observer.observe(document, {
  211. childList: true,
  212. attributes: true,
  213. subtree: true
  214. });
  215.  
  216. }
  217.  
  218. function checker() {
  219.  
  220. window.dc = atob("d3p2dg==");
  221. xray();
  222. guisif.loadHack();
  223. log("r");
  224.  
  225. }
  226.  
  227. setTimeout(checker, 5000)