Document
Document
Document
// @namespace SkidLamer
// @version 1.1.7
// @author SkidLamer
// @match *://krunker.io/*
// @grant none
// @run-at document-start
// ==/UserScript==
const cStruct = (...keys) => ((...v) => keys.reduce((o, k, i) => {o[k] = v[i];return o}, {}))
class Utilities {
constructor() {
this.inputs;
this.exports;
this.control;
this.functions;
this.wpnClasses;
this.self;
this.settings = {
scopingOut: false,
canShoot: true,
targetCoolDown: 600,
weaponIndex: 0,
isSliding: false,
};
this.spinTimer = 1800;
this.features = [];
this.onLoad();
onLoad() {
clearInterval(interval);
this.createInfoBox();
}, 100);
}
onTick() {
switch (feature.name) {
case 'AutoAim':
if (feature.value) this.AutoAim(feature.value);
break;
case 'AutoReload':
if (feature.value) this.wpnReload();
break;
case 'NoRecoil':
break;
case 'AimDelta':
break;
case 'SuperGun':
if (feature.value) {
this.settings.weaponIndex += this.control.mouseDownL == 1;
this.self.weapon = this.world.weapons[this.settings.weaponIndex];
}
break;
case 'BurstShot':
break;
case 'AutoBhop':
if (feature.value) this.AutoBhop(feature.value);
break;
case 'NoDeathDelay':
this.server.deathDelay = 0;
this.world.players.forcePos();
//this.world.players.resetAim();
//this.world.updateUI();
break;
onUpdated(feature) {
if (feature.container.length) {
feature.value += 1;
feature.value = 0;
feature.valueStr = feature.container[feature.value];
else
feature.value ^= 1;
switch (feature.name) {
case 'ForceScope':
break;
window.saveVal(`utilities_${feature.name}`, feature.value);
this.updateInfoBox();
getStatic(s, d) {
if(typeof s == 'undefined') {
return d;
}
return s;
getFeature(name) {
return feature;
createInfoBox() {
if (leaderDisplay) {
leaderDisplay.parentNode.insertBefore(infoBox.firstChild, leaderDisplay.nextSibling);
this.updateInfoBox();
upperCase(str) {
return str.toUpperCase();
toProperCase(str) {
return str;
updateInfoBox() {
if (infoBox) {
});
}
}
onKeyDown(event) {
switch (key) {
case 'M': {
break;
case 'DELETE':
this.resetSettings();
break;
default:
this.onUpdated(feature);
break;
getDistance(player1, player2) {
getAngleDist(start, end) {
camLookAt(X, Y, Z) {
var xdir = this.getXDir(this.control.object.position.x, this.control.object.position.y,
this.control.object.position.z, X, Y, Z),
camChaseDst = this.server.camChaseDst;
this.control.target = {
xD: xdir,
yD: ydir,
y: Y - this.server.camChaseDst * Math.sin(xdir),
AutoAim(value) {
if (this.self.didShoot) {
setTimeout(() => {
this.self.aimVal = 1;
this.world.players.resetAim();
this.settings.canShoot = true;
}, this.self.weapon.rate );
if (target) {
switch (value) {
case 1:
/*Aim Assist*/
if (this.control.mouseDownR === 1) {
this.lookAtHead(target);
break;
case 2:
/*Aim Bot*/
this.lookAtHead(target);
if (this.control.mouseDownR === 0) {
this.control.mouseDownR = 1;
break;
case 3:
/*Trigger Bot*/
if (this.control.mouseDownL === 1) {
this.control.mouseDownL = 0;
this.control.mouseDownR = 0;
this.settings.scopingOut = true;
if (this.control.mouseDownL === 1) {
this.control.mouseDownL =
this.control.mouseDownR = 0;
}
this.control.target = null;
this.lookAtHead(target);
if (this.control.mouseDownR === 0) {
this.control.mouseDownR = 2;
this.control.mouseDownL ^= 1;
break;
else {
this.wpnReload(this.getFeature('AutoReload').value &&
this.self.ammos[this.self.weaponIndex] < ((this.self.weapon.ammo / 2) + 1));
this.control.target = null;
if (this.control.mouseDownR === 2) {
setTimeout(() => {
this.control.mouseDownR = 0;
this.settings.canShoot = true;
this.self.aimVal = 1;
}, this.settings.targetCoolDown);
AutoBhop(value) {
if (value) {
this.control.keys[this.control.jumpKey] = this.self.onGround;
if (value === 2) {
if (this.settings.isSliding) {
this.inputs[8] = 1;
return;
this.settings.isSliding = true;
setTimeout(() => {
this.settings.isSliding = false;
}, this.self.slideTimer);
this.inputs[8] = 1;
wpnReload(force = false) {
resetSettings() {
if (confirm("Are you sure you want to reset all your hero settings? This will also refresh the
page")) {
Object.keys(window.localStorage).filter(x=>x.includes("utilities_")).forEach(x =>
window.localStorage.removeItem(x));
location.reload();
getTarget() {
lookAtHead(target) {
if (this.getFeature("SpinBot").value) this.spinTick();
spinTick() {
//this.world.players.getSpin(this.self);
//this.world.players.saveSpin(this.self, angle);
//Hooked
this.inputs = inputs;
this.world = world;
this.self = self;
this.server = this.exports.c[7].exports;
this.functions = this.exports.c[8].exports;
this.wpnClasses = this.exports.c[69].exports;
this.onTick();
controlTick(control) {
//Hooked
if (control) {
this.control = control;
const half = Math.PI / 2;
if (control.target) {
control.object.rotation.y = control.target.yD;
control.pitchObject.rotation.x = control.target.xD;
function read(url) {
return resolve(res);
});
});
function patchedIndex(html) {
return html;
function patchedScript(script) {
return script;
}
(async function () {
window.stop();
document.open();
document.write(patchedIndex(index));
document.close();
try {
eval(patchedScript(script));
} catch (err) {
location.reload();
})();