Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Krunker.io Speed Hackzzz
- // @namespace http://tampermonkey.net/
- // @version 2.5.4
- // @description Hack PLAYER AND GUN SPEED!!!! with esp nametag tracking, CAN NOT BE PATCHED!!!
- // @author ZEUS
- // @match https://krunker.io/*
- // @run-at document-start
- // @grant none
- // @require https://code.jquery.com/jquery-3.0.0-alpha1.min.js
- // @icon https://image.flaticon.com/icons/png/512/2797/2797974.png
- // @require http://code.jquery.com/jquery-3.2.1.slim.min.js
- // @require http://code.jquery.com/jquery-latest.js
- // @require https://greasyfork.org/scripts/372672-everything-hook/code/Everything-Hook.js?version=784972
- // ==/UserScript==
- (function() {
- let initialize = function(data) {
- let regex = /if\(!\w+\['(\w+)']\)continue/;
- let result = regex.exec(data);
- if (result) {
- const inView = result[1];
- const push = Array.prototype.push;
- Array.prototype.push = function(...args) {
- push.apply(this, args);
- if (args[0] instanceof Object && args[0].isPlayer) {
- Object.defineProperty(args[0], inView, {value: true, configurable: false});
- }
- }
- }
- }
- const decode = window.TextDecoder.prototype.decode;
- window.TextDecoder.prototype.decode = function(...args) {
- let data = decode.apply(this, args);
- if (data.length > 1050000) { //1050000 ideal val
- console.log(data);
- initialize(data);
- }
- return data;
- }
- })();
- var keyboardEvent = document.createEvent("KeyboardEvent");
- var initMethod = typeof keyboardEvent.initKeyboardEvent !== 'undefined' ? "initKeyboardEvent" : "initKeyEvent";
- document.addEventListener('readystatechange', function () {
- if (document.readyState === "interactive" || document.readyState === "complete") {
- window.isDOMLoaded = true;
- }
- });
- ~function (global) {
- var workerURLs = [];
- var extraElements = [];
- var helper = function (eHookContext, timerContext, util) {
- return {
- applyUI: function () {
- var style = '._th-container ._th-item{margin-bottom:3px;position:relative;width:30px;height:30px;cursor:pointer;opacity:.3;background-color:coral;border-radius:100%;text-align:center;line-height:30px;-webkit-transition:all .35s;-o-transition:all .35s;transition:all .35s;right:30px}._th-container ._th-item._item-x2{margin-left:18px;width:40px;height:40px;line-height:40px}._th-container ._th-item._item-x-2{margin-left:17px;width:38px;height:38px;line-height:38px}._th-container ._th-item._item-x4{width:36px;height:36px;margin-left:16px;line-height:36px}._th-container ._th-item._item-x-4{width:32px;height:32px;line-height:32px;margin-left:14px}._th-container ._th-item._item-reset{width:30px;line-height:30px;height:30px;margin-left:10px}._th-click-hover{position:relative;-webkit-transition:all .5s;-o-transition:all .5s;transition:all .5s;height:50px;width:50px;cursor:pointer;opacity:.3;border-radius:100%;background-color:coral;text-align:center;line-height:50px;right:0}._th-container:hover{left:-10px}._th-container{font-size:12px;-webkit-transition:all .5s;-o-transition:all .5s;transition:all .5s;left:-40px;top:20%;position:fixed;-webkit-box-sizing:border-box;box-sizing:border-box;z-index:100000;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}._th-container ._th-item:hover{opacity:.8;background-color:#5fb492;color:aliceblue}._th-container ._th-item:active{opacity:.9;background-color:#316347;color:aliceblue}._th-container:hover ._th-click-hover{opacity:.8}._th-container:hover ._th-item{opacity:.6;right:0}._th-container ._th-click-hover:hover{opacity:.8;background-color:#5fb492;color:aliceblue}._th_cover-all-show-times{position:fixed;top:0;right:0;width:100%;height:100%;z-index:99999;opacity:1;font-weight:900;font-size:30px;color:#4f4f4f;background-color:rgba(0,0,0,0.1)}._th_cover-all-show-times._th_hidden{z-index:-99999;opacity:0;-webkit-transition:1s all;-o-transition:1s all;transition:1s all}._th_cover-all-show-times ._th_times{width:300px;height:300px;border-radius:50%;background-color:rgba(127,255,212,0.51);text-align:center;line-height:300px;position:absolute;top:50%;right:50%;margin-top:-150px;margin-right:-150px;}';
- var html = '<div class="_th-container">\n' +
- ' <div class="_th-click-hover" onclick="changeTime()">\n' +
- ' x' + 1 / timerContext._percentage + '\n' +
- ' </div>\n' +
- ' <div class="_th-item _item-x2" onclick="changeTime(2,0,true)">></div>\n' +
- ' <div class="_th-item _item-x-2" onclick="changeTime(-2,0,true)"><</div>\n' +
- ' <div class="_th-item _item-x4" onclick="changeTime(0,4)">>></div>\n' +
- ' <div class="_th-item _item-x-4" onclick="changeTime(0,-4)"><<</div>\n' +
- ' <div class="_th-item _item-reset" onclick="changeTime(0,0,false,true)">O</div>\n' +
- '</div>\n' +
- '<div class="_th_cover-all-show-times _th_hidden">\n' +
- ' <div class="_th_times">x' + 1 / timerContext._percentage + '</div>\n' +
- '</div>' +
- '';
- var stylenode = document.createElement('style');
- stylenode.setAttribute("type", "text/css");
- if (stylenode.styleSheet) {// IE
- stylenode.styleSheet.cssText = style;
- } else {// w3c
- var cssText = document.createTextNode(style);
- stylenode.appendChild(cssText);
- }
- var node = document.createElement('div');
- node.innerHTML = html;
- if (!global.isDOMLoaded) {
- document.addEventListener('readystatechange', function () {
- if ((document.readyState === "interactive" || document.readyState === "complete") && !global.isDOMRendered) {
- document.head.appendChild(stylenode);
- document.body.appendChild(node);
- global.isDOMRendered = true;
- console.log('Time Hooker Works!');
- }
- });
- } else {
- document.head.appendChild(stylenode);
- document.body.appendChild(node);
- global.isDOMRendered = true;
- console.log('Time Hooker Works!');
- }
- },
- applyGlobalAction: function (timer) {
- timer.changeTime = function (anum, cnum, isa, isr) {
- if (isr) {
- global.timer.change(1);
- return;
- }
- if (!global.timer) {
- return;
- }
- var result;
- if (!anum && !cnum) {
- var t = prompt("Enter the desired speed change rate:" + 1 / timerContext._percentage + ")");
- if (t == null) {
- return;
- }
- if (isNaN(parseFloat(t))) {
- alert("Please enter a number!!");
- timer.changeTime();
- return;
- }
- if (parseFloat(t) <= 0) {
- alert("Change cannot be less than or more than 0!!");
- timer.changeTime();
- return;
- }
- result = 1 / parseFloat(t);
- } else {
- if (isa && anum) {
- if (1 / timerContext._percentage <= 1 && anum < 0) {
- return;
- }
- result = 1 / (1 / timerContext._percentage + anum);
- } else {
- if (cnum < 0) {
- cnum = 1 / -cnum
- }
- result = 1 / ((1 / timerContext._percentage) * cnum);
- }
- }
- timer.change(result);
- };
- global.changeTime = timer.changeTime;
- },
- applyHooking: function () {
- eHookContext.hookReplace(window, 'setInterval', function (setInterval) {
- return function () {
- arguments[2] = arguments[1];
- arguments[1] *= timerContext._percentage;
- var resultId = setInterval.apply(window, arguments);
- timerContext._intervalIds[r] = {
- args: arguments,
- nowId: resultId
- };
- return resultId;
- };
- });
- eHookContext.hookBefore(window, 'clearInterval', function (method, args) {
- var id = args[0];
- if (timerContext._intervalIds[i]) {
- args[0] = timerContext._intervalIds[i].nowId;
- }
- delete timerContext._intervalIds[i];
- });
- eHookContext.hookBefore(window, 'clearTimeout', function (method, args) {
- var id = args[0];
- if (timerContext._intervalIds[i]) {
- args[0] = timerContext._intervalIds[i].nowId;
- }
- delete timerContext._intervalIds[i];
- });
- eHookContext.hookBefore(window, 'setTimeout', function (method, args) {
- args[1] *= timerContext._percentage;
- });
- var newFunc = this.getHookedDateConstructor();
- eHookContext.hookClass(window, 'Date', newFunc, '_innerDate', ['now']);
- Date.now = function () {
- return new Date().getTime();
- };
- eHookContext.hookedToString(timerContext._Date.now, Date.now);
- var objToString = Object.prototype.toString;
- eHookContext.hookAfter(Object.prototype, 'toString', function (m, args, result) {
- if (this instanceof timerContext._mDate) {
- return '[object Date]';
- } else {
- return result;
- }
- }, false);
- eHookContext.hookedToString(objToString, Object.prototype.toString);
- eHookContext.hookedToString(timerContext._setInterval, setInterval);
- eHookContext.hookedToString(timerContext._setTimeout, setTimeout);
- eHookContext.hookedToString(timerContext._clearInterval, clearInterval);
- timerContext._mDate = window.Date;
- this.hookShadowRoot();
- },
- getHookedDateConstructor: function () {
- return function () {
- if (arguments.length === 1) {
- Object.defineProperty(this, '_innerDate', {
- configurable: false,
- enumerable: false,
- value: new timerContext._Date(arguments[0]),
- writable: false
- });
- return;
- } else if (arguments.length > 1) {
- var definedValue;
- switch (arguments.length) {
- case 2:
- definedValue = new timerContext._Date(
- arguments[0],
- arguments[1]
- );
- break;
- case 3:
- definedValue = new timerContext._Date(
- arguments[0],
- arguments[1],
- arguments[2],
- );
- break;
- case 4:
- definedValue = new timerContext._Date(
- arguments[0],
- arguments[1],
- arguments[2],
- arguments[3],
- );
- break;
- case 5:
- definedValue = new timerContext._Date(
- arguments[0],
- arguments[1],
- arguments[2],
- arguments[3],
- arguments[4]
- );
- break;
- case 6:
- definedValue = new timerContext._Date(
- arguments[0],
- arguments[1],
- arguments[2],
- arguments[3],
- arguments[4],
- arguments[5]
- );
- break;
- default:
- case 7:
- definedValue = new timerContext._Date(
- arguments[0],
- arguments[1],
- arguments[2],
- arguments[3],
- arguments[4],
- arguments[5],
- arguments[6]
- );
- break;
- }
- Object.defineProperty(this, '_innerDate', {
- configurable: false,
- enumerable: false,
- value: definedValue,
- writable: false
- });
- return;
- }
- var now = timerContext._Date.now();
- var passTime = now - timerContext.__lastDatetime;
- var hookPassTime = passTime * (1 / timerContext._percentage);
- // console.log(__this.__lastDatetime + hookPassTime, now,__this.__lastDatetime + hookPassTime - now);
- Object.defineProperty(this, '_innerDate', {
- configurable: false,
- enumerable: false,
- value: new timerContext._Date(timerContext.__lastMDatetime + hookPassTime),
- writable: false
- });
- };
- },
- registerShortcutKeys: function (timer) {
- addEventListener('keydown', function (e) {
- switch (e.keyCode) {
- // [=]
- case 190:
- case 187: {
- if (e.ctrlKey) {
- // console.log('+2');
- timer.changeTime(2, 0, true);
- } else if (e.altKey) {
- // console.log('x4');
- timer.changeTime(0, 4);
- }
- break;
- }
- // [-]
- case 188:
- case 189: {
- if (e.ctrlKey) {
- // console.log('-2');
- timer.changeTime(-2, 0, true);
- } else if (e.altKey) {
- // console.log('x-4');
- timer.changeTime(0, -4);
- }
- break;
- }
- // [0]
- case 48: {
- if (e.ctrlKey || e.altKey) {
- // console.log('reset');
- timer.changeTime(0, 0, false, true);
- }
- break;
- }
- default:
- // console.log(e);
- }
- });
- },
- percentageChangeHandler: function (percentage) {
- util.ergodicObject(timerContext, timerContext._intervalIds, function (idObj, id) {
- idObj.args[1] = Math.floor(idObj.args[2] * percentage);
- this._clearInterval.call(window, idObj.nowId);
- idObj.nowId = this._setInterval.apply(window, idObj.args);
- });
- },
- hookShadowRoot: function () {
- var origin = Element.prototype.attachShadow;
- eHookContext.hookAfter(Element.prototype, 'attachShadow',
- function (m, args, result) {
- extraElements.push(result);
- return result;
- }, false);
- eHookContext.hookedToString(origin, Element.prototype.attachShadow);
- }
- }
- };
- var normalUtil = {
- isInIframe: function () {
- let is = global.parent !== global;
- try {
- is = is && global.parent.document.body.tagName !== 'FRAMESET'
- } catch (e) {
- }
- return is;
- },
- listenParentEvent: function (handler) {
- global.addEventListener('message', function (e) {
- var data = e.data;
- var type = data.type || '';
- if (type === 'changePercentage') {
- handler(data.percentage || 0);
- }
- })
- },
- sentChangesToIframe: function (percentage) {
- var iframes = document.querySelectorAll('iframe') || [];
- var frames = document.querySelectorAll('frame');
- if (iframes.length) {
- for (var i = 0; i < iframes.length; i++) {
- iframes[i].contentWindow.postMessage(
- {type: 'changePercentage', percentage: percentage}, '*');
- }
- }
- if (frames.length) {
- for (var j = 0; j < frames.length; j++) {
- frames[j].contentWindow.postMessage(
- {type: 'changePercentage', percentage: percentage}, '*');
- }
- }
- }
- };
- var querySelectorAll = function (ele, selector, includeExtra) {
- var elements = ele.querySelectorAll(selector);
- elements = Array.prototype.slice.call(elements || []);
- if (includeExtra) {
- extraElements.forEach(function (element) {
- elements = elements.concat(querySelectorAll(element, selector, false));
- })
- }
- return elements;
- };
- var generate = function () {
- return function (util) {
- workerURLs.forEach(function (url) {
- if (util.urlMatching(location.href, 'http.*://.*' + url + '.*')) {
- window['Worker'] = undefined;
- console.log('Worker disabled');
- }
- });
- var eHookContext = this;
- var timerHooker = {
- _intervalIds: {},
- __percentage: 1.0,
- _setInterval: window['setInterval'],
- _clearInterval: window['clearInterval'],
- _clearTimeout: window['clearTimeout'],
- _setTimeout: window['setTimeout'],
- _Date: window['Date'],
- __lastDatetime: new Date().getTime(),
- __lastMDatetime: new Date().getTime(),
- videoSpeedInterval: 1000,
- init: function () {
- var timerContext = this;
- var h = helper(eHookContext, timerContext, util);
- h.applyHooking();
- Object.defineProperty(timerContext, '_percentage', {
- get: function () {
- return timerContext.__percentage;
- },
- set: function (percentage) {
- if (percentage === timerContext.__percentage) {
- return percentage;
- }
- h.percentageChangeHandler(percentage);
- timerContext.__percentage = percentage;
- return percentage;
- }
- });
- if (!normalUtil.isInIframe()) {
- console.log('[TimeHooker]', 'loading outer window...');
- h.applyUI();
- h.applyGlobalAction(timerContext);
- h.registerShortcutKeys(timerContext);
- } else {
- console.log('[TimeHooker]', 'loading inner window...');
- normalUtil.listenParentEvent((function (percentage) {
- console.log('[TimeHooker]', 'Inner Changed', percentage)
- this.change(percentage);
- }).bind(this))
- }
- },
- change: function (percentage) {
- var _this = this;
- this.__lastMDatetime = this._mDate.now();
- this.__lastDatetime = this._Date.now();
- this._percentage = percentage;
- var oldNode = document.getElementsByClassName('_th-click-hover');
- var oldNode1 = document.getElementsByClassName('_th_times');
- (oldNode[0] || {}).innerHTML = 'x' + 1 / this._percentage;
- (oldNode1[0] || {}).innerHTML = 'x' + 1 / this._percentage;
- var a = document.getElementsByClassName('_th_cover-all-show-times')[0] || {};
- a.className = '_th_cover-all-show-times';
- this._setTimeout.bind(window)(function () {
- a.className = '_th_cover-all-show-times _th_hidden';
- }, 100);
- this.changeVideoSpeed();
- this._clearInterval.bind(window)(this.videoSpeedIntervalId);
- this.videoSpeedIntervalId = this._setInterval.bind(window)(function () {
- _this.changeVideoSpeed();
- var rate = 1 / _this._percentage;
- if (rate === 1) {
- _this._clearInterval.bind(window)(_this.videoSpeedIntervalId);
- }
- }, this.videoSpeedInterval);
- normalUtil.sentChangesToIframe(percentage);
- },
- changeVideoSpeed: function () {
- var rate = 1 / this._percentage;
- rate > 16 && (rate = 16);
- rate < 0.065 && (rate = 0.065);
- var videos = querySelectorAll(document, 'video', true) || [];
- if (videos.length) {
- for (var i = 0; i < videos.length; i++) {
- videos[i].playbackRate = rate;
- }
- }
- }
- };
- timerHooker.init();
- return timerHooker;
- }
- };
- if (global.eHook) {
- global.eHook.plugins({
- name: 'timer',
- mount: generate()
- });
- }
- }(window);
- var body=document.getElementsByTagName("body")[0]
- var count=0
- var gun=0
- var bhop=0
- var run=0
- var custt=0
- var re=0
- var lag=0
- alert("Game Has been Hacked By GSRHackZ,....Click K on your keyboard 3x to view controls!! P.S: please wait 2-3 seconds after dying before clicking 'Click To Play'")
- body.addEventListener("keyup", function(event) {
- if (event.keyCode === 107||event.keyCode==51) {
- event.preventDefault();
- document.getElementsByClassName("_th-item _item-x2")[0].click();
- }
- else if(event.keyCode===109||event.keyCode==50){
- event.preventDefault();
- document.getElementsByClassName("_th-item _item-x-2")[0].click()
- }
- else if(event.keyCode==9||event.keyCode==20){
- count++;
- event.preventDefault();
- if (count==1){
- if(localStorage.getItem("lag")==null){
- document.getElementsByClassName("_th-item _item-x4")[0].click();
- document.getElementsByClassName("_th-item _item-x4")[0].click();
- document.getElementsByClassName("_th-item _item-x4")[0].click();
- setTimeout(function(){ document.getElementsByClassName("_th-item _item-reset")[0].click();count=0},100000);}
- else if(localStorage.getItem("lag")!==null){
- document.getElementsByClassName("_th-item _item-reset")[0].click();
- document.getElementsByClassName("_th-item _item-x2")[0].click();
- document.getElementsByClassName("_th-item _item-x2")[0].click();
- setTimeout(function(){ document.getElementsByClassName("_th-item _item-reset")[0].click();count=0},7000);
- }
- }
- else if(count==2){
- document.getElementsByClassName("_th-item _item-reset")[0].click();
- count=0;
- }
- }
- else if (event.keyCode==17){
- gun++
- if (gun==1){
- setTimeout(function(){document.getElementById("customizeButton").click()},100)
- setTimeout(function(){document.getElementsByClassName("settText floatR")[0].click()},200)
- setTimeout(function(){document.getElementsByClassName("classCard")[0].click()},300)}
- else if (gun==2){
- setTimeout(function(){document.getElementById("customizeButton").click()},100)
- setTimeout(function(){document.getElementsByClassName("settText floatR")[0].click()},200)
- setTimeout(function(){document.getElementsByClassName("classCard")[2].click()},300);
- }
- else if (gun==3){
- setTimeout(function(){document.getElementById("customizeButton").click()},100)
- setTimeout(function(){document.getElementsByClassName("settText floatR")[0].click()},200)
- setTimeout(function(){document.getElementsByClassName("classCard")[3].click()},300);
- }
- else if (gun==4){
- setTimeout(function(){document.getElementById("customizeButton").click()},100)
- setTimeout(function(){document.getElementsByClassName("settText floatR")[0].click()},200)
- setTimeout(function(){document.getElementsByClassName("classCard")[4].click()},300);
- }
- else if (gun==5){
- setTimeout(function(){document.getElementById("customizeButton").click()},100)
- setTimeout(function(){document.getElementsByClassName("settText floatR")[0].click()},200)
- setTimeout(function(){document.getElementsByClassName("classCard")[5].click()},300);
- gun=0;
- }
- }
- else if (event.keyCode==192){
- bhop++
- if(bhop==1){
- setTimeout(function(){alert("Auto BHOP is now Turned on!!")},500)
- setTimeout(function(){alert("AUTO BHOP is still being developed, click ~ again to turn it off")
- },600);
- }
- else if(bhop==2){
- setTimeout(function(){alert("Auto BHOP is now Turned off!!")},500)
- bhop=0;
- }
- }
- else if(event.keyCode==8){
- run++
- body.onmousedown=function(){
- if(run==1){
- document.getElementsByClassName("_th-item _item-x4")[0].click();
- document.getElementsByClassName("_th-item _item-x4")[0].click();}}
- body.onmouseup=function(){
- document.getElementsByClassName("_th-item _item-reset")[0].click()}
- if(run==2){
- document.getElementsByClassName("_th-item _item-reset")[0].click()
- run=0;
- }
- }
- else if (event.keyCode==75){
- custt++;
- setTimeout(function(){custt=0},1200)
- if (custt==3){
- alert(`HERE ARE THE CONTROLS:
- [C] QUICK BURST OF SPEED, BEST FOR CAPTURE THE FLAG
- [2]DECREASE SPEED OF PLAYER
- [3]INCREASE SPEED OF PLAYER
- [B]INCREASE SPEED OF GUN, BEST FOR ANYTIME!!
- [C]QUICK GUN SWITCH BETWEEN TOP RATED GUNS
- [R]Leave a good review!! (>_<) click 5 times in a row to activate
- [L]Anti lag, quick burst of speed decreases to 5x instead of 64x, quickshoot not affected
- [k]View controls.... click 3x
- **ON NUMPAD**
- [+]INCREASE SPEED OF PLAYER
- [-]DECREASE SPEED OF PLAYER
- **YOU CAN CLICK HE BUTTONS AGAIN TO TOGGLE ON AND OFF**
- **MY NAME IS EGGZZY2015 ON KRUNKER.IO, IF U SEE ME U BETTER SAY THX LOL!!**`)
- custt=0;
- }
- }
- else if(event.keyCode==82){
- re++
- console.log(re)
- setTimeout(function(){re=0},1300)
- if(re==5){
- window.open("https://greasyfork.org/en/scripts/404954-krunker-io-speed-hackzzz/feedback");
- re=0;
- }
- }
- else if(event.keyCode==76){
- if(localStorage.getItem("lag")==null){
- localStorage.setItem("lag",1)}
- else if(localStorage.getItem("lag")!==null){
- localStorage.removeItem("lag");
- }
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement