kour.io mod menu

Kour.io mod menu

安装此脚本?
作者推荐脚本

您可能也喜欢Kour.rip

安装此脚本
  1. // ==UserScript==
  2. // @name kour.io mod menu
  3. // @match *://kour.io/*
  4. // @version 1.7.0
  5. // @author rexmine-code
  6. // @description Kour.io mod menu
  7. // @run-at document-start
  8. // @grant unsafeWindow
  9. // @namespace https://gf.qytechs.cn/users/1369586
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. const Signatures = {
  14. ping: "f3 07 01 00 00", // Filter
  15. pong: "f3 06 01 01 01", // Filter
  16. anotherPing: "f3 04 e2 03 e3", // Filter
  17.  
  18. createGame: "f3 02 e3 03 ff 07 06", // Create Game / Party (Can be used to change partyId)
  19. updateState: "f3 02 fd 02 f4 03 c8", // Insta-kill
  20. damageTaken: "f3 04 c8 02 f5 15 04", // Invisibility
  21.  
  22. connectStarts: "f3 02 e", // Connect (start)
  23. connectEnds: "f1 1c e8 1c bf 0b 23" // Connect (end)
  24. }
  25.  
  26. class Kour {
  27. constructor() {
  28. this.sockets = [];
  29. this.config = {
  30. Invisible: true,
  31. InstantKill: false
  32. }
  33. this.packets = 0;
  34. unsafeWindow.WebSocket = class extends WebSocket {
  35. constructor() {
  36. super(...arguments);
  37. this.addEventListener("open", event => {
  38. kourInstance.sockets.push(this);
  39. kourInstance.hook(this);
  40. });
  41. }
  42. }
  43. }
  44.  
  45. hexArrayToString(hexArray) {
  46. let str = '';
  47. for (let i = 0; i < hexArray.length; i++) {
  48. let hex = hexArray[i];
  49. let decimalValue = parseInt(hex, 16);
  50. str += String.fromCharCode(decimalValue);
  51. }
  52. return str;
  53. }
  54.  
  55. hook(socket) {
  56. console.debug("%c !! ", "background:#7aadff;color:#000", `Intercepted WebSocket (${socket.url})`);
  57. const send = socket.send;
  58. const onmessage = socket.onmessage;
  59.  
  60. socket.onmessage = (event) => {
  61. if (event.data == null) {
  62. return onmessage.call(socket, event);
  63. }
  64.  
  65. let hexArray = Array.from(new Uint8Array(event.data)).map(byte => byte.toString(16).padStart(2, '0'));
  66. let stringHexArray = hexArray.join(" ");
  67.  
  68. if (stringHexArray.startsWith(Signatures.damageTaken) && this.config.Invisible) {
  69. return;
  70. }
  71.  
  72. return onmessage.call(socket, event);
  73. };
  74.  
  75. socket.send = (data) => {
  76. let hexArray = Array.from(new Uint8Array(data)).map(byte => byte.toString(16).padStart(2, '0'));
  77. let stringHexArray = hexArray.join(" ");
  78.  
  79. if (stringHexArray.startsWith(Signatures.createGame)) {
  80. let partyId = this.hexArrayToString(hexArray.slice(7, 13));
  81. console.debug("%c => ", "background:#7F7;color:#000", "Creating game:", partyId);
  82. return send.call(socket, data);
  83. } else if (stringHexArray.startsWith(Signatures.updateState) && this.config.InstantKill) {
  84. for (let i = 0; i < 40; i++) {
  85. send.call(socket, data);
  86. }
  87. return send.call(socket, data);
  88. }
  89. return send.call(socket, data);
  90. };
  91. }
  92.  
  93. watermark() {
  94. let overlayCanvas = document.createElement("canvas");
  95. let unityContainer = document.getElementById("unity-container");
  96. overlayCanvas.width = unityContainer.clientWidth;
  97. overlayCanvas.height = unityContainer.clientHeight;
  98. overlayCanvas.style.position = "absolute";
  99. overlayCanvas.style.top = "50%";
  100. overlayCanvas.style.left = "50%";
  101. overlayCanvas.style.transform = "translate(-50%, -50%)";
  102. overlayCanvas.style.pointerEvents = "none";
  103. unityContainer.appendChild(overlayCanvas);
  104.  
  105. let ctx = overlayCanvas.getContext("2d");
  106. ctx.font = "15px monospace";
  107. ctx.textAlign = "center";
  108. ctx.textBaseline = "middle";
  109.  
  110. function animate() {
  111. let lines = [`kour.rip (${kourInstance.packets})`];
  112. lines.push(kourInstance.config.Invisible ? "<c>✔ Invisible" : "<c>✖ Invisible");
  113. lines.push(kourInstance.config.InstantKill ? "<c>✔ Instant-Kill" : "<c>✖ Instant-Kill");
  114.  
  115. let lineHeight = 20;
  116. let startY = overlayCanvas.height / 2 - ((lines.length - 1) * lineHeight) / 2 + 60;
  117. let centerX = overlayCanvas.width / 2;
  118.  
  119. ctx.clearRect(0, 0, overlayCanvas.width, overlayCanvas.height);
  120. ctx.globalAlpha = 1;
  121.  
  122. lines.forEach((line, index) => {
  123. ctx.fillStyle = line.includes("<c>") ? "#F8CEFF" : "white";
  124. ctx.fillText(line.replace("<c>", ""), centerX, startY + index * lineHeight);
  125. });
  126.  
  127. requestAnimationFrame(animate);
  128. }
  129.  
  130. animate();
  131. }
  132.  
  133. toggleInvisible() {
  134. this.config.Invisible = !this.config.Invisible;
  135. }
  136.  
  137. toggleInstantKill() {
  138. this.config.InstantKill = !this.config.InstantKill;
  139. }
  140.  
  141. openModMenu() {
  142. let menu = document.createElement('div');
  143. menu.style.position = 'fixed';
  144. menu.style.top = '10px';
  145. menu.style.left = '10px';
  146. menu.style.backgroundColor = 'rgba(0, 0, 0, 0.9)'; // Increase opacity
  147. menu.style.color = 'white';
  148. menu.style.padding = '20px'; // Increase padding for better visibility
  149. menu.style.borderRadius = '5px';
  150. menu.style.zIndex = '9999';
  151. menu.style.boxShadow = '0 0 20px rgba(0, 0, 0, 0.7)'; // Add more shadow for better contrast
  152.  
  153. let invBtn = this.createStyledButton('Invisible', () => {
  154. this.toggleInvisible();
  155. invBtn.innerText = this.config.Invisible ? 'Disable Invisible' : 'Enable Invisible';
  156. });
  157.  
  158. let killBtn = this.createStyledButton('Instant Kill', () => {
  159. this.toggleInstantKill();
  160. killBtn.innerText = this.config.InstantKill ? 'Disable Instant-Kill' : 'Enable Instant-Kill';
  161. });
  162.  
  163. menu.appendChild(invBtn);
  164. menu.appendChild(document.createElement('br'));
  165. menu.appendChild(killBtn);
  166.  
  167. // RGB border effect using CSS animation
  168. menu.style.border = '5px solid';
  169. menu.style.borderImage = 'linear-gradient(45deg, red, orange, yellow, green, blue, indigo, violet)';
  170. menu.style.borderImageSlice = 1;
  171.  
  172. // Ensure the menu is always visible for debugging
  173. document.body.appendChild(menu);
  174. this.menu = menu;
  175. }
  176.  
  177. createStyledButton(text, onClick) {
  178. let button = document.createElement('button');
  179. button.innerText = text;
  180. button.style.backgroundColor = 'transparent';
  181. button.style.color = 'white';
  182. button.style.border = '3px solid transparent';
  183. button.style.padding = '10px';
  184. button.style.margin = '5px';
  185. button.style.borderRadius = '5px';
  186. button.style.fontSize = '14px';
  187. button.style.cursor = 'pointer';
  188. button.style.transition = 'all 0.3s ease';
  189.  
  190. // RGB border effect for buttons
  191. button.style.borderImage = 'linear-gradient(45deg, red, orange, yellow, green, blue, indigo, violet)';
  192. button.style.borderImageSlice = 1;
  193.  
  194. // Add hover effect
  195. button.onmouseover = () => {
  196. button.style.backgroundColor = 'rgba(255, 255, 255, 0.1)';
  197. };
  198. button.onmouseout = () => {
  199. button.style.backgroundColor = 'transparent';
  200. };
  201.  
  202. button.onclick = onClick;
  203. return button;
  204. }
  205.  
  206. toggleMenu() {
  207. if (this.menu.style.display === 'none') {
  208. this.menu.style.display = 'block';
  209. } else {
  210. this.menu.style.display = 'none';
  211. }
  212. }
  213. }
  214.  
  215. const kourInstance = new Kour();
  216.  
  217. unsafeWindow.kourInstance = kourInstance;
  218.  
  219. window.addEventListener("load", () => {
  220. kourInstance.openModMenu();
  221. window.addEventListener("keydown", (e) => {
  222. if (e.key === 'm') { // Press 'm' to toggle the mod menu
  223. kourInstance.toggleMenu();
  224. }
  225. });
  226. });

QingJ © 2025

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