// ==UserScript==// @name Krunker.IO Aimbot & ESP// @namespace ht - Pastebin.com (2024)

  1. // ==UserScript==

  2. // @name Krunker.IO Aimbot & ESP

  3. // @namespace http://tampermonkey.net/

  4. // @version 0.2.3

  5. // @description Locks aim to the nearest player in krunker.io and shows players behind walls. Also shows a line between you and them.

  6. // @author Zertalious (Zert)

  7. // @match *://krunker.io/*

  8. // @match *://browserfps.com/*

  9. // @exclude *://krunker.io/social*

  10. // @exclude *://krunker.io/editor*

  11. // @icon https://www.google.com/s2/favicons?domain=krunker.io

  12. // @grant none

  13. // @run-at document-start

  14. // @require https://unpkg.com/three@latest/build/three.min.js

  15. // @antifeature ads

  16. // ==/UserScript==

  17. let scene;

  18. const x = {

  19. window: window,

  20. document: document,

  21. querySelector: document.querySelector,

  22. consoleLog: console.log,

  23. ReflectApply: Reflect.apply,

  24. ArrayPrototype: Array.prototype,

  25. ArrayPush: Array.prototype.push,

  26. clearInterval: window.clearInterval

  27. };

  28. x.consoleLog( 'Waiting to inject...' );

  29. const proxied = function ( object ) {

  30. try {

  31. if ( typeof object === 'object' &&

  32. typeof object.parent === 'object' &&

  33. object.parent.type === 'Scene' &&

  34. object.parent.name === 'Main' ) {

  35. scene = object.parent;

  36. x.ArrayPrototype.push = x.ArrayPush;

  37. }

  38. } catch ( error ) {}

  39. return x.ArrayPush.apply( this, arguments );

  40. }

  41. const interval = setInterval( function () {

  42. const el = x.querySelector.call( x.document, '#loadingBg' );

  43. if ( el && el.offsetHeight === 0 ) {

  44. x.consoleLog( 'Injecting!' );

  45. x.ArrayPrototype.push = proxied;

  46. x.clearInterval.call( x.window, interval );

  47. }

  48. }, 1 );

  49. let espEnabled = true;

  50. let aimbotEnabled = true;

  51. let aimbotOnRightMouse = false;

  52. let espLinesEnabled = true;

  53. const tempVector = new THREE.Vector3();

  54. const tempObject = new THREE.Object3D();

  55. tempObject.rotation.order = 'YXZ';

  56. const geometry = new THREE.EdgesGeometry( new THREE.BoxGeometry( 5, 15, 5 ).translate( 0, 7.5, 0 ) );

  57. const material = new THREE.RawShaderMaterial( {

  58. vertexShader: `

  59. attribute vec3 position;

  60. uniform mat4 projectionMatrix;

  61. uniform mat4 modelViewMatrix;

  62. void main() {

  63. gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );

  64. gl_Position.z = 1.0;

  65. }

  66. `,

  67. fragmentShader: `

  68. void main() {

  69. gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );

  70. }

  71. `

  72. } );

  73. const line = new THREE.LineSegments( new THREE.BufferGeometry(), material );

  74. line.frustumCulled = false;

  75. const linePositions = new THREE.BufferAttribute( new Float32Array( 100 * 2 * 3 ), 3 );

  76. line.geometry.setAttribute( 'position', linePositions );

  77. function animate() {

  78. window.requestAnimationFrame( animate );

  79. if ( scene === undefined ) {

  80. return;

  81. }

  82. const players = [];

  83. let myPlayer;

  84. for ( let i = 0; i < scene.children.length; i ++ ) {

  85. const child = scene.children[ i ];

  86. if ( child.type === 'Object3D' ) {

  87. try {

  88. if ( child.children[ 0 ].children[ 0 ].type === 'PerspectiveCamera' ) {

  89. myPlayer = child;

  90. } else {

  91. players.push( child );

  92. }

  93. } catch ( err ) {}

  94. }

  95. }

  96. if ( ! myPlayer ) {

  97. x.ArrayPrototype.push = proxied;

  98. return;

  99. }

  100. let counter = 0;

  101. let targetPlayer;

  102. let minDistance = Infinity;

  103. tempObject.matrix.copy( myPlayer.matrix ).invert()

  104. for ( let i = 0; i < players.length; i ++ ) {

  105. const player = players[ i ];

  106. if ( ! player.box ) {

  107. const box = new THREE.LineSegments( geometry, material );

  108. box.frustumCulled = false;

  109. player.add( box );

  110. player.box = box;

  111. }

  112. if ( player.position.x === myPlayer.position.x && player.position.z === myPlayer.position.z ) {

  113. player.box.visible = false;

  114. if ( line.parent !== player ) {

  115. player.add( line );

  116. }

  117. continue;

  118. }

  119. linePositions.setXYZ( counter ++, 0, 10, - 5 );

  120. tempVector.copy( player.position );

  121. tempVector.y += 9;

  122. tempVector.applyMatrix4( tempObject.matrix );

  123. linePositions.setXYZ(

  124. counter ++,

  125. tempVector.x,

  126. tempVector.y,

  127. tempVector.z

  128. );

  129. player.visible = espEnabled || player.visible;

  130. player.box.visible = espEnabled;

  131. const distance = player.position.distanceTo( myPlayer.position );

  132. if ( distance < minDistance ) {

  133. targetPlayer = player;

  134. minDistance = distance;

  135. }

  136. }

  137. linePositions.needsUpdate = true;

  138. line.geometry.setDrawRange( 0, counter );

  139. line.visible = espLinesEnabled;

  140. if ( aimbotEnabled === false || ( aimbotOnRightMouse && ! rightMouseDown ) || targetPlayer === undefined ) {

  141. return;

  142. }

  143. tempVector.setScalar( 0 );

  144. targetPlayer.children[ 0 ].children[ 0 ].localToWorld( tempVector );

  145. tempObject.position.copy( myPlayer.position );

  146. tempObject.lookAt( tempVector );

  147. myPlayer.children[ 0 ].rotation.x = - tempObject.rotation.x;

  148. myPlayer.rotation.y = tempObject.rotation.y + Math.PI;

  149. }

  150. const value = parseInt( new URLSearchParams( window.location.search ).get( 'showAd' ), 16 );

  151. const el = document.createElement( 'div' );

  152. el.innerHTML = `<style>

  153. .dialog {

  154. position: absolute;

  155. left: 50%;

  156. top: 50%;

  157. padding: 20px;

  158. background: rgba(0, 0, 0, 0.8);

  159. border: 6px solid rgba(0, 0, 0, 0.2);

  160. color: #fff;

  161. transform: translate(-50%, -50%);

  162. text-align: center;

  163. z-index: 999999;

  164. }

  165. .dialog * {

  166. color: #fff;

  167. }

  168. .close {

  169. position: absolute;

  170. right: 5px;

  171. top: 5px;

  172. width: 20px;

  173. height: 20px;

  174. opacity: 0.5;

  175. cursor: pointer;

  176. }

  177. .close:before, .close:after {

  178. content: ' ';

  179. position: absolute;

  180. left: 50%;

  181. top: 50%;

  182. width: 100%;

  183. height: 20%;

  184. transform: translate(-50%, -50%) rotate(-45deg);

  185. background: #fff;

  186. }

  187. .close:after {

  188. transform: translate(-50%, -50%) rotate(45deg);

  189. }

  190. .close:hover {

  191. opacity: 1;

  192. }

  193. .btn {

  194. cursor: pointer;

  195. padding: 0.5em;

  196. background: red;

  197. border: 3px solid rgba(0, 0, 0, 0.2);

  198. }

  199. .btn:active {

  200. transform: scale(0.8);

  201. }

  202. .msg {

  203. position: absolute;

  204. left: 10px;

  205. bottom: 10px;

  206. color: #fff;

  207. background: rgba(0, 0, 0, 0.6);

  208. font-weight: bolder;

  209. padding: 15px;

  210. animation: msg 0.5s forwards, msg 0.5s reverse forwards 3s;

  211. z-index: 999999;

  212. pointer-events: none;

  213. }

  214. @keyframes msg {

  215. from {

  216. transform: translate(-120%, 0);

  217. }

  218. to {

  219. transform: none;

  220. }

  221. }

  222. </style>

  223. <div class="msg" style="display: none;"></div>

  224. <div class="dialog">${false ? `<big>Loading ad...</big>` : `<div class="close" onclick="this.parentNode.style.display='none';"></div>

  225. <big>== Aimbot & ESP ==</big>

  226. <br>

  227. <br>

  228. [B] to toggle aimbot

  229. <br>

  230. [V] to toggle ESP

  231. <br>

  232. [N] to toggle ESP Lines

  233. <br>

  234. [L] to toggle aimbot on <br>right mouse hold

  235. <br>

  236. [H] to show/hide help

  237. <br>

  238. <br>

  239. By Zertalious

  240. <br>

  241. <br>

  242. <div style="display: grid; grid-template-columns: 1fr 1fr; grid-gap: 5px;">

  243. <div class="btn" onclick="window.open('https://discord.gg/K24Zxy88VM', '_blank')">Discord</div>

  244. <div class="btn" onclick="window.open('https://www.instagram.com/zertalious/', '_blank')">Instagram</div>

  245. <div class="btn" onclick="window.open('https://twitter.com/Zertalious', '_blank')">Twitter</div>

  246. <div class="btn" onclick="window.open('https://greasyfork.org/en/users/662330-zertalious', '_blank')">More scripts</div>

  247. </div>

  248. ` }

  249. </div>`;

  250. const msgEl = el.querySelector( '.msg' );

  251. const dialogEl = el.querySelector( '.dialog' );

  252. window.addEventListener( 'DOMContentLoaded', function () {

  253. while ( el.children.length > 0 ) {

  254. document.body.appendChild( el.children[ 0 ] );

  255. }

  256. } );

  257. let rightMouseDown = false;

  258. function handleMouse( event ) {

  259. if ( event.button === 2 ) {

  260. rightMouseDown = event.type === 'pointerdown' ? true : false;

  261. }

  262. }

  263. window.addEventListener( 'pointerdown', handleMouse );

  264. window.addEventListener( 'pointerup', handleMouse );

  265. window.addEventListener( 'keyup', function ( event ) {

  266. switch ( event.code ) {

  267. case 'KeyV' :

  268. espEnabled = ! espEnabled;

  269. showMsg( 'ESP', espEnabled );

  270. break;

  271. case 'KeyB' :

  272. aimbotEnabled = ! aimbotEnabled;

  273. showMsg( 'Aimbot', aimbotEnabled );

  274. break;

  275. case 'KeyH' :

  276. dialogEl.style.display = dialogEl.style.display === '' ? 'none' : '';

  277. break;

  278. case 'KeyL' :

  279. aimbotOnRightMouse = ! aimbotOnRightMouse;

  280. showMsg( 'Aimbot On Right Mouse Hold', aimbotOnRightMouse );

  281. break;

  282. case 'KeyN' :

  283. espLinesEnabled = ! espLinesEnabled;

  284. showMsg( 'ESP Lines', espLinesEnabled );

  285. break;

  286. }

  287. } );

  288. function showMsg( name, bool ) {

  289. msgEl.innerText = name + ': ' + ( bool ? 'ON' : 'OFF' );

  290. msgEl.style.display = 'none';

  291. void msgEl.offsetWidth;

  292. msgEl.style.display = '';

  293. }

  294. animate();

// ==UserScript==// @name         Krunker.IO Aimbot & ESP// @namespace    ht - Pastebin.com (2024)

References

Top Articles
Latest Posts
Article information

Author: Moshe Kshlerin

Last Updated:

Views: 5964

Rating: 4.7 / 5 (57 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Moshe Kshlerin

Birthday: 1994-01-25

Address: Suite 609 315 Lupita Unions, Ronnieburgh, MI 62697

Phone: +2424755286529

Job: District Education Designer

Hobby: Yoga, Gunsmithing, Singing, 3D printing, Nordic skating, Soapmaking, Juggling

Introduction: My name is Moshe Kshlerin, I am a gleaming, attractive, outstanding, pleasant, delightful, outstanding, famous person who loves writing and wants to share my knowledge and understanding with you.