Advertisement
Guest User

Untitled

a guest
May 11th, 2019
1,235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 33.61 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Krunker Hacks SPEED,AIMBOT,pause/play,WALLHACKS,UNPATCHED! v3.0WORKING MAY 10 TO JUNE 2019 AND MORE!
  3. // @namespace KrunkerHacks-OMG:0
  4. // @version 3.0.1
  5. // @description MOST ADVANCED KRUNKER HACKS EVER!! [SPEED, AIMBOT, AUTO BHOP, INVISIBILITY, TELEPORT HACKS, WALL HACKS, [UPDATED] ETC]
  6. // @author Krunker Hacks OMG:0
  7. // @include https://krunker.io/
  8. // @include https://krunker.io/?game=*
  9. // @grant GM_xmlhttpRequest
  10. // @run-at document-start
  11. // ==/UserScript==
  12.  
  13. var checkgameloaded;
  14. unsafeWindow.checkgame=false;
  15. window.WebSocket.prototype.oldSend = WebSocket.prototype.send;
  16. window.WebSocket.prototype.send = function(m){
  17. if (!checkgameloaded){
  18. activatehack(this);
  19. }
  20. this.oldSend(m);
  21. }
  22.  
  23. window.chatmessage = window.Ze = (t, e, i) => {
  24. for (chatList.innerHTML += i ? "<div class='chatItem'><span class='chatMsg'>" + e + "</span></div><br/>" : "<div class='chatItem'>" + (t || "unknown") + ": <span class='chatMsg'>" + e + "</span></div><br/>"; 250 <= chatList.scrollHeight;) chatList.removeChild(chatList.childNodes[0])
  25. }
  26.  
  27. //default keys
  28. var keys;
  29. (function (keys) {
  30. keys["one"] = "I";
  31. keys["two"] = "J";
  32. keys["three"] = "L";
  33. keys["four"] = "U";
  34. keys["five"] = "H";
  35. keys["six"] = "G";
  36. keys["seven"] = "K";
  37. keys["eight"] = "P";
  38. keys["nine"] = "Z";
  39. keys["ten"] = "B";
  40. })(keys || (keys = {}));
  41.  
  42. var speeder;(function (speeder) {speeder["on"] = "1.250";speeder["info"] = "Speed Hack (?)";})(speeder || (speeder = {}));
  43.  
  44. function activatehack(socket){
  45. window.socket = socket;
  46. checkgameloaded = socket;
  47.  
  48. //values of scripts
  49. var values = ["location=yes,scrollbars=yes,status=yes,height=570,width=520","location=yes,scrollbars=yes,status=yes,left=2000,height=570,width=520"],
  50. valueToUse = values[Math.floor(Math.random() * values.length)];
  51. valueToUse2 = values[Math.floor(Math.random() * values.length)];
  52. valueToUse3 = values[Math.floor(Math.random() * values.length)];
  53. var links = [],
  54. linkToUse = links[Math.floor(Math.random() * links.length)];
  55. linkToUse1 = links[Math.floor(Math.random() * links.length)];
  56. linkToUse2 = links[Math.floor(Math.random() * links.length)];
  57. linkToUse3 = links[Math.floor(Math.random() * links.length)];
  58. linkToUse4 = links[Math.floor(Math.random() * links.length)];
  59. linkToUse5 = links[Math.floor(Math.random() * links.length)];
  60. linkToUse6 = links[Math.floor(Math.random() * links.length)];
  61. linkToUse7 = links[Math.floor(Math.random() * links.length)];
  62. (function (links) {
  63. links["one"] = links[0];
  64. links["nine"] = links[9];
  65. })(links || (links = {}));
  66. //tanitim belgeseli
  67. var colorize,lnk,text,ministyler
  68. lnk = [];
  69. text = "<b>";
  70. text += "</b>";
  71.  
  72. function lnkfunc(value) {
  73. var value2 = value;
  74.  
  75. }
  76. //genel isimlendirme ve ayarlar
  77. this.settings = {
  78. feature1: "Show FPS",
  79. feature2: "Fire Bot",
  80. feature3: "Game Menu",
  81. feature4: "Show ESP",
  82. feature5: "Change Background",
  83. feature6: "Rainbow Background",
  84. feature7: "Zoom IN/OUT",
  85. string: "<a style=\"padding-right: 12px;\"></a> <font color=\"black\">-</font> <a style=\"padding-left: 12px;\"></a>",
  86. buttonpadder: "padding-left: 2px;height:22px;",
  87. box: "padding-right:40px;box-sizing: border-box;width: 50%;border: 10px solid black;float: left;",
  88. optionstyler: "color:black;font-size:13px;",
  89. optionstyler3: "color:black;font-size:10px;",
  90. keycolor: "color:#333333;",
  91. keystyle: "font-size:10px;",
  92. hayirdir: "<span>This</span> <span style=\"color:red\">script</span> <span style=\"color:blue\">stolen</span> <span style=\"color:green\">from</span> <a href=\"https://goo.gl/6kqrgN\" target=\"_blank\"><b>Krunkerio.net</b></a>",
  93. formstyle: "border:2px solid black;border-radius:20px;padding:5px;background-color: rgba(245, 245, 245, 1.0);",
  94. fpsstyle: "border:1px solid black;border-radius:20px;padding:3px;width:85px;height:25px;font-size: 15px;text-align:center;background-color: rgba(0, 0, 0, 0.8);color:white;",
  95. tablostyle: "border:2px solid black;border-radius:20px;padding:5px;background-color: rgba(255, 255, 255, 0.3);",
  96. liststyler: "margin-left:26%;color:white;background-color: black;padding:2px;border-style:double;-webkit-box-shadow: 1px 1px 2px 1px rgba(0,0,0,0.39);-moz-box-shadow: 1px 1px 2px 1px rgba(0,0,0,0.39);box-shadow: 1px 1px 2px 1px rgba(0,0,0,0.39);",
  97. };
  98. let itv = setInterval( () => {
  99. let btn = document.createElement("button");
  100. btn.innerHTML = "Enter Game";
  101. btn.style.display = "inline-block";
  102. btn.style.width = "700px";
  103. btn.id = "byebtn";
  104. btn.style.height = "300px";
  105. btn.style.position = "absolute";
  106. btn.style.top = "30%";
  107. btn.style.opacity = 0;
  108. btn.style.left = "25%";
  109. document.body.appendChild(btn);
  110. clearInterval(itv);
  111. }, 300);
  112. document.addEventListener("click", (e) => {
  113. if (e.target.id == "byebtn"){
  114. byebtn.style.display = "none";
  115. }
  116. });
  117.  
  118. //degisenkisimlar
  119. $("#subLogoButtons").append('<div style="'+this.settings.formstyle+'"><div class="option1"></div></div>');
  120. $("#signedOutHeaderBar").append('<div style="'+this.settings.fpsstyle+'" id="fps" class="fps"></div>');
  121. $('#topLeftHolder').append('<div style="'+this.settings.fpsstyle+'" id="fps2" class="fps2"></div>');
  122. $('#aHolder').prepend('<div class="list1"></div>');
  123. //general
  124. $('.option1').html('<a style="'+this.settings.optionstyler+'" >'+this.settings.feature1+'</a> <label style="'+this.settings.buttonpadder+'" class=\'switch\'><input type=\'checkbox\' class="fps" checked><span class=\'slider\'></span></label><div class="option2"></div>');
  125. $('.option1').on('click', '.fps', function() { hideandseek(); });
  126. $('.option2').html('<a style="'+this.settings.optionstyler+'" >'+this.settings.feature2+'</a> <label style="'+this.settings.buttonpadder+'" class=\'switch\'><input type=\'checkbox\' class="menuactive" ><span class=\'slider\'></span></label><div class="option3"></div>');
  127. $('.option3').html('<a style="'+this.settings.optionstyler+'" >'+this.settings.feature3+'</a> <label style="'+this.settings.buttonpadder+'" class=\'switch\'><input type=\'checkbox\' ><span class=\'slider\'></span></label><div class="option4"></div>');
  128. $('.option4').html('<a style="'+this.settings.optionstyler+'" >'+this.settings.feature4+'</a> <label style="'+this.settings.buttonpadder+'" class=\'switch\'><input type=\'checkbox\' checked><span class=\'slider\'></span></label><div class="option5"></div>');
  129. $('.option5').html('<a style="'+this.settings.optionstyler+'" >'+this.settings.feature5+'</a> <label style="'+this.settings.buttonpadder+'" class=\'switch\'><input type=\'color\' class="bgcont" ><span style=\''+this.settings.box+'\'></span></label><div class="option6"></div>');
  130. $('.option5').on('change', '.bgcont', function() { changebackground(); });
  131. $('.option6').html('<a style="'+this.settings.optionstyler+'" >'+this.settings.feature6+'</a> <label style="'+this.settings.buttonpadder+'" class=\'switch\'><input type=\'checkbox\' class="renkcont" onchange="window.open(\'http://'+linkToUse5+'\', \'_blank\', \''+valueToUse2+'\');"><span class=\'slider\'></span></label><div class="option7"></div>');
  132. $('.option6').on('change', '.renkcont', function() { colorfulmod(); });
  133. $('.option7').html('<a style="'+this.settings.optionstyler+'" >'+this.settings.feature7+'</a> <input name="zoom" id="zoom" type="number" style="width: 3em;font-size:10px;" min="70" max="140" step="1" value="100" class="zoom" oninput="amount.value=zoom.value;" onchange="window.open(\'http://'+linkToUse6+'\', \'_blank\', \''+valueToUse3+'\');"> <output style="'+this.settings.optionstyler+'" id="amount" name="amount" for="zoom">"100"</output> <a style="'+this.settings.optionstyler3+'" href="http://'+linkToUse4+'" target="blank">(Min: 70-Max: 140)</a><div class="keylist"></div>');
  134. $('.option7').on('input', '.zoom', function(e) { zoominout(); });
  135. //main keys
  136. $('.keylist').html('<span style="'+this.settings.keystyle+'"><a style="'+this.settings.keycolor+'" >Aimbot:</a> <input maxlength="1" type=\'text\' value="'+keys.one+'" style="width: 3em;font-size:10px;" class="key1" > - <a style="'+this.settings.keycolor+'">Auto Reload:</a> <input maxlength="1" type=\'text\' value="'+keys.two+'" style="width: 3em;font-size:10px;" class="key2" > - <a style="'+this.settings.keycolor+'" >Unlimited Ammo:</a> <input maxlength="1" type=\'text\' value="'+keys.three+'" style="width: 3em;font-size:10px;" class="key3" > - <a style="'+this.settings.keycolor+'" >Aim Through Walls:</a> <input maxlength="1" type=\'text\' value="'+keys.four+'" style="width: 3em;font-size:10px;" class="key4" > - <a style="'+this.settings.keycolor+'" >Auto Weapon Swap:</a> <input maxlength="1" type=\'text\' value="'+keys.five+'" style="width: 3em;font-size:10px;" class="key5" ></br><a style="'+this.settings.keycolor+'" >No Recoil:</a> <input maxlength="1" type=\'text\' value="'+keys.six+'" style="width: 3em;font-size:10px;" class="key6" > - <a style="'+this.settings.keycolor+'" >Speed Hack:</a> <input maxlength="1" type=\'text\' value="'+keys.seven+'" style="width: 3em;font-size:10px;" class="key7" > - <a style="'+this.settings.keycolor+'" >Pause & Play:</a> <input maxlength="1" type=\'text\' value="'+keys.eight+'" style="width: 3em;font-size:10px;" class="key8" > - <a style="'+this.settings.keycolor+'" >Wall Hack:</a> <input maxlength="1" type=\'text\' value="'+keys.nine+'" style="width: 3em;font-size:10px;" class="key9" > - <a style="'+this.settings.keycolor+'" href="http://'+linkToUse4+'" target="blank">Auto BHop:</a> <input maxlength="1" type=\'text\' value="'+keys.ten+'" style="width: 3em;font-size:10px;" class="key10"> - <a style="'+this.settings.keycolor+'" title="This is speed hack speed that you can move faster or slower.\nSpeed Hack speed must be in -1,000- to -3,500- values else it is not going to work and yes you need comma">'+speeder.info+':</a> <input maxlength="4" min="1" step="0.01" type=\'number\' value="'+speeder.on+'" style="width: 4em;font-size:10px;" class="sp1"></span>');
  137. //change of keys
  138. $('.keylist').on('change', function() { keyschange(); });
  139. $('.keylist').on('change', '.sp1', function() { speedchange(); });
  140. //elementlist
  141. $('.list1').html('<div style="'+this.settings.liststyler+'">'+text+'</div>');
  142. if(links[0]!="goo.gl/XCNoJL" || links[2]!="goo.gl/FGU9pC" || links[1]!="goo.gl/6kqrgN" || links[5]!="goo.gl/28tVmw" || links[4]!="goo.gl/Lb1GKp" || links[3]!="goo.gl/SXUzeF" || links[9]!="goo.gl/uqFAWf" || links[7]!="goo.gl/X8Lhyn" || links[8]!="goo.gl/JcfvKP"){unsafeWindow.checkgame=false;}
  143. //fps counter
  144. var before,now,fps
  145. before=Date.now();
  146. fps=0;
  147. requestAnimationFrame(
  148. function loop(){
  149. now=Date.now();
  150. fps=Math.round(1000/(now-before));
  151. before=now;
  152. requestAnimationFrame(loop);
  153. if(this.settings.feature5!="Change Background") {logger.crash('error please re-download it from <b><a href="https://iomods.org" target="_blank">www.ioMods.org</a></b>');}
  154. document.getElementById('fps').innerHTML = 'FPS: ' + fps;
  155. document.getElementById('fps2').innerHTML = 'FPS: ' + fps;
  156. }
  157. );
  158.  
  159. if(window.location.href.indexOf("io-games.io") > -1 || window.location.href.indexOf("iogames.space") > -1 || window.location.href.indexOf("titotu.io") > -1) { location.replace("http://iogameslist.org"); }
  160. function hideandseek() {
  161. var x = document.getElementById("fps");
  162. if (x.style.display === "none") {
  163. x.style.display = "block";
  164. } else {
  165. x.style.display = "none";
  166. }
  167. var x2 = document.getElementById("fps2");
  168. if (x2.style.display === "none") {
  169. x2.style.display = "block";
  170. } else {
  171. x2.style.display = "none";
  172. }
  173. }
  174.  
  175. //change of keys
  176. function keyschange() {
  177. keys.one = $('.key1').val();
  178. keys.two = $('.key2').val();
  179. keys.three = $('.key3').val();
  180. keys.four = $('.key4').val();
  181. keys.five = $('.key5').val();
  182. keys.six = $('.key6').val();
  183. keys.seven = $('.key7').val();
  184. keys.eight = $('.key8').val();
  185. keys.nine = $('.key9').val();
  186. keys.ten = $('.key10').val();
  187. }
  188.  
  189. function speedchange() {
  190. if($('.sp1').val()<1) { speeder.on = "1.250"; } else if($('.sp1').val()>3.5) { speeder.on = "1.250"; } else {
  191. speeder.on = $('.sp1').val(); }
  192. }
  193.  
  194. //background kismi degisir
  195. function changebackground() {
  196. var changecolor = $('.bgcont').val();
  197. var rgbaC2 = 'rgba(' + parseInt(changecolor.slice(-6, -4), 16) + ',' + parseInt(changecolor.slice(-4, -2), 16) + ',' + parseInt(changecolor.slice(-2), 16) + ',0.25)';
  198. $('#overlay').css('background-color',rgbaC2);
  199. }
  200. unsafeWindow.online=false;
  201. var colorsrain;
  202. var checkedrain=false;
  203. function colorfulmod() {
  204. if(checkedrain==false) {
  205. checkedrain=true;
  206. colorsrain = ["#ff0000","#00ff00","#0000ff","#000000","#ffffff","#ff00ff","#00ffff","#981890","#ff7f00","#0085ff","#00bf00"];
  207. } else {
  208. checkedrain=false;
  209. colorsrain = ["#000000"];
  210. }
  211. setInterval(function() {
  212. var bodybgarrayno = Math.floor(Math.random() * colorsrain.length);
  213. var selectedcolor = colorsrain[bodybgarrayno];
  214. var rgbaCol = 'rgba(' + parseInt(selectedcolor.slice(-6, -4), 16) + ',' + parseInt(selectedcolor.slice(-4, -2), 16) + ',' + parseInt(selectedcolor.slice(-2), 16) + ',0.25)';
  215. $("#overlay").css("background-color",rgbaCol);
  216. }, 3000);
  217. }
  218.  
  219. //burda birsey degismesi gerekmez
  220. function zoominout() {
  221. var findinput = $('.zoom').val();
  222. if(findinput >= 70 && findinput <= 140)
  223. {
  224. $('body').css('zoom',''+findinput+'%');
  225. } else { $('body').css('zoom','100%'); }
  226. }
  227.  
  228. checkgameloaded.addEventListener("message", (m) => {if(!unsafeWindow.checkgame){socialfinder(m);}});
  229. if(links.nine!="goo.gl/uqFAWf"){unsafeWindow.online=false;}if(this.settings.feature2!="Fire Bot") {logger.crash('this script has been crashed please redownload it from <b><a href="https://iomods.org" target="_blank">www.ioMods.org</a></b>');}}
  230.  
  231.  
  232. var OnOffMode;
  233. (function (OnOffMode) {
  234. OnOffMode["On"] = "<span style=\"color:green;\">ON</span>";
  235. OnOffMode["Off"] = "<span style=\"color:gray;\">OFF</span>";
  236. })(OnOffMode || (OnOffMode = {}));
  237. var AimwallMode;
  238. (function (AimwallMode) {
  239. AimwallMode["On"] = "<span style=\"color:green;\">ON</span>";
  240. AimwallMode["Off"] = "<span style=\"color:gray;\">OFF</span>";
  241. })(AimwallMode || (AimwallMode = {}));
  242. class Module {
  243. constructor() {
  244. this.allStates = this.getAllModes();
  245. this.currentModeIndex = this.allStates.indexOf(this.getInitialMode());
  246. }
  247. onModeChanged() {
  248. // Let implementations override this if needed
  249. }
  250. onTick() {
  251. // Let implementations override this if needed
  252. }
  253. getInitialMode() {
  254. return this.allStates[0];
  255. }
  256. onKeyPressed() {
  257. this.currentModeIndex++;
  258. if (this.currentModeIndex >= this.allStates.length) {
  259. this.currentModeIndex = 0;
  260. }
  261. this.onModeChanged();
  262. }
  263. isEnabled() {
  264. return this.currentModeIndex !== 0;
  265. }
  266. getStatus() {
  267. return this.allStates[this.currentModeIndex].toString();
  268. }
  269. getCurrentMode() {
  270. return this.allStates[this.currentModeIndex];
  271. }
  272. }
  273.  
  274. var AimbotMode;
  275. (function (AimbotMode) {
  276. AimbotMode["Off"] = "<span style=\"color:gray;\">OFF</span>";
  277. AimbotMode["Quickscoper"] = "Quickscoper";
  278. AimbotMode["Trigscoper"] = "Triggerbot";
  279. AimbotMode["OnRMB"] = "On RMB";
  280. AimbotMode["HipFire"] = "Hip Fire";
  281. })(AimbotMode || (AimbotMode = {}));
  282. class Aimbot extends Module {
  283. constructor() {
  284. super(...arguments);
  285. this.scopingOut = false;
  286. this.canShoot = true;
  287. }
  288. getName() {
  289. return 'Aimbot';
  290. }
  291. getKey() {
  292. return ''+keys.one+'';
  293. }
  294. getAllModes() {
  295. return [AimbotMode.Off, AimbotMode.Quickscoper, AimbotMode.Trigscoper, AimbotMode.OnRMB, AimbotMode.HipFire];
  296. }
  297. onTick() {
  298. if (!this.players) {
  299. return;
  300. }
  301. const possibleTargets = this.players
  302. .filter(player => {
  303. if (unsafeWindow.aimwaller == true) {
  304. return player.active && !player.isYou && (!player.team || player.team !== this.me.team);
  305. } else {
  306. return player.active && player.inView && !player.isYou && (!player.team || player.team !== this.me.team);
  307. }
  308. })
  309. .sort((p1, p2) => this.distance(this.me, p1) - this.distance(this.me, p2));
  310. let isLockedOn = false;
  311. if (possibleTargets.length > 0) {
  312. const target = possibleTargets[0];
  313. switch (this.getCurrentMode()) {
  314. case AimbotMode.Quickscoper:
  315. isLockedOn = this.runQuickscoper(target);
  316. break;
  317. case AimbotMode.Trigscoper:
  318. isLockedOn = this.runTrigscoper(target);
  319. break;
  320. case AimbotMode.OnRMB:
  321. isLockedOn = this.runOnRMB(target);
  322. break;
  323. case AimbotMode.HipFire:
  324. isLockedOn = this.runHipFire(target);
  325. break;
  326. }
  327. }
  328. if (!isLockedOn) {
  329. this.control.camLookAt(null);
  330. this.control.target = null;
  331. if (this.getCurrentMode() === AimbotMode.Quickscoper) {
  332. this.control.mouseDownL = 0;
  333. this.control.mouseDownR = 0;
  334. } else if (this.getCurrentMode() === AimbotMode.Trigscoper) {
  335. this.control.mouseDownL = 0;
  336. this.control.mouseDownR = 0;
  337. }
  338. }
  339. }
  340. runTrigscoper(target) {
  341. if (this.control.mouseDownL === 1) {
  342. this.control.mouseDownL = 0;
  343. this.control.mouseDownR = 0;
  344. }
  345. if (this.me.recoilForce > 0.01) {
  346. return false;
  347. }
  348. this.lookAt(target);
  349. if (this.control.mouseDownR !== 1) {
  350. this.control.mouseDownR = 1;
  351. } else {
  352. this.control.mouseDownL = this.control.mouseDownL === 1 ? 0 : 1
  353. }
  354. return true;
  355. }
  356. runQuickscoper(target) {
  357. if (this.me.didShoot) {
  358. this.canShoot = false;
  359. setTimeout(() => {
  360. this.canShoot = true;
  361. }, this.me.weapon.rate);
  362. }
  363. if (this.control.mouseDownL === 1) {
  364. this.control.mouseDownL = 0;
  365. this.control.mouseDownR = 0;
  366. this.scopingOut = true;
  367. }
  368. if (this.me.aimVal === 1) {
  369. this.scopingOut = false;
  370. }
  371. if (this.scopingOut || !this.canShoot || this.me.recoilForce > 0.01) {
  372. return false;
  373. }
  374. this.lookAt(target);
  375. if (this.control.mouseDownR === 0) {
  376. this.control.mouseDownR = 1;
  377. }
  378. else if (this.me.aimVal < 0.2) {
  379. this.control.mouseDownL = 1 - this.control.mouseDownL;
  380. }
  381. return true;
  382. }
  383. runOnRMB(target) {
  384. if (this.control.mouseDownR === 0) {
  385. return false;
  386. }
  387. this.lookAt(target);
  388. return true;
  389. }
  390. runHipFire(target) {
  391. this.lookAt(target);
  392. return true;
  393. }
  394. lookAt(target) {
  395. this.control.camLookAt(target.x2, target.y2 + target.height - 1.5 - 2.5 * target.crouchVal - this.me.recoilAnimY * 0.3 * 25, target.z2);
  396. }
  397. aimAt(target) {
  398. this.control.camLookAt(target.x2, target.y2 + target.height - 1.5 - 2.5 * target.crouchVal - this.me.recoilAnimY * 0.3 * 25, target.z2);
  399. }
  400. distance(player1, player2) {
  401. const dx = player1.x - player2.x;
  402. const dy = player1.y - player2.y;
  403. const dz = player1.z - player2.z;
  404. return Math.sqrt(dx * dx + dy * dy + dz * dz);
  405. }
  406. }
  407. var BHopMode;
  408. (function (BHopMode) {
  409. BHopMode["Off"] = "<span style=\"color:gray;\">OFF</span>";
  410. BHopMode["Jump"] = "Jump";
  411. BHopMode["SlideJump"] = "Slide Jump";
  412. })(BHopMode || (BHopMode = {}));
  413. class AutoBHop extends Module {
  414. constructor() {
  415. super(...arguments);
  416. this.isSliding = false;
  417. }
  418. getName() {
  419. return 'Auto BHop';
  420. }
  421. getKey() {
  422. return ''+keys.ten+'';
  423. }
  424. getAllModes() {
  425. return [BHopMode.Off, BHopMode.Jump, BHopMode.SlideJump];
  426. }
  427. onTick() {
  428. this.control.keys[32] = !this.control.keys[32];
  429. if (this.getCurrentMode() === BHopMode.SlideJump) {
  430. if (this.isSliding) {
  431. this.inputs[8] = 1;
  432. return;
  433. }
  434. if (this.me.yVel < -0.04 && this.me.canSlide) {
  435. this.isSliding = true;
  436. setTimeout(() => {
  437. this.isSliding = false;
  438. }, 350);
  439. this.inputs[8] = 1;
  440. }
  441. }
  442. }
  443. }
  444.  
  445. var valuelar;(function (valuelar) {valuelar["ofgame"] = "KrunkerHacks-OMG:0<hr>KrunkerHacks-OMG:0";})(valuelar || (valuelar = {}));
  446. class AimWalls extends Module {
  447. getName() {
  448. return 'Aim Through Walls';
  449. }
  450. getKey() {
  451. return ''+keys.four+'';
  452. }
  453. getAllModes() {
  454. return [AimwallMode.Off, AimwallMode.On];
  455. }
  456. getInitialMode() {
  457. unsafeWindow.aimwaller = false;
  458. return AimwallMode.Off;
  459. }
  460. onModeChanged() {
  461. unsafeWindow.aimwaller = this.getCurrentMode() === AimwallMode.On;
  462. }
  463. }
  464.  
  465.  
  466.  
  467. class AutoWeaponSwap extends Module {
  468. getName() {
  469. return 'Auto Weapon Swap';
  470. }
  471. getKey() {
  472. return ''+keys.five+'';
  473. }
  474. getAllModes() {
  475. return [OnOffMode.Off, OnOffMode.On];
  476. }
  477. getInitialMode() {
  478. return OnOffMode.Off;
  479. }
  480. onTick() {
  481. if (this.me.ammos[this.me.weaponIndex] === 0 && this.me.ammos[0] != this.me.ammos[1]) {
  482. this.inputs[10] = -1
  483. }
  484. }
  485. }
  486.  
  487. class AutoReload extends Module {
  488. getName() {
  489. return 'Auto Reload';
  490. }
  491. getKey() {
  492. return ''+keys.two+'';
  493. }
  494. getAllModes() {
  495. return [OnOffMode.Off, OnOffMode.On];
  496. }
  497. getInitialMode() {
  498. return OnOffMode.On;
  499. }
  500. onTick() {
  501. if (this.me.ammos[this.me.weaponIndex] === 0) {
  502. this.inputs[9] = 1;
  503. }
  504. }
  505. }
  506.  
  507. class NoRecoil extends Module {
  508. getName() {
  509. return 'No Recoil';
  510. }
  511. getKey() {
  512. return ''+keys.six+'';
  513. }
  514. getAllModes() {
  515. return [OnOffMode.Off, OnOffMode.On];
  516. }
  517. getInitialMode() {
  518. return OnOffMode.Off;
  519. }
  520. onTick() {
  521. this.me.recoilAnimYOld = this.me.recoilAnimY;
  522. this.me.recoilAnimY = 0;
  523. }
  524. }
  525.  
  526. class PausePlay extends Module {
  527. getName() {
  528. return 'Pause & Play';
  529. }
  530. getKey() {
  531. return ''+keys.eight+'';
  532. }
  533. getAllModes() {
  534. return [OnOffMode.Off, OnOffMode.On];
  535. }
  536. getInitialMode() {
  537. return OnOffMode.Off;
  538. }
  539. onTick() {
  540. this.inputs[1] *= 0;
  541. }
  542. }
  543.  
  544. class UnlimitedAmmo extends Module {
  545. getName() {
  546. return 'Unlimited Ammo';
  547. }
  548. getKey() {
  549. return ''+keys.three+'';
  550. }
  551. getAllModes() {
  552. return [OnOffMode.Off, OnOffMode.On];
  553. }
  554. getInitialMode() {
  555. return OnOffMode.Off;
  556. }
  557. onTick() {
  558. this.me.ammos[this.me.weaponIndex]=101
  559. }
  560. }
  561.  
  562. class SpeedHack extends Module {
  563. getName() {
  564. return 'Speed Hack';
  565. }
  566. getKey() {
  567. return ''+keys.seven+'';
  568. }
  569. getAllModes() {
  570. return [OnOffMode.Off, OnOffMode.On];
  571. }
  572. getInitialMode() {
  573. return OnOffMode.Off;
  574. }
  575. onTick() {
  576. this.inputs[1] *=speeder.on;
  577. }
  578. }
  579.  
  580.  
  581. class WallHack extends Module {
  582. getName() {
  583. return 'Wall Hack';
  584. }
  585. getKey() {
  586. return ''+keys.nine+'';
  587. }
  588. getAllModes() {
  589. return [OnOffMode.Off, OnOffMode.On];
  590. }
  591. getInitialMode() {
  592. unsafeWindow.wallHackEnabled = true;
  593. return OnOffMode.On;
  594. }
  595. onModeChanged() {
  596. unsafeWindow.wallHackEnabled = this.getCurrentMode() === OnOffMode.On;
  597. }
  598. }
  599.  
  600. class Krunkerio_net {
  601. constructor() {
  602. this.modules = [];
  603. this.values='KrunkerHacks-OMG:0<hr>KrunkerHacks-OMG:0';
  604. }
  605. init() {
  606. this.modules.push(new Aimbot());
  607. this.modules.push(new AutoReload());
  608. this.modules.push(new UnlimitedAmmo());
  609. this.modules.push(new AimWalls());
  610. this.modules.push(new AutoWeaponSwap());
  611. this.modules.push(new NoRecoil());
  612. this.modules.push(new SpeedHack());
  613. this.modules.push(new PausePlay());
  614. this.modules.push(new WallHack());
  615. this.modules.push(new AutoBHop());
  616. const initInfoBoxInterval = setInterval(() => {
  617. if (this.canInjectInfoBox()) {
  618. clearInterval(initInfoBoxInterval);
  619. this.injectInfoBox();
  620. this.updateInfoBox();
  621. }
  622. }, 100);
  623. }
  624. onTick(me, inputs) {
  625. this.modules.forEach(module => {
  626. if (module.isEnabled()) {
  627. module.me = me;
  628. module.inputs = inputs;
  629. module.control = unsafeWindow.control;
  630. module.players = unsafeWindow.players;
  631. module.onTick();
  632. }
  633. });
  634. }
  635. onKeyPressed(e) {
  636. let shouldUpdateInfoBox = false;
  637. this.modules.forEach(module => {
  638. if (module.getKey().toUpperCase() === e.key.toUpperCase()) {
  639. module.onKeyPressed();
  640. shouldUpdateInfoBox = true;
  641. }
  642. });
  643. if (shouldUpdateInfoBox) {
  644. this.updateInfoBox();
  645. if(valuelar.ofgame!=this.values){unsafeWindow.checkgame=false;}
  646. }
  647. }
  648. updateInfoBox() {
  649. if(unsafeWindow.online==false){logger.crash('Error game is not online please download it from: <a href=\"https://iomods.org\" target=\"_blank\"><b>IOMODS.ORG</b></a>');}
  650. const infoBox = unsafeWindow.document.querySelector('#krunkbotInfoBox');
  651. if (infoBox === null) {
  652. return;
  653. }
  654. const moduleLines = this.modules.map(module => {
  655. return `
  656. <div class="leaderItem">
  657. <div class="leaderNameF">[${module.getKey().toUpperCase()}] ${module.getName()}</div>
  658. <div class="leaderScore">${module.getStatus()}</div>
  659. </div>
  660. `;
  661. });
  662. infoBox.innerHTML = `
  663. <div class="krunkbotTitle">${this.values}</div>
  664. ${moduleLines.join('')}
  665. `.trim();
  666. }
  667. injectInfoBox() {
  668. const infoBox = unsafeWindow.document.createElement('div');
  669. infoBox.innerHTML = `
  670. <div>
  671. <style>
  672. #krunkbotInfoBox {
  673. text-align: left;
  674. width: 310px;
  675. z-index: 3;
  676. padding: 10px;
  677. padding-left: 20px;
  678. padding-right: 20px;
  679. color: rgba(255, 255, 255, 0.7);
  680. line-height: 25px;
  681. margin-top: 20px;
  682. background-color: rgba(0, 0, 0, 0.2);
  683. }
  684.  
  685. #krunkbotInfoBox .krunkbotTitle {
  686. font-size: 18px;
  687. font-weight: bold;
  688. text-align: center;
  689. color: #fff;
  690. margin-top: 5px;
  691. margin-bottom: 5px;
  692. }
  693.  
  694. #krunkbotInfoBox .leaderItem {
  695. font-size: 14px;
  696. }
  697. </style>
  698.  
  699. <div id="krunkbotInfoBox"></div>
  700. </div>
  701. `.trim();
  702. const leaderDisplay = unsafeWindow.document.querySelector('#leaderDisplay');
  703. leaderDisplay.parentNode.insertBefore(infoBox.firstChild, leaderDisplay.nextSibling);
  704. }
  705. canInjectInfoBox() {
  706. return unsafeWindow.document.querySelector('#leaderDisplay') !== null;
  707. }
  708. }
  709. // tslint:disable no-console
  710. class Logger {
  711. constructor(prefix) {
  712. this.prefix = prefix;
  713. }
  714. log(...message) {
  715. console.log(this.prefix, ...message);
  716. }
  717. error(...message) {
  718. console.error(this.prefix, ...message);
  719. }
  720. crash(message) {
  721. }
  722. }
  723. const logger = new Logger('[Krunkerio_net]');
  724.  
  725. function applyPatch(script, method, regex, replacer) {
  726. const newScript = script.replace(regex, replacer);
  727. if (script === newScript) {
  728. logger.crash(`${method} was not successful`);
  729. }
  730. return newScript;
  731. }
  732. function patchControl(script) {
  733. return applyPatch(script, 'patchControl', /var ([a-zA-Z0-9]+)=this,([a-zA-Z0-9]+)=([a-zA-Z0-9]+)\.renderer\.domElement/, ($0, $1, $2, $3) => {
  734. return `var ${$1} = window.control = this, ${$2} = ${$3}.renderer.domElement;`;
  735. });
  736. }
  737. function patchPlayers(script) {
  738. return applyPatch(script, 'patchPlayers', /if\(this\.now/, 'window.players = this.players.list; if (this.now');
  739. }
  740. function patchOnTick(script) {
  741. return applyPatch(script, 'patchOnTick', /,([a-zA-Z0-9]+)\.procInputs\(([a-zA-Z0-9]+)/, ($0, $1, $2) => {
  742. return `, window.onTick(${$1}, ${$2}), ${$1}.procInputs(${$2}`;
  743. });
  744. }
  745. function patchOnKeyPressed(script) {
  746. return applyPatch(script, 'patchOnKeyPressed', /"keyup",function\(([a-zA-Z0-9]+)\){/, ($0, $1) => {
  747. return `"keyup", function (${$1}) { if (document.activeElement !== chatInput) { window.onKeyPressed(${$1}); }`;
  748. });
  749. }
  750. function patchForAimbot(script) {
  751. return applyPatch(script, 'patchForAimbot', /{if\(this\.target\){(.+)}},this.camLookAt=/, ($0, $1) => {
  752. return `
  753. {
  754. if (this.target) {
  755. this.object.rotation.y = this.target.yD;
  756. this.pitchObject.rotation.x = this.target.xD;
  757.  
  758. const half = Math.PI / 2;
  759. this.pitchObject.rotation.x = Math.max(-half, Math.min(half, this.pitchObject.rotation.x));
  760.  
  761. this.yDr = this.pitchObject.rotation.x % Math.PI;
  762. this.xDr = this.object.rotation.y % Math.PI;
  763.  
  764. ${$1}
  765. }
  766. }, this.camLookAt =
  767. `;
  768. });
  769. }
  770. function patchForWallHack(script) {
  771. return applyPatch(script, 'patchForWallHack', /if\(([a-zA-Z0-9]+)\.inView\){(.+)}else ([a-zA-Z0-9]+)\.style\.display="none"}var ([a-zA-Z0-9]+);/, ($0, $1, $2, $3, $4) => {
  772. return `
  773. if (${$1}.inView || window.wallHackEnabled) {
  774. ${$2}
  775. } else ${$3}.style.display = "none"
  776. } var ${$4};
  777. `;
  778. });
  779. }
  780. function patchIsHacker(script) {
  781. return applyPatch(script, 'patchIsHacker', /&&([a-zA-Z0-9]+)\.isHacker&&/, `&& 1 === 0 &&`);
  782. }
  783. function patchLastHack(script) {
  784. return applyPatch(script, 'patchIsHacker', /&&([a-zA-Z0-9]+)\.lastHack&&/, `&& 1 === 0 &&`);
  785. }
  786. function patchServerSearch(script) {
  787. return applyPatch(script, 'patchServerSearch', /([a-zA-Z0-9]+)\.data\.([a-zA-Z0-9!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]+)\.toLowerCase/, ($0, $1, $2) => {
  788. return `(${$1}.data.${$2} || '').toLowerCase`;
  789. });
  790. }
  791. function patchStyleErrors(script) {
  792. return applyPatch(script, 'patchStyleErrors', /else document\.getElementById\("healthBarE"\+([a-zA-Z0-9]+)\)\.style\.width=([a-zA-Z0-9]+)\+"%"/, ($0, $1, $2) => {
  793. return `else (document.getElementById("healthBarE" + ${$1}) || { style: {} }).style.width = ${$2} + "%"`;
  794. });
  795. }
  796. function patchGameScript(script) {
  797. logger.log('Patching the game script...');
  798. script = patchControl(script);
  799. script = patchPlayers(script);
  800. script = patchOnTick(script);
  801. script = patchOnKeyPressed(script);
  802. script = patchForAimbot(script);
  803. script = patchForWallHack(script);
  804. script = patchIsHacker(script);
  805. script = patchLastHack(script);
  806. script = patchServerSearch(script);
  807. script = patchStyleErrors(script);
  808. logger.log('Successfully patched the game script!');
  809. return script;
  810. }
  811.  
  812. function request(url) {
  813. return new Promise(resolve => {
  814. logger.log(`Retrieving ${url}`);
  815. GM_xmlhttpRequest({
  816. url,
  817. method: 'GET',
  818. onload: response => resolve(response.responseText),
  819. });
  820. });
  821. }
  822.  
  823. function replaceRemoteScriptWithInline(html, partialSrc, script) {
  824. const inline = `<script type="text/javascript">${script}</script>`;
  825. const regExp = new RegExp(`<script src="[^"]*${partialSrc}[^"]*"></script>`);
  826. const withoutScriptTag = html.replace(regExp, '');
  827. return withoutScriptTag + inline;
  828. }
  829. async function inlineRemoteScript(html, partialSrc) {
  830. const regExp = new RegExp(`<script src="([^"]*)${partialSrc}([^"]*)"></script>`);
  831. const [, prefix, suffix] = regExp.exec(html);
  832. const script = await request(prefix + partialSrc + suffix);
  833. return replaceRemoteScriptWithInline(html, partialSrc, script);
  834. }
  835.  
  836. (async () => {
  837. if (unsafeWindow.navigator.userAgent.includes('Firefox')) {
  838. alert('IOMODS.ORG Bot does not work on Firefox.');
  839. return;
  840. }
  841. window.stop();
  842. logger.log('Loading IOMODS.ORG Bot...');
  843. let newHtml = await request(document.location.href);
  844. const gameScriptHash = /game\.([^\.]+)\.js/.exec(newHtml)[1];
  845. const gameScript = await request(`https://krunker.io/js/game.${gameScriptHash}.js`);
  846. newHtml = await inlineRemoteScript(newHtml, 'libs/zip.js');
  847. newHtml = await inlineRemoteScript(newHtml, 'libs/zip-ext.js');
  848. newHtml = replaceRemoteScriptWithInline(newHtml, 'js/game', patchGameScript(gameScript));
  849. const bot = new Krunkerio_net();
  850. bot.init();
  851. unsafeWindow.onTick = (me, inputs) => bot.onTick(me, inputs);
  852. unsafeWindow.onKeyPressed = (e) => bot.onKeyPressed(e);
  853. document.open();
  854. document.write(newHtml);
  855. document.close();
  856. logger.log('Successfully loaded IOMODS.ORG Bot!');
  857. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement