Advertisement
Guest User

Untitled

a guest
Nov 15th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.75 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Krunker.io Hack
  3. // @description Krunker.io Hack
  4. // @updateURL https://github.com/xF4b3r/krunker/raw/master/userscript.user.js
  5. // @downloadURL https://github.com/xF4b3r/krunker/raw/master/userscript.user.js
  6. // @version 2.11
  7. // @author Faber, collaborators: William Thomson, Tehchy
  8. // @include /^(https|http):\/\/krunker\.io(|\/|\/\?server=.+)$/
  9. // @grant GM_xmlhttpRequest
  10. // @run-at document-start
  11. // ==/UserScript==
  12. window.stop()
  13. document.innerHTML = ""
  14.  
  15. class Hack {
  16. constructor() {
  17. this.camera = null
  18. this.inputs = null
  19. this.game = null
  20. this.fps = 0
  21. this.fpsTimes = []
  22. this.fpsCounter = null
  23. this.canvas = null
  24. this.ctx = null
  25. this.hooks = {
  26. entities: [],
  27. world: null,
  28. context: null,
  29. config: null
  30. }
  31. this.settings = {
  32. esp: true,
  33. bhop: 0,
  34. bhopHeld: false,
  35. fpsCounter: true,
  36. autoAim: 3,
  37. autoAimWalls: false,
  38. aimSettings: true,
  39. noRecoil: true,
  40. tracers: true,
  41. autoRespawn: false,
  42. }
  43. this.settingsMenu = [];
  44. this.aimbot = {
  45. initialized: false
  46. }
  47. this.onLoad()
  48. }
  49.  
  50. getDistance3D(x1, y1, z1, x2, y2, z2) {
  51. const dx = x1 - x2
  52. const dy = y1 - y2
  53. const dz = z1 - z2
  54. return Math.sqrt(dx * dx + dy * dy + dz * dz)
  55. }
  56.  
  57. createCanvas() {
  58. const hookedCanvas = document.createElement("canvas")
  59. hookedCanvas.width = innerWidth
  60. hookedCanvas.height = innerHeight
  61. window.addEventListener('resize', () => {
  62. hookedCanvas.width = innerWidth
  63. hookedCanvas.height = innerHeight
  64. });
  65. this.canvas = hookedCanvas
  66. this.ctx = hookedCanvas.getContext("2d")
  67. const hookedUI = document.getElementById("inGameUI")
  68. hookedUI.insertAdjacentElement("beforeend", hookedCanvas)
  69. requestAnimationFrame(this.render.bind(this))
  70. }
  71.  
  72. createFPSCounter() {
  73. if (!this.settings.fpsCounter) return
  74. const el = document.createElement("div")
  75. el.id = "fpsCounter"
  76. el.style.position = "absolute"
  77. el.style.color = "white"
  78. el.style.top = "0.4em"
  79. el.style.left = "20px"
  80. el.style.fontSize = "smaller"
  81. el.innerHTML = `FPS: ${this.fps}`
  82. this.fpsCounter = el
  83. const ui = document.getElementById("gameUI")
  84. ui.appendChild(el, ui)
  85. }
  86.  
  87. createMenu() {
  88. const rh = document.getElementById('rightHolder');
  89. rh.insertAdjacentHTML("beforeend", "<br/><a href='javascript:;' onmouseover=\"SOUND.play('tick_0',0.1)\" onclick='showWindow(window.windows.length);' class=\"menuLink\">Hacks</a>")
  90. let self = this
  91. this.settingsMenu = [{
  92. name: "Show FPS",
  93. pre: "<div class='setHed'><center>Hack Settings</center></div><div class='setHed'>Render</div>",
  94. val: 1,
  95. html() {
  96. return `<label class='switch'><input type='checkbox' onclick='window.hack.setSetting(0, this.checked)' ${self.settingsMenu[0].val ? "checked" : ""}><span class='slider'></span></label>`
  97. },
  98. set(t) {
  99. self.settings.fpsCounter = t;
  100. }
  101. }, {
  102. name: "Player ESP",
  103. val: 1,
  104. html() {
  105. return `<label class='switch'><input type='checkbox' onclick='window.hack.setSetting(1, this.checked)' ${self.settingsMenu[1].val ? "checked" : ""}><span class='slider'></span></label>`
  106. },
  107. set(t) {
  108. self.settings.esp = t
  109. }
  110. }, {
  111. name: "Player Tracers",
  112. val: 1,
  113. html() {
  114. return `<label class='switch'><input type='checkbox' onclick='window.hack.setSetting(2, this.checked)' ${self.settingsMenu[2].val ? "checked" : ""}><span class='slider'></span></label>`
  115. },
  116. set(t) {
  117. self.settings.tracers = t;
  118. }
  119. }, {
  120. name: "BHop",
  121. pre: "<div class='setHed'>Movement</div>",
  122. val: 0,
  123. html() {
  124. return `<select onchange="window.hack.setSetting(3, this.value)"><option value="0"${self.settingsMenu[3].val == 0 ? " selected" : ""}>Off</option><option value="1"${self.settingsMenu[3].val == 1 ? " selected" : ""}>Automatic</option><option value="2"${self.settingsMenu[3].val == 2 ? " selected" : ""}>Manual</option></select>`
  125. },
  126. set(t) {
  127. self.settings.bhop = parseInt(t)
  128. }
  129. }, {
  130. name: "No Recoil",
  131. pre: "<div class='setHed'>Combat</div>",
  132. val: 0,
  133. html() {
  134. return `<label class='switch'><input type='checkbox' onclick='window.hack.setSetting(4, this.checked)' ${self.settingsMenu[4].val ? "checked" : ""}><span class='slider'></span></label>`
  135. },
  136. set(t) {
  137. self.settings.noRecoil = t
  138. }
  139. }, {
  140. name: "Auto Aim",
  141. val: 3,
  142. html() {
  143. return `<select onchange="window.hack.setSetting(5, this.value)"><option value="0"${self.settingsMenu[5].val == 0 ? " selected" : ""}>Off</option><option value="1"${self.settingsMenu[5].val == 1 ? " selected" : ""}>TriggerBot</option><option value="2"${self.settingsMenu[5].val == 2 ? " selected" : ""}>Quickscoper</option><option value="3"${self.settingsMenu[5].val == 3 ? " selected" : ""}>Manual</option></select>`
  144. },
  145. set(t) {
  146. self.settings.autoAim = parseInt(t)
  147. }
  148. }, {
  149. name: "Aim Through Walls",
  150. val: 0,
  151. html() {
  152. return `<label class='switch'><input type='checkbox' onclick='window.hack.setSetting(6, this.checked);' ${self.settingsMenu[5].val ? (self.settingsMenu[6].val ? "checked" : "") : "disabled"}><span class='slider'></span></label>`
  153. },
  154. set(t) {
  155. self.settings.autoAimWalls = t;
  156. }
  157. }, {
  158. name: "Custom Aim Settings",
  159. val: 0,
  160. html() {
  161. return `<label class='switch'><input type='checkbox' onclick='window.hack.setSetting(7, this.checked)' ${self.settingsMenu[7].val ? "checked" : ""}><span class='slider'></span></label>`
  162. },
  163. set(t) {
  164. self.settings.aimSettings = t;
  165. self.changeSettings();
  166. }
  167. }, {
  168. name: "Auto Respawn",
  169. val: 0,
  170. html() {
  171. return `<label class='switch'><input type='checkbox' onclick='window.hack.setSetting(8, this.checked)' ${self.settingsMenu[8].val ? "checked" : ""}><span class='slider'></span></label>`
  172. },
  173. set(t) {
  174. self.settings.autoRespawn = t;
  175. }
  176. }];
  177. }
  178.  
  179. setupSettings() {
  180. for (let i = 0; i < this.settingsMenu.length; ++i)
  181. if (this.settingsMenu[i].set) {
  182. const nt = this.getSavedVal(`kro_set_hack_${i}`);
  183. this.settingsMenu[i].val = null !== nt ? nt : this.settingsMenu[i].val,
  184. "false" == this.settingsMenu[i].val && (this.settingsMenu[i].val = !1),
  185. this.settingsMenu[i].set(this.settingsMenu[i].val, !0)
  186. }
  187. }
  188.  
  189. keyDown(event) {
  190. switch (event.key.toUpperCase()) {
  191. case 'B':
  192. this.settings.bhop++;
  193. if (this.settings.bhop > 2) this.settings.bhop = 0
  194. this.setSetting(3, this.settings.bhop);
  195. var n = this.settings.bhop == 0 ? 'Disabled' : (this.settings.bhop == 2 ? 'Manual' : 'Automatic');
  196. this.chatMessage(null, `<span style='color:#fff'>BHop - </span> <span style='color:${this.settings.bhop > 0 ? 'green' : 'red'}'>${n}</span>`, !0)
  197. break;
  198.  
  199. case 'T':
  200. this.settings.autoAim++;
  201. if (this.settings.autoAim > 3) this.settings.autoAim = 0
  202. this.setSetting(5, this.settings.autoAim);
  203. var n = this.settings.autoAim == 0 ? 'Disabled' : (this.settings.autoAim == 3 ? 'Manual' : (this.settings.autoAim == 2 ? 'Quickscoper' : 'TriggerBot'));
  204. this.chatMessage(null, `<span style='color:#fff'>AutoAim - </span> <span style='color:${this.settings.autoAim > 0 ? 'green' : 'red'}'>${n}</span>`, !0)
  205. break;
  206.  
  207. case ' ':
  208. if (this.settings.bhop !== 2) return;
  209. this.settings.bhopHeld = true;
  210. break;
  211. }
  212. }
  213.  
  214. keyUp(event) {
  215. switch (event.key.toUpperCase()) {
  216. case ' ':
  217. if (this.settings.bhop !== 2) return;
  218. this.settings.bhopHeld = false;
  219. break;
  220. }
  221. }
  222.  
  223. chatMessage(t, e, n) {
  224. const chatList = document.getElementById('chatList');
  225. for (chatList.innerHTML += n ? `<div class='chatItem'><span class='chatMsg'>${e}</span></div><br/>` : `<div class='chatItem'>${t || "unknown"}: <span class='chatMsg'>${e}</span></div><br/>`; chatList.scrollHeight >= 250;)
  226. chatList.removeChild(chatList.childNodes[0])
  227. }
  228.  
  229. drawText(txt, font, color, x, y) {
  230. this.ctx.save()
  231. this.ctx.translate(x, y)
  232. this.ctx.beginPath()
  233. this.ctx.fillStyle = color
  234. this.ctx.font = font
  235. this.ctx.fillText(txt, 0, 0)
  236. this.ctx.closePath()
  237. this.ctx.restore()
  238. }
  239.  
  240. getMyself() {
  241. return this.hooks.entities.find(x => x.isYou)
  242. }
  243.  
  244. randFloat(t, e) {
  245. return t + Math.random() * (e - t)
  246. }
  247.  
  248. getDirection(t, e, n, r) {
  249. return Math.atan2(e - r, t - n)
  250. }
  251.  
  252. getXDir(e, n, r, i, a, s) {
  253. const o = Math.abs(n - a)
  254. const c = this.getDistance3D(e, n, r, i, a, s)
  255. return Math.asin(o / c) * (n > a ? -1 : 1)
  256. }
  257.  
  258. getAngleDist(t, e) {
  259. return Math.atan2(Math.sin(e - t), Math.cos(t - e))
  260. }
  261.  
  262. getTarget() {
  263. let target = null
  264. let bestDist = this.getRange()
  265. for (const player of this.hooks.entities.filter(x => !x.isYou)) {
  266. if ((player.notObst || this.settings.autoAimWalls) && player.active) {
  267. if (this.me.team && this.me.team === player.team) continue
  268. let dist = this.getDistance3D(this.me.x, this.me.y, this.me.z, player.x, player.y, player.z)
  269. if (dist < bestDist) {
  270. bestDist = dist
  271. target = player
  272. }
  273. }
  274. }
  275. return target
  276. }
  277.  
  278. getDistFromPlayer(player) {
  279. return Math.floor(this.me ? this.getDistance3D(this.me.x, this.me.y, this.me.z, player.x, player.y, player.z) : 0)
  280. }
  281.  
  282. getRange() {
  283. if (this.me.weapon.range) return this.me.weapon.range + 25
  284. return 9999
  285. }
  286.  
  287. drawESP() {
  288. for (const entity of this.hooks.entities.filter(x => !x.isYou)) {
  289. if (entity.active) {
  290. const me = this.hooks.world.camera.getWorldPosition()
  291. const target = entity.objInstances.position.clone()
  292. const dist = 1 - this.getDistance3D(me.x, me.y, me.z, target.x, target.y, target.z) / 600
  293. if (20 * dist >= 1 && this.hooks.world.frustum.containsPoint(target)) {
  294. const scale = Math.max(.1, 1 - this.getDistance3D(me.x, me.y, me.z, target.x, target.y, target.z) / 600)
  295. const targetX = entity.hookedX
  296. const targetY = entity.hookedY + 60 * scale
  297. const offsetX = 80
  298. const offsetY = 180
  299.  
  300.  
  301. if (this.settings.esp) {
  302. this.ctx.save()
  303. this.ctx.translate(targetX - (offsetX * scale / 2) - (40 * scale / 2), targetY - (offsetY * scale / 2))
  304. this.ctx.beginPath()
  305. this.ctx.fillStyle = "red"
  306. this.ctx.rect(0, 0, 20 * scale, offsetY * scale)
  307. this.ctx.stroke()
  308. this.ctx.closePath()
  309. this.ctx.restore()
  310.  
  311. this.ctx.save()
  312. this.ctx.translate(targetX - (offsetX * scale / 2) - (40 * scale / 2), targetY - (offsetY * scale / 2))
  313. this.ctx.beginPath()
  314. this.ctx.fillStyle = "green"
  315. this.ctx.rect(0, 0, 20 * scale, offsetY * scale)
  316. this.ctx.fill()
  317. this.ctx.closePath()
  318. this.ctx.restore()
  319.  
  320. this.ctx.save()
  321. this.ctx.translate(targetX - (offsetX * scale / 2) - (40 * scale / 2), targetY - (offsetY * scale / 2))
  322. this.ctx.beginPath()
  323. this.ctx.fillStyle = "red"
  324. this.ctx.rect(0, 0, 20 * scale, (entity.maxHealth - entity.health) / entity.maxHealth * offsetY * scale)
  325. this.ctx.fill()
  326. this.ctx.closePath()
  327. this.ctx.restore()
  328.  
  329. this.ctx.save()
  330. this.ctx.translate(targetX - (offsetX * scale / 2), targetY - (offsetY * scale / 2))
  331. this.ctx.beginPath()
  332. this.ctx.fillStyle = "red"
  333. this.ctx.rect(0, 0, offsetX * scale, offsetY * scale)
  334. this.ctx.stroke()
  335. this.ctx.closePath()
  336. this.ctx.restore()
  337.  
  338. const fontSize = 26 * scale > 13 ? 13 : 26 * scale
  339. this.drawText(`Name: ${entity.name}`, `${fontSize}px`, "green", targetX + (offsetX * scale / 2), targetY - (offsetY * scale / 2))
  340. this.drawText(`Distance: ${~~this.getDistance3D(me.x, me.y, me.z, target.x, target.y, target.z)}`, `${fontSize}px`, "green", targetX + (offsetX * scale / 2), targetY - (offsetY * scale / 2) + 10)
  341. this.drawText(`Health: ${entity.health}/${entity.maxHealth}`, `${fontSize}px`, "green", targetX + (offsetX * scale / 2), targetY - (offsetY * scale / 2) + 20)
  342. this.drawText(`Weapon: ${entity.weapon.name}`, `${fontSize}px`, "green", targetX + (offsetX * scale / 2), targetY - (offsetY * scale / 2) + 30)
  343. this.drawText(`Ammo: ${entity.ammos[0]}`, `${fontSize}px`, "green", targetX + (offsetX * scale / 2), targetY - (offsetY * scale / 2) + 40)
  344. }
  345.  
  346. if (this.settings.tracers) {
  347. this.ctx.save()
  348. this.ctx.lineWidth = 2
  349. this.ctx.strokeStyle = entity.team === null ? "red" : this.getMyself().team === entity.team ? "green" : "red"
  350. this.ctx.moveTo(innerWidth / 2, innerHeight - 1)
  351. this.ctx.lineTo(targetX, targetY)
  352. this.ctx.stroke()
  353. this.ctx.restore()
  354. }
  355. }
  356. }
  357. }
  358. }
  359.  
  360. drawFPS() {
  361. if (!this.settings.fpsCounter) {
  362. if (this.fpsCounter.innerHTML.length > 0) {
  363. this.fpsCounter.innerHTML = '';
  364. }
  365. return;
  366. }
  367. const now = performance.now()
  368. for (; this.fpsTimes.length > 0 && this.fpsTimes[0] <= now - 1e3;) this.fpsTimes.shift()
  369. this.fpsTimes.push(now)
  370. this.fps = this.fpsTimes.length
  371. this.fpsCounter.innerHTML = `FPS: ${this.fps}`
  372. this.fpsCounter.style.color = this.fps > 50 ? 'green' : (this.fps < 30 ? 'red' : 'orange')
  373. }
  374.  
  375. bhop() {
  376. if (this.settings.bhop === 0) return
  377. if ((this.settings.bhop === 1 && this.camera.keys && this.camera.moveDir !== null) || (this.settings.bhop === 2 && this.settings.bhopHeld)) this.camera.keys[this.camera.jumpKey] = !this.camera.keys[this.camera.jumpKey]
  378. }
  379.  
  380. noRecoil() {
  381. if (!this.settings.noRecoil) return;
  382. this.inputs[3] = ((this.camera.pitchObject.rotation.x - this.me.recoilAnimY * this.hooks.config.recoilMlt) % Math.PI2).round(3);
  383. this.me.recoilAnimYOld = this.me.recoilAnimY;
  384. this.me.recoilAnimY = 0;
  385. }
  386.  
  387. autoRespawn() {
  388. if (!this.settings.autoRespawn) return
  389. if (this.me && this.me.y == undefined && !document.pointerLockElement) this.camera.toggle(true)
  390. }
  391.  
  392. initAimbot() {
  393. let self = this
  394. this.initialized = true
  395. this.changeSettings()
  396. this.camera.camLookAt = function(x, y, z) {
  397. if (!x) return void(this.aimTarget = null)
  398. const a = self.getXDir(this.object.position.x, this.object.position.y, this.object.position.z, x, y, z)
  399. const h = self.getDirection(this.object.position.z, this.object.position.x, z, x)
  400. this.aimTarget = {
  401. xD: a,
  402. yD: h,
  403. x: x + self.hooks.config.camChaseDst * Math.sin(h) * Math.cos(a),
  404. y: y - self.hooks.config.camChaseDst * Math.sin(a),
  405. z: z + self.hooks.config.camChaseDst * Math.cos(h) * Math.cos(a)
  406. }
  407. }
  408. this.camera.updateOld = this.camera.update
  409. this.camera.update = function() {
  410. if (!this.target && this.aimTarget) {
  411. if (self.settings.autoAim > 0) {
  412. this.object.rotation.y = this.aimTarget.yD
  413. this.pitchObject.rotation.x = this.aimTarget.xD
  414. }
  415. const c = Math.PI / 2
  416. this.pitchObject.rotation.x = Math.max(-c, Math.min(c, this.pitchObject.rotation.x))
  417. this.yDr = (this.pitchObject.rotation.x % Math.PI2).round(3)
  418. this.xDr = (this.object.rotation.y % Math.PI2).round(3)
  419. }
  420. let ret = this.updateOld(...arguments)
  421. return ret
  422. }
  423. this.camera.resetOld = this.camera.reset
  424. this.camera.reset = function() {
  425. this.aimTarget = null
  426. let ret = this.resetOld(...arguments)
  427. return ret
  428. }
  429. }
  430.  
  431. updateAimbot() {
  432. if (!this.settings.autoAim > 0) {
  433. return
  434. }
  435. if (!this.initialized) this.initAimbot()
  436. const target = this.getTarget()
  437. if (target) {
  438.  
  439. if (this.settings.autoAim === 1) {
  440. if (this.camera.mouseDownR !== 1) {
  441. this.camera.mouseDownR = 1
  442. } else {
  443. this.camera.mouseDownL = this.camera.mouseDownL === 1 ? 0 : 1
  444. }
  445. }
  446. } else {
  447. this.camera.camLookAt(null)
  448. if (this.settings.autoAim === 1) {
  449. this.camera.mouseDownL = 0
  450. if (this.camera.mouseDownR !== 0) {
  451. this.camera.mouseDownR = 0
  452. }
  453. } else if (this.settings.autoAim === 2) {
  454. this.camera.mouseDownR = 0
  455. this.camera.mouseDownL = 0
  456. }
  457. }
  458. }
  459.  
  460. changeSettings() {
  461. if (this.settings.aimSettings) {
  462. this.hooks.config.camChaseTrn = 0.05
  463. this.hooks.config.camChaseSpd = 15000000
  464. this.hooks.config.camChaseSen = 15000000
  465. this.hooks.config.camChaseDst = 0
  466. } else {
  467. this.hooks.config.camChaseTrn = .0022
  468. this.hooks.config.camChaseSpd = .0012
  469. this.hooks.config.camChaseSen = .2
  470. this.hooks.config.camChaseDst = 24
  471. }
  472. }
  473.  
  474. render() {
  475. this.ctx.clearRect(0, 0, innerWidth, innerHeight)
  476. this.drawESP()
  477. this.drawFPS()
  478. this.autoRespawn()
  479. requestAnimationFrame(this.render.bind(this))
  480. }
  481.  
  482. loop(camera, me, inputs, game, socket = null, u = null) {
  483. this.me = me
  484. this.camera = camera
  485. this.game = game
  486. this.inputs = inputs
  487. this.bhop()
  488. this.updateAimbot()
  489. this.noRecoil()
  490. }
  491.  
  492. setSetting(t, e) {
  493. document.getElementById(`slid_hack${t}`) && (document.getElementById(`slid_hack${t}`).innerHTML = e),
  494. this.settingsMenu[t].set(e),
  495. this.settingsMenu[t].val = e,
  496. this.saveVal(`kro_set_hack_${t}`, e)
  497. }
  498.  
  499. saveVal(t, e) {
  500. const r = "undefined" != typeof Storage;
  501. r && localStorage.setItem(t, e)
  502. }
  503.  
  504. getSavedVal(t) {
  505. const r = "undefined" != typeof Storage;
  506. return r ? localStorage.getItem(t) : null
  507. }
  508.  
  509. onLoad() {
  510. window.playerInfos.style.width = "0%"
  511. this.createCanvas()
  512. this.createFPSCounter()
  513. this.createMenu()
  514. }
  515. }
  516.  
  517. GM_xmlhttpRequest({
  518. method: "GET",
  519. url: "https://krunker.io/js/game.js",
  520. onload: res => {
  521. let code = res.responseText
  522. code = code.replace(/String\.prototype\.escape=function\(\){(.*)\)},(Number\.)/, "$2")
  523. .replace(/if\(\w+\.notObst\){/, "if(true){")
  524. .replace(/}else \w+\.style\.display="none"/, "}")
  525. .replace(/(\bthis\.list\b)/g, "window.hack.hooks.entities")
  526. .replace(/\w+\.players\.list/g, "window.hack.hooks.entities")
  527. .replace(/(function\(\w+,(\w+),\w+,\w+,\w+,\w+,\w+\){var \w+,\w+,\w+,\w+;window\.hack\.hooks\.entities=\[\])/, "$1;window.hack.hooks.world=$2")
  528. .replace(/(\w+\.style\.left=)100\*(\w+\.\w+)\+"%",/, '$1$2*innerWidth+"px",window.hack.hooks.entities[i].hookedX=$2*innerWidth,')
  529. .replace(/(\w+\.style\.top=)100\*\(1-(\w+\.\w+)\)\+"%",/, '$1(1-$2)*innerHeight+"px",window.hack.hooks.entities[i].hookedY=(1-$2)*innerHeight,')
  530. .replace(/"mousemove",function\((\w+)\){if\((\w+)\.enabled/, '"mousemove",function($1){window.hack.hooks.context = $2;if($2.enabled')
  531. .replace(/(\w+).processInput\((\w+),(\w+)\),(\w+).moveCam/, 'window.hack.loop($4, $1, $2, $3), $1.processInput($2,$3),$4.moveCam')
  532. .replace(/(\w+).exports\.ambientVal/, 'window.hack.hooks.config = $1.exports, $1.exports.ambientVal')
  533. .replace(/window\.updateWindow=function/, 'windows.push({header: "Hack Settings",html: "", gen: function () {for (var t = "", e = 0; e < window.hack.settingsMenu.length; ++e){window.hack.settingsMenu[e].pre && (t += window.hack.settingsMenu[e].pre) , t += "<div class=\'settName\'>" + window.hack.settingsMenu[e].name + " " + window.hack.settingsMenu[e].html() + "</div>";}return t;}});window.hack.setupSettings();\nwindow.updateWindow=function')
  534. .replace(/window\.addEventListener\("keydown",function\((\w+)\){/, 'window.addEventListener("keydown",function($1){if(document.activeElement!=chatInput){window.hack.keyDown($1)}')
  535. .replace(/window\.addEventListener\("keyup",function\((\w+)\){/, 'window.addEventListener("keyup",function($1){if(document.activeElement!=chatInput){window.hack.keyUp($1)}')
  536. .replace(/hitHolder\.innerHTML=(\w+)}\((\w+)\),(\w+).update\((\w+)\)(.*)"block"==menuHolder\.style\.display/, 'hitHolder.innerHTML=$1}($2),$3.update($4),"block" == menuHolder.style.display');
  537.  
  538.  
  539. GM_xmlhttpRequest({
  540. method: "GET",
  541. url: "https://krunker.io/",
  542. onload: res => {
  543. let html = res.responseText
  544. html = html.replace(' src="js/game.js">', `>${Hack.toString()}\nwindow.hack = new Hack();\n${code.toString()}`)
  545. document.open()
  546. document.write(html)
  547. document.close()
  548. }
  549. })
  550. }
  551. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement