Advertisement
Astyll

Kirka.io Hacks

Jan 12th, 2024 (edited)
1,012
0
Never
4
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.03 KB | None | 0 0
  1.  
  2.  
  3. // ==UserScript==
  4. // @name Aimbot/esp/chams
  5. // @namespace https://discord.gg/ENHYznSPmM
  6. // @version 3.0
  7. // @description Fixed Blue Screen
  8. // @author Jaguar
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain_url=kirka.io
  10. // @grant none
  11. // @run-at document-start
  12. // @require https://cdn.jsdelivr.net/npm/three@0.155.0/build/three.min.js#sha256-ec0a84377f1dce9d55b98f04ac7057376fa5371c33ab1cd907b85ae5f18fab7e
  13. // @require https://cdn.jsdelivr.net/npm/three-mesh-bvh@0.6.3/build/index.umd.cjs#sha256-4781a92a7e9b459164f7f1c4a78f14664ced5d853626640ce3f0aac4d01daf10
  14. // @match https://kirka.io/*
  15. // ==/UserScript==
  16.  
  17.  
  18. var FovSize=40,AimbotKey="Y",ChamsKey="H",MenuKey="O";
  19. function createElement(e,t){const s=document.createElement(t);return e.appendChild(s),s}var Module=class{constructor(e,t,s){this.key=e,this.name=t,this.description=s,this.key=this.key.toUpperCase()}state;onGameEnter(){}onGameExit(){}onTick(){}onKeyDown(e){}onKeyUp(e){}onMouseDown(e){}onMouseUp(e){}};function joinOxfordComma(e){switch(e.length){case 0:return"";case 1:return e[0];case 2:return`${e[0]} and ${e[1]}`;default:return`${e.slice(0,e.length-1).join(", ")}, and ${e[e.length-1]}`}}var ToggleModule=class extends Module{constructor(e,t,s,n,o=0){super(e,t,s),this.modes=n,this.defaultModeIndex=o,this.currentModeIndex=o}currentModeIndex;onKeyDown(e){super.onKeyDown(e),e.key.toUpperCase()===this.key&&(this.currentModeIndex=(this.currentModeIndex+1)%this.modes.length,this.onModeChange())}onModeChange(){}getCurrentMode(){return this.modes[this.currentModeIndex]}isEnabled(){return this.currentModeIndex>0}getMenuItem(){return`[${this.key}] ${this.name}: ${this.getCurrentMode()}`}getDocumentation(){return`**${this.name} (toggle key: ${this.key}, modes: ${joinOxfordComma(this.modes.map(((e,t)=>t===this.defaultModeIndex?`${e} (default)`:e)))})**: ${this.description}`}},MenuModule=class extends ToggleModule{constructor(e,t,s){super(e,"Menu","Displays the status of all features.",["Off","On"],1),this.position=t,this.modules=s}container=void 0;activationKeys=void 0;onGameEnter(){super.onGameEnter(),void 0===this.container&&(this.container=this.state.widgets.createWidget(this.position),this.activationKeys=new Set(this.modules.map((e=>e.key)))),this.isEnabled()&&(this.setVisible(!0),this.updateMenu())}onModeChange(){super.onModeChange(),this.isEnabled()?(this.setVisible(!0),this.updateMenu()):this.setVisible(!1)}onKeyDown(e){super.onKeyDown(e),this.isEnabled()&&this.activationKeys.has(e.key.toUpperCase())&&this.updateMenu()}onKeyUp(e){super.onKeyUp(e),this.isEnabled()&&this.activationKeys.has(e.key.toUpperCase())&&this.updateMenu()}updateMenu(){this.container.innerHTML="",this.appendLine("JaguarWare",18,"white");for(const e of this.modules)this.appendLine(e.getMenuItem(),16,e.isEnabled()?"white":"red")}appendLine(e,t,s){const n=createElement(this.container,"div");n.textContent=e,n.style.fontSize=`${t}px`,n.style.color=s}setVisible(e){this.container.style.display=e?"block":"none"}},WidgetContainer=class{element;constructor(){this.element=createElement(document.body,"div"),this.element.style.zIndex="2147483647",this.setVisible(!1)}setVisible(e){this.element.style.display=e?"block":"none"}createWidget(){const e=createElement(this.element,"div");return e.style.position="absolute",e.style.left="50%",e.style.top="50%",e.style.transform="translate(-50%, -50%)",e.style.zIndex="2147483647",e.style.padding="4px",e.style.borderRadius="10px",e.style.background="linear-gradient(to right, orange, black)",e.style.fontFamily="monospace",e}},Script=class{constructor(e,t,s,n,o,i,a,r,h){this.websiteName=e,this.iconDomain=t,this.requires=s,this.matchPatterns=n,this.changelog=o,this.modules=i,this.state=a;const d=new MenuModule(r,h,i);i.push(d);for(const e of i)e.state=this.state}inGame=!0;init(){this.state.widgets=new WidgetContainer,document.addEventListener("keydown",(e=>{this.onKeyDown(e)})),document.addEventListener("keyup",(e=>{this.onKeyUp(e)})),document.addEventListener("mousedown",(e=>{this.onMouseDown(e)})),document.addEventListener("mouseup",(e=>{this.onMouseUp(e)})),this.setUp()}onGameEnter(){this.inGame=!0,this.state.widgets.setVisible(!0);for(const e of this.modules)e.onGameEnter()}onGameExit(){this.inGame=!0,this.state.widgets.setVisible(!0);for(const e of this.modules)e.onGameEnter()}onTick(){if(this.inGame)for(const e of this.modules)e.isEnabled()&&e.onTick()}onKeyDown(e){if(!this.shouldSkipEvent(e))for(const t of this.modules)t.onKeyDown(e)}onKeyUp(e){if(!this.shouldSkipEvent(e))for(const t of this.modules)t.onKeyUp(e)}onMouseDown(e){if(!this.shouldSkipEvent(e))for(const t of this.modules)t.onMouseDown(e)}onMouseUp(e){if(!this.shouldSkipEvent(e))for(const t of this.modules)t.onMouseUp(e)}shouldSkipEvent(e){if(!this.inGame)return!0;const t=e.target.tagName;return"INPUT"===t||"TEXTAREA"===t||"A"===t||"BUTTON"===t}};function hookApply(e,t,s){e[t]=new Proxy(e[t],{apply(e,t,n){const o=s(...n);return void 0!==o?o:Reflect.apply(e,t,n)}})}var State=class{widgets},KirkaState=class extends State{THREE;MeshBVHLib;game;scene;camera;me;players;entityManager;getOtherPlayers(){return this.scene.children.filter((e=>"Group"===e.type))}getOpponents(){const e=this.getOtherPlayers();return void 0===this.me.team?e:e.filter((e=>e.entity.colyseusObject.team!==this.me.team))}getComponent(e){return this.entityManager._entities.filter((t=>t._components[e])).map((t=>t._components[e]))[0]}},AimbotModule=class extends ToggleModule{holdingRMB=!1;smoothingFactor=1;constructor(){super(AimbotKey,"Aimbot","Aimbot User Issue",["Off","On"])}onMouseDown(e){super.onMouseDown(e),2===e.button&&(this.holdingRMB=!0)}onMouseUp(e){super.onMouseUp(e),2===e.button&&(this.holdingRMB=!1)}onTick(){if(super.onTick(),"On"===this.getCurrentMode()&&!this.holdingRMB)return;const{Vector3:e}=this.state.THREE,t=this.state.me.pos,s=new e(t.x,t.y,t.z).add(this.state.camera.position),n=this.state.getOpponents().filter((e=>e.entity.colyseusObject.isAlive)).map((t=>(new e).copy(t.position).add(t.children[1].position))).sort(((e,t)=>s.distanceToSquared(e)-s.distanceToSquared(t))),o=new e;for(const t of n){if(!this.isInFOV(s,t,FovSize))continue;if(!this.isVisible(s,t))continue;(new e).subVectors(s,t).normalize();const n=this.state.getComponent(44);o.lerp(t,this.smoothingFactor);const i=(new e).subVectors(s,o).normalize();n.x=Math.asin(-i.y),n.y=Math.atan2(i.x,i.z),n.deltaX=0,n.deltaY=0;break}}isInFOV(e,t,s){const{Vector3:n}=this.state.THREE,o=new n(0,0,-1);o.applyQuaternion(this.state.camera.quaternion),o.normalize();const i=(new n).subVectors(t,e);i.normalize();const a=o.dot(i);return 180*Math.acos(a)/Math.PI<=s/2}isVisible(e,t){const{Raycaster:s,Vector3:n}=this.state.THREE,{MeshBVH:o,acceleratedRaycast:i}=this.state.MeshBVHLib;n.prototype.mWwnNTo=n.prototype.distanceTo;const a=new s(e,(new n).subVectors(t,e).normalize(),0,(new n).subVectors(t,e).length());a.firstHitOnly=!0;const r=this.state.scene.children.filter((e=>"Mesh"===e.type));for(const e of r){null===e.geometry.boundingBox&&e.geometry.computeBoundingBox(),void 0===e.geometry.boundsTree&&(e.geometry.boundsTree=new o(e.geometry)),e.matrixWorld=e.wnNWMm;const t=Object.getPrototypeOf(e),s=t.raycast;t.raycast=i;const n=a.intersectObject(e,!1).length;if(e.matrixWorld=void 0,t.raycast=s,n>0)return!1}return!0}};class WallhackModule extends ToggleModule{constructor(){super(ChamsKey,"Chams","Wall Hacks",["Off","On"])}onModeChange(){if(super.onModeChange(),this.isEnabled())this.update();else for(const e of this.state.getOtherPlayers())this.setVisible(e,!1)}onTick(){super.onTick(),this.update()}update(){const e=this.state.getOtherPlayers();let t;t="Chams"===this.getCurrentMode()?new Set(e.map((e=>e.entity.id))):new Set(this.state.getOpponents().map((e=>e.entity.id)));for(const s of e)this.setVisible(s,t.has(s.entity.id))}setVisible(e,t){const s=e.children[0].children[0].children[1].material;s.color.setRGB(0,255,255),s.fog=!t,s.alphaTest=t?.99:1,s.depthTest=!t}}var KirkaScript=class extends Script{constructor(){super("Kirka.io","kirka.io",["https://cdn.jsdelivr.net/npm/three@0.155.0/build/three.min.js#sha256-ec0a84377f1dce9d55b98f04ac7057376fa5371c33ab1cd907b85ae5f18fab7e","https://cdn.jsdelivr.net/npm/three-mesh-bvh@0.6.3/build/index.umd.cjs#sha256-4781a92a7e9b459164f7f1c4a78f14664ced5d853626640ce3f0aac4d01daf10"],["https://kirka.io/*"],[{date:"TODO",changes:["Initial public release."]}],[new AimbotModule,new WallhackModule],new KirkaState,MenuKey,{right:"0",bottom:"50%"})}setUp(){this.state.THREE=window.THREE,delete window.THREE,this.state.MeshBVHLib=window.MeshBVHLib,delete window.MeshBVHLib,hookApply(WeakMap.prototype,"set",(e=>{"Scene"===e.type&&e.children.length>1&&(this.state.scene=e)})),hookApply(window,"requestAnimationFrame",(()=>{this.onTick()})),this.state.players={},hookApply(Object,"defineProperty",((e,t)=>{"fov"===t&&e.wnWmN?this.state.me=e.wnWmN:"isAlive"===t?this.state.players[e.name]=e:"filmGauge"===t&&e.position.y>0?this.state.camera=e:"client"===t?this.state.game=e:"_entityManager"===t&&(this.state.entityManager=e._entityManager)}));let e=!1;setInterval((()=>{const t=null!==document.querySelector(".game-interface");t!==e&&(this.onGameEnter(),e=t)}),100)}},script=new KirkaScript;script.init();
  20.  
  21. (function() {
  22. let wallhackEnabled = false
  23.  
  24. const KEYS = {
  25. CHAT_VISIBILITY_TOGGLE: 'V',
  26. WALLHACK_TOGGLE: 'F'
  27. }
  28.  
  29. // Nerd Stuff
  30.  
  31. let players = []
  32. let other = []
  33.  
  34. // No Logs
  35.  
  36. ;(function() {
  37. console._log = console.log
  38.  
  39. let props = ['log', 'info', 'warn', 'error']
  40.  
  41. props.forEach(e => {
  42. let prop = props[e]
  43.  
  44. window.console[prop] = _
  45. })
  46. })()
  47.  
  48. // Styling
  49.  
  50. let css = `
  51. .notification {
  52. position: absolute;
  53. background: var(--secondary-5);
  54. border: 4px solid rgb(62, 77, 124);
  55. border-bottom: 4px solid var(--secondary-6);
  56. border-top: 4px solid rgb(77, 92, 139);
  57. width: 250px;
  58. height: 100px;
  59. right: 15px;
  60. bottom: 15px;
  61. z-index: 100;
  62. color: rgb(255, 255, 255);
  63. transition: .3s;
  64. opacity: 0.85;
  65. pointer-events: none;
  66. }
  67.  
  68. .notification-title {
  69. font-size: x-large;
  70. text-align: center;
  71. margin: 2px;
  72. }
  73.  
  74. .notification-body {
  75. margin: 3px;
  76. font-size: medium;
  77. }
  78.  
  79. .highlight-disabled::after {
  80. content: 'disabled';
  81. color: rgb(210, 50, 50);
  82. }
  83.  
  84. .highlight-enabled::after {
  85. content: 'enabled';
  86. color: rgb(50, 210, 50);
  87. }
  88.  
  89. .bloody-screen {
  90. pointer-events: none !important;
  91. width: 100vw;
  92. height: 100vh;
  93. position: absolute;
  94. left: 0;
  95. top: 0;
  96. box-shadow: rgba(255, 0, 0, .8) 0 0 150px inset;
  97. transition: .3s opacity;
  98. }`
  99.  
  100. // Visibility Change
  101.  
  102. let visibility = (function() {
  103. function visible(el) {
  104. el.style.opacity = '1'
  105. el.style.pointerEvents = 'auto'
  106. }
  107.  
  108. function invisible(el) {
  109. el.style.opacity = '0'
  110. el.style.pointerEvents = 'none'
  111. }
  112.  
  113. return {
  114. toggle(el) {
  115. if(el.style.opacity === '0') {
  116. visible(el)
  117. } else {
  118. invisible(el)
  119. }
  120. },
  121. visible,
  122. invisible,
  123. }
  124. })()
  125.  
  126. let wallhack = (function() {
  127. function visible(e) {
  128. e.alphaTest = .99
  129. e.fog = false
  130. e.depthTest = false
  131. }
  132.  
  133. function invisible(e) {
  134. e.alphaTest = 1
  135. e.fog = true
  136. e.depthTest = true
  137. }
  138.  
  139. return {
  140. visible,
  141. invisible,
  142. }
  143. })()
  144.  
  145. // Ad Block
  146.  
  147. let adBlockCss
  148.  
  149. ;(function() {
  150. let ads = ['ad-left', 'ad-right', 'ad-bottom', 'ad-change-weapon']
  151. let adsSelectors = ''
  152.  
  153. ads.forEach(e => {
  154. let adSelector = ''
  155. let prefixes = ['.', '#']
  156.  
  157. prefixes.forEach(r => {
  158. adSelector += r + e + ','
  159. })
  160.  
  161. adsSelectors += adSelector
  162. })
  163.  
  164. adBlockCss = adsSelectors.slice(0, -1) + '{ display: none !important }'
  165.  
  166. window.show_rewarded = _
  167. window.show_preroll = _
  168. })()
  169.  
  170. let keybidings = [
  171. {
  172. // Toggle Chat Visibility
  173. key: KEYS.CHAT_VISIBILITY_TOGGLE,
  174. fn() {
  175. let chat = document.querySelector('.chat')
  176.  
  177. if(chat) {
  178. chat.style.transition = '.3s opacity'
  179. visibility.toggle(chat)
  180. }
  181. }
  182. },
  183.  
  184. // Toggle Wallhack
  185. {
  186. key: KEYS.WALLHACK_TOGGLE,
  187. fn() {
  188. wallhackEnabled = !wallhackEnabled
  189.  
  190. players.forEach(e => {
  191. wallhack[(wallhackEnabled ? '' : 'in') + 'visible'](e)
  192. })
  193.  
  194. notify('Wallhack', 'Wallhack is ', wallhackEnabled)
  195. }
  196. },
  197. ]
  198.  
  199. keybidings.forEach(e => {
  200. window.addEventListener('keydown', r => {
  201. let focused = document.querySelector(':focus') || document.activeElement
  202.  
  203. if(focused.matches('.chat .input')) {
  204. return
  205. }
  206.  
  207. if(r.code === 'Key' + e.key.toUpperCase()) {
  208. r.preventDefault()
  209. e.fn()
  210. }
  211. })
  212. })
  213.  
  214. // Bloody Screen at low HP
  215.  
  216. ;(function() {
  217. let bloodyScreen = document.createElement('div')
  218. bloodyScreen.className = 'bloody-screen'
  219. visibility.invisible(bloodyScreen)
  220. document.body.appendChild(bloodyScreen)
  221.  
  222. let obs = new MutationObserver(() => {
  223. let progress = document.querySelector('.hp-progress')
  224.  
  225.  
  226. if(progress) {
  227. let hp = currentHealth()
  228.  
  229. if(hp < 35 && hp > 0) {
  230. visibility.visible(bloodyScreen)
  231. } else {
  232. visibility.invisible(bloodyScreen)
  233. }
  234. }
  235. })
  236.  
  237. obs.observe(document.body, {
  238. subtree: true,
  239. childList: true,
  240. })
  241.  
  242. function currentHealth() {
  243. return +document.querySelector('.hp-progress').style.width.slice(0, -1)
  244. }
  245. })()
  246.  
  247. // Wallhack (Actual)
  248.  
  249. ;(function() {
  250. Object.defineProperty(Object.prototype, 'material', {
  251. set(value) {
  252. this._material = value
  253.  
  254. if (this._material && this._material.name && this._material.name.indexOf('player') !== -1) {
  255. players.push(value)
  256.  
  257. if(wallhackEnabled) {
  258. wallhack.visible(value)
  259. }
  260. } else {
  261. other.push(value)
  262. }
  263. },
  264.  
  265. get() {
  266. return this._material
  267. }
  268. })
  269. })()
  270.  
  271. // Actual Nerd Stuff
  272.  
  273. let styleNode = document.createElement('style')
  274. styleNode.appendChild(document.createTextNode(css + adBlockCss))
  275. document.querySelector('head').appendChild(styleNode)
  276.  
  277. function notify(title, body, highlight) {
  278. let notifClass = 'notification'
  279. let notif = document.createElement('div')
  280. let notifTitle = document.createElement('h3')
  281. let notifBody = document.createElement('p')
  282.  
  283. notifTitle.className = notifClass + '-title'
  284. notifBody.className = notifClass + '-body'
  285. notif.className = notifClass
  286.  
  287. notifTitle.textContent = title ?? 'Kirka.IO Enchanced'
  288. notifBody.innerHTML = (body ?? '') + (`<span class="highlight-${highlight ? 'enabled' : highlight === false ? 'disabled' : ''}"></span>`)
  289.  
  290. notif.style.right = '100vw'
  291.  
  292. notif.appendChild(notifTitle)
  293. notif.appendChild(notifBody)
  294. document.body.appendChild(notif)
  295.  
  296. setTimeout(() => {
  297. notif.style.right = ''
  298. }, 300)
  299.  
  300. setTimeout(() => {
  301. notif.style.right = '100vw'
  302.  
  303. setTimeout(() => {
  304. notif.remove()
  305. }, 300)
  306. }, 1300)
  307. }
  308.  
  309. // May be useful
  310.  
  311. function getUniqueId() {
  312. return btoa(Math.random() * 1e3).replace(/=/g, '').toLowerCase()
  313. }
  314.  
  315. function getWeapon(query) {
  316. return Array.from(document.querySelectorAll('.gun-name')).find(e => e.textContent.toLowerCase() === query.toLowerCase())
  317. }
  318.  
  319. function _() {}
  320. })()
  321.  
  322. //increase fire rate
  323. ;(original => (Date.now = () => original() * 2123).toString = () => "function now() {\n [native code]\n}")(Date.now);
  324.  
  325. //speed hack
  326. const speed = performance.now;
  327. performance.now = () => Date.now() * 2;
  328.  
  329. Object.defineProperty(Object.prototype, 'material', {
  330. set(val) {
  331. this.material_ = val;
  332. if (this.material_ && this.material_.name && this.material_.name == "player") {
  333. val.alphaTest = 1;
  334. val.depthTest = false;
  335. val.fog = false;
  336. }
  337. }, get() {
  338. return this.material_
  339. }
  340. })
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement