// ==UserScript== // @name KRUNKVILLAIN - Krunker.io HACK AIMBOT ESP BHOP // @namespace Roogybot // @version 1.0.1 // @description Aimbot, Auto Reload, Auto BHop and Wall Hack for Krunker.io // @author Roogybot // @include https://krunker.io/ // @include https://krunker.io/?game=* // @grant GM_xmlhttpRequest // @run-at document-start // ==/UserScript== var OnOffMode; (function (OnOffMode) { OnOffMode["On"] = "On"; OnOffMode["Off"] = "Off"; })(OnOffMode || (OnOffMode = {})); class Module { constructor() { this.allStates = this.getAllModes(); this.currentModeIndex = this.allStates.indexOf(this.getInitialMode()); } onModeChanged() { // Let implementations override this if needed } onTick() { // Let implementations override this if needed } getInitialMode() { return this.allStates[0]; } onKeyPressed() { this.currentModeIndex++; if (this.currentModeIndex >= this.allStates.length) { this.currentModeIndex = 0; } this.onModeChanged(); } isEnabled() { return this.currentModeIndex !== 0; } getStatus() { return this.allStates[this.currentModeIndex].toString(); } getCurrentMode() { return this.allStates[this.currentModeIndex]; } } var AimbotMode; (function (AimbotMode) { AimbotMode["Off"] = "Off"; AimbotMode["Quickscoper"] = "Quickscoper"; AimbotMode["OnRMB"] = "On RMB"; })(AimbotMode || (AimbotMode = {})); class Aimbot extends Module { constructor() { super(...arguments); this.scopingOut = false; this.canShoot = true; } getName() { return 'Aimbot'; } getKey() { return 'I'; } getAllModes() { return [AimbotMode.Off, AimbotMode.Quickscoper, AimbotMode.OnRMB]; } onTick() { if (!this.players) { return; } const possibleTargets = this.players .filter(player => { return player.active && player.inView && !player.isYou && (!player.team || player.team !== this.me.team); }) .sort((p1, p2) => this.distance(this.me, p1) - this.distance(this.me, p2)); let isLockedOn = false; if (possibleTargets.length > 0) { const target = possibleTargets[0]; switch (this.getCurrentMode()) { case AimbotMode.Quickscoper: isLockedOn = this.runQuickscoper(target); break; case AimbotMode.OnRMB: isLockedOn = this.runOnRMB(target); break; } } if (!isLockedOn) { this.control.camLookAt(null); this.control.target = null; if (this.getCurrentMode() === AimbotMode.Quickscoper) { this.control.mouseDownL = 0; this.control.mouseDownR = 0; } } } runQuickscoper(target) { if (this.me.didShoot) { this.canShoot = false; setTimeout(() => { this.canShoot = true; }, this.me.weapon.rate); } if (this.control.mouseDownL === 1) { this.control.mouseDownL = 0; this.control.mouseDownR = 0; this.scopingOut = true; } if (this.me.aimVal === 1) { this.scopingOut = false; } if (this.scopingOut || !this.canShoot || this.me.recoilForce > 0.01) { return false; } this.lookAt(target); if (this.control.mouseDownR === 0) { this.control.mouseDownR = 1; } else if (this.me.aimVal < 0.2) { this.control.mouseDownL = 1 - this.control.mouseDownL; } return true; } runOnRMB(target) { if (this.control.mouseDownR === 0) { return false; } this.lookAt(target); return true; } lookAt(target) { this.control.camLookAt(target.x2, target.y2 + target.height - 1.5 - 2.5 * target.crouchVal - this.me.recoilAnimY * 0.3 * 25, target.z2); } distance(player1, player2) { const dx = player1.x - player2.x; const dy = player1.y - player2.y; const dz = player1.z - player2.z; return Math.sqrt(dx * dx + dy * dy + dz * dz); } } var BHopMode; (function (BHopMode) { BHopMode["Off"] = "Off"; BHopMode["Jump"] = "Jump"; BHopMode["SlideJump"] = "Slide Jump"; })(BHopMode || (BHopMode = {})); class AutoBHop extends Module { constructor() { super(...arguments); this.isSliding = false; } getName() { return 'Auto BHop'; } getKey() { return 'B'; } getAllModes() { return [BHopMode.Off, BHopMode.Jump, BHopMode.SlideJump]; } onTick() { this.control.keys[32] = !this.control.keys[32]; if (this.getCurrentMode() === BHopMode.SlideJump) { if (this.isSliding) { this.inputs[8] = 1; return; } if (this.me.yVel < -0.04 && this.me.canSlide) { this.isSliding = true; setTimeout(() => { this.isSliding = false; }, 350); this.inputs[8] = 1; } } } } class AutoReload extends Module { getName() { return 'Auto Reload'; } getKey() { return 'J'; } getAllModes() { return [OnOffMode.Off, OnOffMode.On]; } getInitialMode() { return OnOffMode.On; } onTick() { if (this.me.ammos[this.me.weaponIndex] === 0) { this.inputs[9] = 1; } } } class WallHack extends Module { getName() { return 'Wall Hack'; } getKey() { return 'O'; } getAllModes() { return [OnOffMode.Off, OnOffMode.On]; } getInitialMode() { unsafeWindow.wallHackEnabled = true; return OnOffMode.On; } onModeChanged() { unsafeWindow.wallHackEnabled = this.getCurrentMode() === OnOffMode.On; } } class Krunkbot { constructor() { this.modules = []; } init() { this.modules.push(new Aimbot()); this.modules.push(new AutoReload()); this.modules.push(new WallHack()); this.modules.push(new AutoBHop()); const initInfoBoxInterval = setInterval(() => { if (this.canInjectInfoBox()) { clearInterval(initInfoBoxInterval); this.injectInfoBox(); this.updateInfoBox(); } }, 100); } onTick(me, inputs) { this.modules.forEach(module => { if (module.isEnabled()) { module.me = me; module.inputs = inputs; module.control = unsafeWindow.control; module.players = unsafeWindow.players; module.onTick(); } }); } onKeyPressed(e) { let shouldUpdateInfoBox = false; this.modules.forEach(module => { if (module.getKey().toUpperCase() === e.key.toUpperCase()) { module.onKeyPressed(); shouldUpdateInfoBox = true; } }); if (shouldUpdateInfoBox) { this.updateInfoBox(); } } updateInfoBox() { const infoBox = unsafeWindow.document.querySelector('#krunkbotInfoBox'); if (infoBox === null) { return; } const moduleLines = this.modules.map(module => { return `