Void Console

Press insert to close/open the menu.

当前为 2024-06-24 提交的版本,查看 最新版本

此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.cn-greasyfork.org/scripts/498780/1399973/Void%20Console.js

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