Void Console

Press insert to close/open the menu.

目前為 2024-06-25 提交的版本,檢視 最新版本

此腳本不應該直接安裝,它是一個供其他腳本使用的函式庫。欲使用本函式庫,請在腳本 metadata 寫上: // @require https://update.gf.qytechs.cn/scripts/498780/1400282/Void%20Console.js

  1. // ==UserScript==
  2. // @name Void Console
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.2
  5. // @description Press insert to close/open the menu.
  6. // @author KILLEREK1337
  7. // @match *://*.kogama.com/page/webgl-frame/*
  8. // @match *://*.kogama.com.br/page/webgl-frame/*
  9. // @match https*://*friends.kogama.com/page/webgl-frame*
  10. // @icon https://res.cloudinary.com/rglweb/image/fetch/f_auto/https://www.raygrahams.com/images/thumbs/0010592_700.jpg
  11. // @run-at document-start
  12. // @grant none
  13. // ==/UserScript==
  14.  
  15. const wsServers = [];
  16. const sockets = [];
  17. let gamePlayers = [];
  18.  
  19.  
  20. const speeds = new Map(Object.entries({
  21. shotgun: 500,
  22. bazooka: 500,
  23. central: 250,
  24. sword: 300,
  25. pistols: 150,
  26. pistol: 200,
  27. shuriken: 300
  28. }));
  29.  
  30. const reloads = new Map(speeds.entries());
  31.  
  32. const push = Array.prototype.push;
  33. const foreach = Array.prototype.forEach;
  34. const uint8array = Uint8Array;
  35. const uint32array = Uint32Array;
  36. const uint16array = Uint16Array;
  37. const float32array = Float32Array;
  38. const settimeout = setTimeout;
  39. const error = Error;
  40. const fromCharCode = String.fromCharCode;
  41. const messageevent = MessageEvent;
  42.  
  43. let normalizedSurface = 0;
  44. let weapon = "central";
  45. const symbol = Symbol("onmessage");
  46. let dragging = false;
  47. let position;
  48. let dX;
  49. let dY;
  50. let playerSid = 0;
  51. let startYPort = false;
  52. let actorNR = 0;
  53.  
  54. function wsServer(eventData) {
  55. const event = new messageevent("message", eventData);
  56.  
  57. for (const listener of wsServers) {
  58. listener(event);
  59. };
  60. }
  61.  
  62. function to32xConvertedByte(n) {
  63. return new uint8array(new uint32array([n]).buffer).reverse();
  64. }
  65.  
  66. function to16xConvertedByte(n) {
  67. return new uint8array(new uint16array([n]).buffer).reverse();
  68. }
  69.  
  70. function to32xConvertedFloat(n) {
  71. return new uint8array(new float32array([n]).buffer);
  72. }
  73.  
  74. function to32BitNumber(chunk) {
  75. return ((chunk[0] << 8 |
  76. chunk[1]) << 8 |
  77. chunk[2]) << 8 |
  78. chunk[3];
  79. }
  80.  
  81. function findDoubles(array) {
  82. const doubles = [];
  83. const getDouble = () => array.indexOf(102);
  84. const doublesCount = array.filter(e => e == 102).length;
  85.  
  86. for (let i = 0; i < doublesCount; i++) {
  87. const doubleIndex = getDouble();
  88. const double = new uint8array([
  89. array[doubleIndex + 4],
  90. array[doubleIndex + 3],
  91. array[doubleIndex + 2],
  92. array[doubleIndex + 1]]).buffer;
  93. doubles.push({
  94. double: new float32array(double)[0],
  95. startIndex: doubleIndex + 1
  96. });
  97. };
  98.  
  99. return doubles;
  100. };
  101.  
  102. function AOBScan(arr1, arr2) {
  103. let index = 0;
  104. let index1 = 0;
  105.  
  106. while (index < arr1.length && index1 < arr2.length) {
  107. if (arr1[index] === arr2[index1]) {
  108. index++;
  109. }
  110. index1++;
  111. }
  112.  
  113. return index === arr1.length;
  114. }
  115.  
  116. HTMLElement.prototype.requestFullscreen = new Proxy(HTMLElement.prototype.requestFullscreen, {
  117. apply(target, that, args) {
  118. return Reflect.apply(target, document.documentElement, args);
  119. }
  120. });
  121.  
  122. Object.defineProperty(Object.prototype, "setPosition", {
  123. get() {
  124. return function setPosition(x, y, z) {
  125. const dx = parseFloat(x);
  126. const dy = parseFloat(y);
  127. const dz = parseFloat(z);
  128.  
  129. if (!isFinite(dx) || !isFinite(dy) || !isFinite(dz)) return;
  130.  
  131. var p = this.panner;
  132. if (p.positionX) {
  133. if (p.positionX.value !== x) {
  134. p.positionX.value = x;
  135. }
  136. if (p.positionY.value !== y) {
  137. p.positionY.value = y;
  138. }
  139. if (p.positionZ.value !== z) {
  140. p.positionZ.value = z
  141. }
  142. } else if (p._x !== x || p._y !== y || p._z !== z) {
  143. p.setPosition(x, y, z);
  144. p._x = x;
  145. p._y = y;
  146. p._z = z
  147. }
  148.  
  149. }
  150. },
  151. set() {
  152.  
  153. }
  154. });
  155.  
  156. Object.defineProperty(Object.prototype, "setPitch", {
  157. get() {
  158. return function setPitch(value) { }
  159. }, set() { }
  160. });
  161.  
  162. Object.defineProperty(Object.prototype, "quit", {
  163. get() {
  164. return function quit() { }
  165. }, set(quitFunc) {
  166. alert(quitFunc);
  167. }
  168. });
  169.  
  170. Object.defineProperty(WebSocket.prototype, "onmessage", {
  171. get() {
  172. return this[symbol];
  173. }, set(callback) {
  174. this[symbol] = callback;
  175. this.addEventListener("message", callback);
  176. packets.notification("Hooked peer connection at " + this.url);
  177. this.addEventListener("message", function(packet) {
  178. const packet_ = new uint8array(packet.data);
  179. const arr = new uint8array(event.data);
  180. const arr_ = [...arr];
  181. top.packets.packetsReceived.push(arr_);
  182. switch (packet_[2]) {
  183. case 58:
  184. packets.central();
  185. break;
  186. case 81:
  187. onTickAction();
  188. break;
  189. case 29:
  190. packets.setPlayerWeapon(packet_);
  191. break;
  192. case 255:
  193. const ints = [];
  194. packet_.forEach((val, index, array) => {
  195. if (array[index - 4] === 105) {
  196. let args = [array[index - 3] << 8, array[index - 2] << 8, array[index - 1] << 8, array[index]].reverse();
  197. ints.push(args[0] | args[1] | args[2] | args[3]);
  198. }
  199. });
  200. actorNR = ints[0];
  201. break;
  202. case 61:
  203. const players = fromCharCode.apply(null,
  204. packet_);
  205. gamePlayers = [...new Set(players.match(/(\d+)/gm).filter(e => e.length == 6))];
  206. gamePlayers.forEach(player => {
  207. const e = document.createElement("option");
  208. e.innerHTML = player;
  209. e.value = player;
  210. document.querySelector("#select1").append(e);
  211. });
  212.  
  213. playerSid = parseInt(players.split(":")[1].replace(',"spawnRoleAvatarIds"', ""));
  214. break;
  215. case 2:
  216. const doubles = findDoubles(arr);
  217. const index = arr.indexOf(doubles[1].startIndex);
  218. const index1 = arr.indexOf(doubles[0].startIndex);
  219. const playerSidCurrent = to32BitNumber(arr_.slice(4, 11));
  220.  
  221. top.console.log(playerSidCurrent, actorNR, playerSid);
  222.  
  223. if (playerSidCurrent != playerSid && actorNR != to32BitNumber(arr_.slice(4, 11))) break;
  224.  
  225. top.console.log("Player position: " + doubles[0].double + "," + doubles[1].double + "," + doubles[2].double);
  226.  
  227. packets.motionY = ~~doubles[1].double / normalizedSurface;
  228. normalizedSurface = normalizedSurface * 0.5 + (~~doubles[1].double) * 0.5;
  229.  
  230. if (top.flightY) {
  231. const yCoord = parseInt(top.flightY);
  232. const _ = to32xConvertedFloat(yCoord || 0.1);
  233.  
  234. arr[index] = _[0];
  235. arr[index + 1] = _[1];
  236. arr[index + 2] = _[2];
  237. arr[index + 3] = _[3];
  238.  
  239. return wsServer({
  240. data: arr.buffer
  241. });
  242. } else if (top.yPort) {
  243. startYPort = true;
  244. }
  245.  
  246. if (top.impulseTool && doubles[0] && doubles[1] && doubles[2]) {
  247. packets.lookAt(doubles[0].double, doubles[1].double, doubles[2].double);
  248. }
  249.  
  250. if (top.scaffold) {
  251. packets.permetuation(doubles[0].double, doubles[1].double - 1, doubles[2].double);
  252. }
  253. break;
  254. }
  255. return false;
  256.  
  257. });
  258.  
  259. wsServers.push(callback.bind(this));
  260. sockets.push(this);
  261. }
  262. });
  263.  
  264. let delta = 0;
  265. let lastTick = Date.now();
  266. let holdingPrimary = false;
  267.  
  268. function onTickAction() {
  269. if (top.rapidFire) {
  270. packets[weapon]();
  271. };
  272.  
  273. if (top.arf) {
  274. packets.actToAll("central");
  275. packets.actToAll("none");
  276. };
  277.  
  278. if (top.sh_) {
  279. packets.actToAll("hpglitch");
  280. }
  281.  
  282. if (top.rapidMode) {
  283. packets.central();
  284. packets[weapon]();
  285. }
  286.  
  287. if (startYPort) {
  288. packets.yPort();
  289. startYPort = false;
  290.  
  291. }
  292. }
  293.  
  294. const client_menu = document.createElement("div");
  295. client_menu.style = [
  296. "position: fixed",
  297. "color: #000000",
  298. "z-index: 10",
  299. "top: 10%",
  300. "right: 10%",
  301. "font-weight: slim",
  302. "font-family: 'Roboto'",
  303. "scrollbar-color: #000000 #000000",
  304. "user-select: none"
  305. ].join(";");
  306. client_menu.innerHTML = `
  307. <!DOCTYPE html>
  308. <html lang="en">
  309. <head>
  310. <meta charset="UTF-8">
  311. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  312. <link href='https://fonts.googleapis.com/css?family=Roboto' rel='stylesheet'>
  313. <style>
  314. @keyframes glow {
  315. 0% {
  316. text-shadow: 0 0 5px black, 0 0 10px black, 0 0 15px black, 0 0 20px black, 0 0 25px black, 0 0 30px black, 0 0 35px black;
  317. }
  318. 50% {
  319. text-shadow: 0 0 10px black, 0 0 20px black, 0 0 30px black, 0 0 40px black, 0 0 50px black, 0 0 60px black, 0 0 70px black;
  320. }
  321. 100% {
  322. text-shadow: 0 0 5px black, 0 0 10px black, 0 0 15px black, 0 0 20px black, 0 0 25px black, 0 0 30px black, 0 0 35px black;
  323. }
  324. }
  325.  
  326. .glowing-text {
  327. animation: glow 2s infinite ease-in-out;
  328. }
  329.  
  330. :root {
  331. --accent: #00B400;
  332. }
  333.  
  334. .feature {
  335. width: 100% !important;
  336. height: 30px !important;
  337. background: rgba(0, 0, 0, 0.3);
  338. backdrop-filter: blur(5px);
  339. border-radius: 40px;
  340. text-align: center;
  341. display: inline-block;
  342. vertical-align: middle;
  343. margin: 2px;
  344. font-size: 15px;
  345. transition: all 1s;
  346. }
  347.  
  348. .feature:hover {
  349. transition: all 1s;
  350. transform: scale(105%);
  351. }
  352. </style>
  353. </head>
  354. <body>
  355. <div id="menu" style="width: 440px; height: 300px; border-top: 0px solid; background: rgba(0, 0, 0, 0.0); color: #000000; position: absolute; top: 25%; right: 25%; font-family: Arial; font-size: 35px; cursor: move;">
  356. <span class="glowing-text" style="position: absolute; top: 10px; left: 30px; color: #000000">Void Console</span>
  357. <div style="font-size: 16.7px; position: absolute; top: 45px; left: 28px">
  358. <span class="kogama__" onclick="[...document.querySelectorAll('column')].forEach(e => e.style.display='none'); [...document.querySelectorAll('column')][0].style.display='block'">Weapons</span>
  359. <span onclick="[...document.querySelectorAll('column')].forEach(e => e.style.display='none'); [...document.querySelectorAll('column')][3].style.display='block'">Exploits</span>
  360. </div>
  361. <div style="width: 80%; height: 60%; position: absolute; top: 25%; left: 9%; border: 0px solid; border-color: rgba(0, 0, 0, 0.0); overflow-y: scroll; scrollbar-width: none; font-size: 14px">
  362. <column>
  363. <table style="color: white">
  364. <thead>
  365. <tr>
  366. <th>Weapon</th>
  367. </tr>
  368. </thead>
  369. <tbody>
  370. <tr>
  371. <td onclick="top.packets.cube_gun(null, top.packets.cubeID)">Cube-Gun</td>
  372. </tr>
  373. <tr>
  374. <td onclick="top.packets.impulse_gun()">Impulse Gun</td>
  375. </tr>
  376. <tr>
  377. <td onclick="top.packets.bazooka()">Bazooka</td>
  378. </tr>
  379. <tr>
  380. <td onclick="top.packets.pistols()">Double Revolvers</td>
  381. </tr>
  382. <tr>
  383. <td onclick="top.packets.heal_gun()">Heal Gun</td>
  384. </tr>
  385. <tr>
  386. <td onclick="top.packets.central()">Center Gun</td>
  387. </tr>
  388. <tr>
  389. <td onclick="top.packets.shotgun()">Shotgun</td>
  390. </tr>
  391. <tr>
  392. <td onclick="top.packets.shuriken()">Shuriken</td>
  393. </tr>
  394. <tr>
  395. <td onclick="top.packets.rail()">Rail</td>
  396. </tr>
  397. <tr>
  398. <td onclick="top.packets.sword()">Sword</td>
  399. </tr>
  400. <tr>
  401. </tr>
  402. <tr>
  403. <td onclick="top.packets.pistol()">Revolver</td>
  404. </tr>
  405. </tbody>
  406. </table>
  407. </column>
  408. <column style="display: none">
  409. Max player health: <input type="range" value="100" min="1" max="1000" onchange="top.packets.maxHealth(this.value);document.getElementById('maxHealth').innerHTML=this.value"> <span id="maxHealth">100</span> <br>
  410. <select id="select" style="border: 2px solid var(--accent); border-top: 4px solid var(--accent); color: #fff; outline: 0; background: #111111">
  411. <option value="cube_gun"> CubeGun </option>
  412. <option value="impulse_gun"> Impulse Gun </option>
  413. <option value="bazooka"> Bazooka </option>
  414. <option value="flame"> Flametower </option>
  415. <option value="heal_gun"> Healer Gun </option>
  416. <option value="pistols"> Pistols </option>
  417. <option value="central"> Central </option>
  418. <option value="shuriken"> Shuriken </option>
  419. <option value="shotgun"> Shotgun </option>
  420. <option value="rail"> Rail Gun </option>
  421. <option value="sword"> Sword </option>
  422. <option value="growthgun"> Slapgun Spawner </option>
  423. <option value="rail"> Pistol (1x) </option>
  424. <option value="immortality"> Buble (halfly patched) </option>
  425. <option value="setScale"> Scalarity </option>
  426. <option value="cube"> Spawn Yourself </option>
  427. <option value="hpglitch"> Instant HP </option>
  428. </select> <span onclick="top.packets.actToAll(document.querySelector('#select').value)"> Execute </span><br>
  429. Aggressive Crash: <select id="select1" style="border: 2px solid var(--accent); border-top: 4px solid var(--accent); color: #fff; outline: 0; background: #111111"></select> <span onclick="top.packets.crash(document.querySelector('#select1').value)"> Crash! </span><br>
  430. </column>
  431. <column style="display: none">
  432. <div class='no_kirka'> Flight Fixed Y: <input type="range" min="-100" max="100" value="0" onchange="top.flightY = this.value"> </div> <br>
  433. Flight Fixed Y state: <input type="checkbox" onchange="top.flightY=this.checked"> <br>
  434. </column>
  435. <column style="display: none; word-break: break-word; width: 100%; height: 100%; max-width: 100%; max-height: 100%; min-width: 100%; min-height: 100%;">
  436. <span class="feature" onclick="top.packets.immortality();this.innerHTML=this.innerHTML=='AutoHeal: OFF'?'AutoHeal: ON':'AutoHeal: OFF'">AutoHeal: OFF</span> <br>
  437. <span class="feature" onclick="top.packets.impulse_tool();this.innerHTML=this.innerHTML=='AutoShot/InfAmmo: OFF'?'AutoShot/InfAmmo: ON':'AutoShot/InfAmmo: OFF'">AutoShot/InfAmmo: OFF</span><br>
  438. <column id="logging" style="display: none; overflow-y: scroll; max-width: 100%; max-height: 100%; width: 100%; height: 100%; scrollbar-width: none">
  439. <span onclick="top.packets.sniffer();if(this.innerHTML=='Sniffer: OFF'){this.innerHTML='Sniffer: ON'}else{this.innerHTML='Sniffer: OFF'}">Sniffer: OFF</span><br>
  440. <span onclick="top.packets.repeatPackets()"> Repeat packets queue </span> <br>
  441. <div id="packetsSniffer" style="font-size: 7px"> Packets will appear here </div>
  442. </column>
  443. <column style="display: none; overflow: scroll; max-width: 100%; max-height: 100%; width: 100
  444.  
  445. `;
  446. client_menu.id = "clientMenu";
  447. client_menu.style.setProperty("accent", "#00B400");
  448. client_menu.addEventListener("mousedown", e => {
  449. dragging = true;
  450. position = e;
  451. dX = e.clientX - client_menu.getBoundingClientRect().left;
  452. dY = e.clientY - client_menu.getBoundingClientRect().top;
  453. });
  454.  
  455. document.addEventListener("mousedown", e => {
  456. holdingPrimary = true;
  457. });
  458.  
  459. document.addEventListener("mouseup", e => {
  460. dragging = false;
  461.  
  462. holdingPrimary = false;
  463. });
  464.  
  465. document.addEventListener("mousemove", e => {
  466. if (!dragging) return;
  467.  
  468. const menuX = e.clientX// + dX;
  469. const menuY = e.clientY// + dY;
  470. const deltaX = menuX - position.clientX;
  471. const deltaY = menuY - position.clientY;
  472.  
  473. const currentX = parseInt(client_menu.style.left);
  474. const currentY = parseInt(client_menu.style.top);
  475.  
  476. const newX = currentX - deltaX;
  477. const newY = currentY - deltaY;
  478.  
  479. client_menu.style.left = newX + "px";
  480. client_menu.style.top = newY + "px";
  481. position = e;
  482. });
  483.  
  484. document.addEventListener("keyup", e => {
  485. switch (e.code) {
  486. case "ShiftRight":
  487. client_menu.style.display = client_menu.style.display == "block" ? "none" : "block";
  488. break;
  489.  
  490. }
  491. });
  492.  
  493. document.documentElement.append(client_menu);
  494.  
  495. const packets = {
  496. motionY: 0,
  497. cubeID: 7,
  498. packetsReceived: [],
  499. sniffing: false,
  500. repeatPackets() {
  501. this.packetsReceived.forEach(packet => {
  502. const encodedPacket = new Uint8Array(packet);
  503. wsServer({ data: encodedPacket });
  504. });
  505. },
  506. sendPacket(packet) {
  507. const encodedPacket = new Uint8Array(JSON.parse(packet));
  508. this.notification("Sending packet " + encodedPacket);
  509. wsServer({ data: encodedPacket });
  510. },
  511. setPlayerWeapon(packet) {
  512. const arr = [...packet];
  513.  
  514. const weaponSid = arr.slice(44, 48);
  515. const pID = arr.slice(7, 11);
  516. const myPID = [...to32xConvertedByte(playerSid)];
  517. const mappings = new Map(Object.entries({
  518. 1: "central",
  519. 4: "bazooka",
  520. 10: "flame",
  521. 70: "heal_gun",
  522. 6: "rail",
  523. 2: "impulse_gun",
  524. 8: "sword",
  525. 13: "pistols",
  526. 9: "shotgun",
  527. 11: "cube_gun"
  528. }));
  529. let weaponName;
  530.  
  531. if (pID[0] != myPID[0] ||
  532. pID[1] != myPID[1] ||
  533. pID[2] != myPID[2] ||
  534. pID[3] != myPID[3]) return;
  535.  
  536. weaponName = mappings.get(String(to32BitNumber(weaponSid)));
  537.  
  538. //top.console.log("Weapon SID: " + to32BitNumber(weaponSid) + " weapon name: " + weaponName);
  539.  
  540. if (weaponName) {
  541. weapon = weaponName;
  542.  
  543. packets.notification("Picking " + weaponName + "!");
  544. }
  545.  
  546. if (weaponName == "cube_gun") {
  547. packets.cubeID = arr[116];
  548. }
  549. },
  550. sniffer() {
  551. this.sniffing = !this.sniffing;
  552. if (!this.sniffing) {
  553. document.getElementById("packetsSniffer").innerHTML = this.packetsReceived.map(packet => `<span class=".shadow" onclick="top.packets.sendPacket('${JSON.stringify(packet)}')">${packet.join(", ")} is ${String.fromCharCode(...packet)}</span>`).join("<br>");
  554. } else this.packetsReceived = [];
  555. },
  556. actToAll(action) {
  557. gamePlayers.filter(e => e.length == 6)
  558. .forEach(e => this[action](e, packets.cubeID));
  559. },
  560. crash(pid = 0) {
  561. this.none(pid);
  562. this.hpglitch(pid, -NaN);
  563. this.cube(pid, 0, 0, 0);
  564. this.movement(pid);
  565. this.none(pid);
  566. },
  567. movement(pid = playerSid) {
  568. wsServer({ data: new uint8array([
  569. 243, 2, 0, 7, 22, ...to32xConvertedByte(pid), 0, 0, 0, 0, 0, 0
  570. ]).buffer });
  571. },
  572. fire(pid = playerSid) {
  573. wsServer({ data: new uint8array([
  574. 243, 4, 29, 0, 3, 22, 105, ...to32xConvertedByte(pid), 70, 68, 0, 0, 0, 1, 115, 0, 8, 105, 115, 70, 105, 114, 105, 110, 103, 111, 1, 254, 105, 0, 0, 0, 0
  575. ]).buffer });
  576. },
  577. combatYaw() {
  578. if (!document.pointerLockElement) return;
  579.  
  580. document.pointerLockElement.dispatchEvent(new MouseEvent("mousemove", {
  581. movement: Math.random() * 10
  582. }));
  583. },
  584. changeCubeId(cubeID) {
  585. this.cubeID = parseInt(cubeID);
  586. },
  587. cube(pid = playerSid, x = 1, y = 1, z = 1) {
  588. pid = playerSid;
  589. wsServer({ data: new uint8array([
  590. 243,4,79,0,14,24,102,...to32xConvertedFloat(x),25,102,...to32xConvertedFloat(y),26,102,...to32xConvertedFloat(z),27,102,0,0,0,0,28,102,0,0,0,0,29,102,0,0,0,0,30,102,0,0,0,0,72,121,0,3,105,...to32xConvertedByte(pid),0,0,0,0,255,255,255,255,101,111,0,20,105,0,0,0,0,128,105,0,0,0,1,58,105,255,255,255,255,92,105,255,255,255,255,254,105,0,0,0,0
  591. ]).buffer });
  592. },
  593. rail(pid = playerSid) {
  594. wsServer({ data: new uint8array([
  595. 243, 4, 29, 0, 3, 22, 105, ...to32xConvertedByte(pid), 70, 68, 0, 0, 0, 1, 115, 0, 11, 99, 117, 114, 114, 101, 110, 116, 73, 116, 101, 109, 68, 0, 0, 0, 3, 115, 0, 4, 116, 121, 112, 101, 105, 0, 0, 0, 6, 115, 0, 9, 118, 97, 114, 105, 97, 110, 116, 73, 100, 105, 0, 0, 0, 0, 115, 0, 15, 117, 112, 100, 97, 116, 101, 73, 116, 101, 109, 83, 116, 97, 116, 101, 105, 0, 0, 0, 4, 254, 105, 0, 0, 0, 0
  596. ]).buffer });
  597. weapon = "rail";
  598. },
  599. sword(pid = playerSid) {
  600. wsServer({ data: new uint8array([
  601. 243, 4, 29, 0, 3, 22, 105, ...to32xConvertedByte(pid), 70, 68, 0, 0, 0, 1, 115, 0, 11, 99, 117, 114, 114, 101, 110, 116, 73, 116, 101, 109, 68, 0, 0, 0, 3, 115, 0, 4, 116, 121, 112, 101, 105, 0, 0, 0, 8, 115, 0, 9, 118, 97, 114, 105, 97, 110, 116, 73, 100, 105, 0, 0, 0, 0, 115, 0, 15, 117, 112, 100, 97, 116, 101, 73, 116, 101, 109, 83, 116, 97, 116, 101, 105, 0, 0, 0, 4, 254, 105, 0, 0, 0, 0
  602. ]).buffer });
  603. weapon = "sword";
  604. },
  605. growthgun(pid = playerSid) {
  606. wsServer({ data: new uint8array([
  607. 243, 4, 29, 0, 3, 22, 105, ...to32xConvertedByte(pid), 70, 68, 0, 0, 0, 2, 115, 0, 11, 99, 117, 114, 114, 101, 110, 116, 73, 116, 101, 109, 68, 0, 0, 0, 3, 115, 0, 4, 116, 121, 112, 101, 105, 0, 0, 0, 62, 115, 0, 9, 118, 97, 114, 105, 97, 110, 116, 73, 100, 105, 0, 0, 0, 0, 115, 0, 15, 117, 112, 100, 97, 116, 101, 73, 116, 101, 109, 83, 116, 97, 116, 101, 105, 0, 0, 0, 4, 115, 0, 9, 97, 110, 105, 109, 97, 116, 105, 111, 110, 68, 0, 0, 0, 2, 115, 0, 5, 115, 116, 97, 116, 101, 115, 0, 4, 73, 100, 108, 101, 115, 0, 9, 116, 105, 109, 101, 83, 116, 97, 109, 112, 105, 80, 15, 108, 52, 254, 105, 0, 0, 0, 0
  608. ]).buffer });
  609. weapon = "growthgun";
  610. },
  611. pistol(pid = playerSid) {
  612. wsServer({ data: new uint8array([
  613. 243, 4, 29, 0, 3, 22, 105, ...to32xConvertedByte(pid), 70, 68, 0, 0, 0, 1, 115, 0, 11, 99, 117, 114, 114, 101, 110, 116, 73, 116, 101, 109, 68, 0, 0, 0, 3, 115, 0, 4, 116, 121, 112, 101, 105, 0, 0, 0, 12, 115, 0, 9, 118, 97, 114, 105, 97, 110, 116, 73, 100, 105, 0, 0, 0, 0, 115, 0, 15, 117, 112, 100, 97, 116, 101, 73, 116, 101, 109, 83, 116, 97, 116, 101, 105, 0, 0, 0, 4, 254, 105, 0, 0, 0, 0
  614. ]).buffer });
  615. weapon = "pistol";
  616. },
  617. antirfire() {
  618. top.arf_ = !top.arf_;
  619. },
  620. cube_gun(pid = playerSid, id = null) {
  621. if (!pid) pid = playerSid;
  622. if (!id) id = this.cubeID;
  623.  
  624. wsServer({ data: new uint8array([
  625. 243, 4, 29, 0, 3, 22, 105, ...to32xConvertedByte(pid), 70, 68, 0, 0, 0, 1, 115, 0, 11, 99, 117, 114, 114, 101, 110, 116, 73, 116, 101, 109, 68, 0, 0, 0, 4, 115, 0, 4, 116, 121, 112, 101, 105, 0, 0, 0, 11, 115, 0, 9, 118, 97, 114, 105, 97, 110, 116, 73, 100, 105, 0, 0, 0, 0, 115, 0, 15, 117, 112, 100, 97, 116, 101, 73, 116, 101, 109, 83, 116, 97, 116, 101, 105, 0, 0, 0, 4, 115, 0, 8, 105, 116, 101, 109, 68, 97, 116, 97, 68, 0, 0, 0, 1, 115, 0, 8, 109, 97, 116, 101, 114, 105, 97, 108, 98, id, 254, 105, 0, 0, 0, 0
  626. ]).buffer });
  627. weapon = "cube_gun";
  628. },
  629. kick_all(pid = playerSid) {
  630. wsServer(new uint8array([243, 2, 25, 0, 2, 22, 105, ...to32xConvertedByte(pid), 70, 68, 0, 0, 0, 1, 115, 0, 4, 115, 105, 122, 101, 102, 63, 128, 0, 0]));
  631. },
  632. impulse_gun(pid = playerSid) {
  633. wsServer({ data: new uint8array([
  634. 243, 4, 29, 0, 3, 22, 105, ...to32xConvertedByte(pid), 70, 68, 0, 0, 0, 2, 115, 0, 11, 99, 117, 114, 114, 101, 110, 116, 73, 116, 101, 109, 68, 0, 0, 0, 3, 115, 0, 4, 116, 121, 112, 101, 105, 0, 0, 0, 2, 115, 0, 9, 118, 97, 114, 105, 97, 110, 116, 73, 100, 105, 0, 0, 0, 0, 115, 0, 15, 117, 112, 100, 97, 116, 101, 73, 116, 101, 109, 83, 116, 97, 116, 101, 105, 0, 0, 0, 4, 115, 0, 9, 97, 110, 105, 109, 97, 116, 105, 111, 110, 68, 0, 0, 0, 2, 115, 0, 5, 115, 116, 97, 116, 101, 115, 0, 4, 73, 100, 108, 101, 115, 0, 9, 116, 105, 109, 101, 83, 116, 97, 109, 112, 105, 70, 131, 252, 232, 254, 105, 0, 0, 0, 0
  635. ]).buffer });
  636. weapon = "impulse_gun";
  637. },
  638. bazooka(pid = playerSid) {
  639. wsServer({ data: new uint8array([
  640. 243, 4, 29, 0, 3, 22, 105, ...to32xConvertedByte(pid), 70, 68, 0, 0, 0, 1, 115, 0, 11, 99, 117, 114, 114, 101, 110, 116, 73, 116, 101, 109, 68, 0, 0, 0, 3, 115, 0, 4, 116, 121, 112, 101, 105, 0, 0, 0, 4, 115, 0, 9, 118, 97, 114, 105, 97, 110, 116, 73, 100, 105, 0, 0, 0, 0, 115, 0, 15, 117, 112, 100, 97, 116, 101, 73, 116, 101, 109, 83, 116, 97, 116, 101, 105, 0, 0, 0, 4, 254, 105, 0, 0, 0, 0
  641. ]).buffer });
  642. weapon = "bazooka";
  643. },
  644. heal_gun(pid = playerSid) {
  645. wsServer({ data: new uint8array([
  646. 243, 4, 29, 0, 3, 22, 105, ...to32xConvertedByte(pid), 70, 68, 0, 0, 0, 1, 115, 0, 11, 99, 117, 114, 114, 101, 110, 116, 73, 116, 101, 109, 68, 0, 0, 0, 3, 115, 0, 4, 116, 121, 112, 101, 105, 0, 0, 0, 70, 115, 0, 9, 118, 97, 114, 105, 97, 110, 116, 73, 100, 105, 0, 0, 0, 0, 115, 0, 15, 117, 112, 100, 97, 116, 101, 73, 116, 101, 109, 83, 116, 97, 116, 101, 105, 0, 0, 0, 4, 254, 105, 0, 0, 0, 0
  647. ]).buffer });
  648. weapon = "heal_gun";
  649. },
  650. pistols(pid = playerSid) {
  651. wsServer({ data: new uint8array([
  652. 243, 4, 29, 0, 3, 22, 105, ...to32xConvertedByte(pid), 70, 68, 0, 0, 0, 1, 115, 0, 11, 99, 117, 114, 114, 101, 110, 116, 73, 116, 101, 109, 68, 0, 0, 0, 3, 115, 0, 4, 116, 121, 112, 101, 105, 0, 0, 0, 13, 115, 0, 9, 118, 97, 114, 105, 97, 110, 116, 73, 100, 105, 0, 0, 0, 0, 115, 0, 15, 117, 112, 100, 97, 116, 101, 73, 116, 101, 109, 83, 116, 97, 116, 101, 105, 0, 0, 0, 4, 254, 105, 0, 0, 0, 0
  653. ]).buffer });
  654. weapon = "pistols";
  655. },
  656. central(pid = playerSid) {
  657. wsServer({ data: new uint8array([
  658. 243, 4, 29, 0, 3, 22, 105, ...to32xConvertedByte(pid), 70, 68, 0, 0, 0, 1, 115, 0, 11, 99, 117, 114, 114, 101, 110, 116, 73, 116, 101, 109, 68, 0, 0, 0, 3, 115, 0, 4, 116, 121, 112, 101, 105, 0, 0, 0, 1, 115, 0, 9, 118, 97, 114, 105, 97, 110, 116, 73, 100, 105, 0, 0, 0, 0, 115, 0, 15, 117, 112, 100, 97, 116, 101, 73, 116, 101, 109, 83, 116, 97, 116, 101, 105, 0, 0, 0, 4, 254, 105, 0, 0, 0, 0
  659. ]).buffer });
  660. },
  661. shotgun(pid = playerSid) {
  662. wsServer({ data: new uint8array([
  663. 243, 4, 29, 0, 3, 22, 105, ...to32xConvertedByte(pid), 70, 68, 0, 0, 0, 1, 115, 0, 11, 99, 117, 114, 114, 101, 110, 116, 73, 116, 101, 109, 68, 0, 0, 0, 3, 115, 0, 4, 116, 121, 112, 101, 105, 0, 0, 0, 9, 115, 0, 9, 118, 97, 114, 105, 97, 110, 116, 73, 100, 105, 0, 0, 0, 0, 115, 0, 15, 117, 112, 100, 97, 116, 101, 73, 116, 101, 109, 83, 116, 97, 116, 101, 105, 0, 0, 0, 4, 254, 105, 0, 0, 0, 0
  664. ]).buffer });
  665. weapon = "shotgun";
  666. },
  667. none(pid = playerSid) {
  668. if (pid == playerSid) return; // prevent crashes due to webgl signature dismatch
  669.  
  670. wsServer({ data: new uint8array([
  671. 243, 4, 29, 0, 3, 22, 105, ...to32xConvertedByte(pid), 70, 68, 0, 0, 0, 1, 115, 0, 11, 99, 117, 114, 114, 101, 110, 116, 73, 116, 101, 109, 68, 0, 0, 0, 3, 115, 0, 4, 116, 121, 112, 101, 105, 0, 0, 0, 255, 115, 0, 9, 118, 97, 114, 105, 97, 110, 116, 73, 100, 105, 0, 0, 0, 0, 115, 0, 15, 117, 112, 100, 97, 116, 101, 73, 116, 101, 109, 83, 116, 97, 116, 101, 105, 0, 0, 0, 4, 254, 105, 0, 0, 0, 0
  672. ]).buffer });
  673. weapon = "none";
  674. },
  675. flame(pid = playerSid) {
  676. wsServer({ data: new uint8array([
  677. 243, 4, 29, 0, 3, 22, 105, ...to32xConvertedByte(pid), 70, 68, 0, 0, 0, 1, 115, 0, 11, 99, 117, 114, 114, 101, 110, 116, 73, 116, 101, 109, 68, 0, 0, 0, 3, 115, 0, 4, 116, 121, 112, 101, 105, 0, 0, 0, 10, 115, 0, 9, 118, 97, 114, 105, 97, 110, 116, 73, 100, 105, 0, 0, 0, 0, 115, 0, 15, 117, 112, 100, 97, 116, 101, 73, 116, 101, 109, 83, 116, 97, 116, 101, 105, 0, 0, 0, 4, 254, 105, 0, 0, 0, 0
  678. ]).buffer });
  679. weapon = "flame";
  680. },
  681. shuriken(pid = playerSid) {
  682. wsServer({ data:new uint8array([
  683. 243, 4, 29, 0, 3, 22, 105, ...to32xConvertedByte(pid), 70, 68, 0, 0, 0, 1, 115, 0, 11, 99, 117, 114, 114, 101, 110, 116, 73, 116, 101, 109, 68, 0, 0, 0, 3, 115, 0, 4, 116, 121, 112, 101, 105, 0, 0, 0, 45, 115, 0, 9, 118, 97, 114, 105, 97, 110, 116, 73, 100, 105, 0, 0, 0, 0, 115, 0, 15, 117, 112, 100, 97, 116, 101, 73, 116, 101, 109, 83, 116, 97, 116, 101, 105, 0, 0, 0, 4, 254, 105, 0, 0, 0, 0
  684. ]).buffer});
  685. weapon = "shuriken";
  686. },
  687. maxHealth(health, pid = playerSid) {
  688. wsServer({ data: new uint8array([243, 4, 29, 0, 3, 22, 105, ...to32xConvertedByte(pid), 70, 68, 0, 0, 0, 1, 115, 0, 9, 109, 97, 120, 72, 101, 97, 108, 116, 104, 105, ...new uint8array(new Float32Array([health]).buffer).reverse(), 254, 105, 0, 0, 0, 0]).buffer });
  689. },
  690. setHealth(pid = playerSid, health = 100) {
  691. wsServer({ data: new uint8array([243, 4, 29, 0, 3, 22, 105, ...to32xConvertedByte(pid), 70, 68, 0, 0, 0, 1, 115, 0, 6, 104, 101, 97, 108, 116, 104, 102, ...new uint8array(new Float32Array([health]).buffer).reverse(), 254, 105, 0, 0, 0, 0]).buffer });
  692. },
  693. immortality(pid = playerSid) {
  694. //wsServer({ data: new uint8array([243, 4, 29, 0, 3, 22, 105, ...to32xConvertedByte(pid), 70, 68, 0, 0, 0, 1, 115, 0, 17, 115, 112, 97, 119, 110, 82, 111, 108, 101, 77, 111, 100, 101, 84, 121, 112, 101, 105, 0, 0, 0, 0, 254, 105, 0, 0, 0, 0]).buffer });
  695. top.regenerate = !top.regenerate;
  696.  
  697. },
  698. notificationOffset: 0,
  699. notification(text) {
  700. const notif = document.createElement("div");
  701. notif.innerHTML = text;
  702. notif.style = "width: 0px; text-align: center; height: 0px; z-index: 0; background: rgba(0, 0, 0, 0.5); color: white; font-size: 0px; border-bottom: 0px solid green; position: fixed; right: 0px";
  703. notif.style.top = (this.notificationOffset += 0) + "px";
  704. document.documentElement.appendChild(notif);
  705.  
  706. setTimeout(() => {
  707. this.notificationOffset -= 0;
  708. notif.remove();
  709. }, 0);
  710. },
  711. fallingTrp: 0,
  712. yPort() {
  713. if (this.motionY > 1) { // airstrafe
  714. this.fallingTrp -= 0.1 + Math.random() * 0.1;
  715. this.motionY = -0;
  716. this.jump();
  717. if (this.fallingTrp <= 0.9) { // up force < gravity
  718. this.notification("YPortStabilizer: Falling!");
  719. this.central();
  720. this.pistols();
  721. this.fire();
  722.  
  723. this.central();
  724. this.pistols();
  725. this.fire();
  726. this.fallingTrp += 0.11 + Math.random() * 0.3;
  727. }
  728. } else {
  729. this.notification("BHop: Adding Up Force");
  730. this.pistols();
  731. this.fire();
  732. this.jump();
  733. }
  734. },
  735. setScale(sid = playerSid) { },
  736. impulse_tool() {
  737. top.impulseTool = !top.impulseTool;
  738. },
  739. lookAt(x, y, z) {
  740. wsServer({ data: new uint8array([243, 4, 31, 0, 8, 22, 105,
  741. ...to32xConvertedByte(playerSid),
  742. 74, 102, ...to32xConvertedFloat(x),
  743. 75, 102, ...to32xConvertedFloat(y),
  744. 76, 102, ...to32xConvertedFloat(z),
  745. 77, 102, ...to32xConvertedFloat(x),
  746. 78, 102, ...to32xConvertedFloat(y),
  747. 79, 102, ...to32xConvertedFloat(x), 254, 105, 0, 0, 0, 0]) });
  748. },
  749. internalCubeSeparator: 0,
  750. permetuation(x, y, z) {
  751. wsServer({
  752. data: new uint8array([
  753. 243, 4, 10, 0, 3, 47, 105, ...to32xConvertedByte(playerSid), 49, 120, 0, 0, 0, (this.cubeID > -1 ? 9 : 7), (this.cubeID > -1 ? 2 : 0),
  754. ...to16xConvertedByte(x), ...to16xConvertedByte(y), ...to16xConvertedByte(z), ...(this.cubeID ? [7, this.cubeID] : []),
  755. 254, 105, 0, 0, 0, 0
  756. ])
  757. });
  758. },
  759. scaffold() {
  760. top.scaffold = !top.scaffold;
  761. },
  762. rotationData(pitch, yaw, pid = playerSid) {
  763. const pYAW = Math.random();
  764. const pPITCH = Math.random();
  765. wsServer({
  766. data: new Uint8Array([
  767. 243, 4, 29, 0, 3, 22, 105, ...to32xConvertedByte(playerSid), 70, 68, ...to32xConvertedFloat(pYAW), 115, 0, 15, 104, 101, 97, 100, 82, 111, 116, 97, 116, 105, 111, 110, 89, 97, 119, 102, 67, 178, 12, 110, 115, 0, 17, 104, 101, 97, 100, 82, 111, 116, 97, 116, 105, 111, 110, 80, 105, 116, 99, 104, 102, ...to32xConvertedFloat(pPITCH), 254, 105, ...to32xConvertedFloat(pPITCH)
  768. ])
  769. });
  770. },
  771. rotation() {
  772. top.antiAim = !top.antiAim;
  773. },
  774. jump() {
  775.  
  776. let wsServers = [];
  777. const push = Array.prototype.push;
  778. const foreach = Array.prototype.forEach;
  779. const uint8array = Uint8Array;
  780. const uint32array = Uint32Array;
  781. const uint16array = Uint16Array;
  782. const float32array = Float32Array;
  783. const error = Error;
  784. const fromCharCode = String.fromCharCode;
  785. const messageevent = MessageEvent;
  786. let playerSid = 0;
  787. const symbol = Symbol("onmessage");
  788. let autoheal = false;
  789. let players = "";
  790.  
  791. document.addEventListener("keyup", e => {
  792. switch (e.code) {
  793. case "KeyX":
  794. autoheal = !autoheal;
  795. packets.notification((autoheal ? "Enabling" : "Disabling") + " autoheal module");
  796. break;
  797. }
  798. });
  799.  
  800. function wsServer(eventData) {
  801. const event = new messageevent("message", eventData);
  802.  
  803. for (const listener of wsServers) {
  804. listener(event);
  805. };
  806. };
  807.  
  808. function to32xConvertedByte(n) {
  809. return new uint8array(new uint32array([n]).buffer).reverse();
  810. }
  811.  
  812. Object.defineProperty(WebSocket.prototype, "onmessage", {
  813. get() {
  814. return this[symbol];
  815. }, set(callback) {
  816. this[symbol] = callback;
  817. this.addEventListener("message", callback);
  818. packets.notification("Hooked peer connection at " + this.url);
  819. this.addEventListener("message", function(packet) {
  820. const packet_ = new uint8array(packet.data);
  821. const arr = new uint8array(event.data);
  822. const arr_ = [...arr];
  823. switch (packet_[2]) {
  824. case 61:
  825. players = fromCharCode.apply(null,
  826. packet_);
  827.  
  828. playerSid = parseInt(players.split(":")[1].replace(',"spawnRoleAvatarIds"', ""));
  829. packets.notification("Player sid: " + playerSid);
  830. break;
  831. }
  832. return false;
  833.  
  834. });
  835.  
  836. wsServers.push(callback.bind(this));
  837. }
  838. });
  839.  
  840. const packets = {
  841. notificationOffset: 0,
  842. setPlayerHealth(pid = playerSid, health = 100) {
  843. wsServer({ data: new uint8array([243, 4, 29, 0, 3, 22, 105, ...to32xConvertedByte(pid), 70, 68, 0, 0, 0, 1, 115, 0, 6, 104, 101, 97, 108, 116, 104, 102, ...new uint8array(new Float32Array([health]).buffer).reverse(), 254, 105, 0, 0, 0, 0]).buffer });
  844. },
  845. notification(text) {
  846. const notif = document.createElement("div");
  847. notif.innerHTML = text;
  848. notif.style = "width: 300px; text-align: center; height: 50px; z-index: 9999; background: rgba(0, 0, 0, 0.5); color: white; font-size: 20px; border-bottom: 2px solid green; position: fixed; right: 0px";
  849. notif.style.top = (this.notificationOffset += 70) + "px";
  850. document.documentElement.appendChild(notif);
  851.  
  852. setTimeout(() => {
  853. this.notificationOffset -= 70;
  854. notif.remove();
  855. }, 2000);
  856. },
  857. };
  858.  
  859. setInterval(() => {
  860. if (!autoheal) return;
  861.  
  862. packets.setPlayerHealth();
  863. }, 300);
  864.  
  865.  
  866. }
  867. };
  868.  
  869. let lastRegen = Date.now();
  870.  
  871. setInterval(() => {
  872. if (top.regenerate && Date.now() - lastRegen > 300) {
  873. packets.setHealth();
  874. lastRegen = Date.now();
  875. }
  876. if (top.antiAim) packets.rotationData();
  877.  
  878. if (!top.impulseTool ||
  879. !holdingPrimary || !weapon) return;
  880.  
  881. packets[weapon]();
  882. packets.fire();
  883. }, 50);
  884.  
  885. Object.defineProperty(top, "packets", {
  886. get() {
  887. const { stack } = new error();
  888. if (stack.includes("app")) return undefined;
  889.  
  890. return packets;
  891.  
  892. }
  893. });
  894. let autoheal = false;
  895. let players = "";
  896. document.addEventListener("keyup", e => {
  897. switch (e.code) {
  898. case "KeyX":
  899. autoheal = !autoheal;
  900. packets.notification((autoheal ? "Enabling" : "Disabling") + " autoheal module");
  901. break;
  902.  
  903. }
  904. });
  905.  

QingJ © 2025

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