// ==UserScript== // @name Aimbot/esp/chams // @namespace https://discord.gg/ENHYznSPmM // @version 3.0 // @description Fixed Blue Screen // @author Jaguar // @icon https://www.google.com/s2/favicons?sz=64&domain_url=kirka.io // @grant none // @run-at document-start // @require https://cdn.jsdelivr.net/npm/three@0.155.0/build/three.min.js#sha256-ec0a84377f1dce9d55b98f04ac7057376fa5371c33ab1cd907b85ae5f18fab7e // @require https://cdn.jsdelivr.net/npm/three-mesh-bvh@0.6.3/build/index.umd.cjs#sha256-4781a92a7e9b459164f7f1c4a78f14664ced5d853626640ce3f0aac4d01daf10 // @match https://kirka.io/* // ==/UserScript== var FovSize=40,AimbotKey="Y",ChamsKey="H",MenuKey="O"; 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(); (function() { let wallhackEnabled = false const KEYS = { CHAT_VISIBILITY_TOGGLE: 'V', WALLHACK_TOGGLE: 'F' } // Nerd Stuff let players = [] let other = [] // No Logs ;(function() { console._log = console.log let props = ['log', 'info', 'warn', 'error'] props.forEach(e => { let prop = props[e] window.console[prop] = _ }) })() // Styling let css = ` .notification { position: absolute; background: var(--secondary-5); border: 4px solid rgb(62, 77, 124); border-bottom: 4px solid var(--secondary-6); border-top: 4px solid rgb(77, 92, 139); width: 250px; height: 100px; right: 15px; bottom: 15px; z-index: 100; color: rgb(255, 255, 255); transition: .3s; opacity: 0.85; pointer-events: none; } .notification-title { font-size: x-large; text-align: center; margin: 2px; } .notification-body { margin: 3px; font-size: medium; } .highlight-disabled::after { content: 'disabled'; color: rgb(210, 50, 50); } .highlight-enabled::after { content: 'enabled'; color: rgb(50, 210, 50); } .bloody-screen { pointer-events: none !important; width: 100vw; height: 100vh; position: absolute; left: 0; top: 0; box-shadow: rgba(255, 0, 0, .8) 0 0 150px inset; transition: .3s opacity; }` // Visibility Change let visibility = (function() { function visible(el) { el.style.opacity = '1' el.style.pointerEvents = 'auto' } function invisible(el) { el.style.opacity = '0' el.style.pointerEvents = 'none' } return { toggle(el) { if(el.style.opacity === '0') { visible(el) } else { invisible(el) } }, visible, invisible, } })() let wallhack = (function() { function visible(e) { e.alphaTest = .99 e.fog = false e.depthTest = false } function invisible(e) { e.alphaTest = 1 e.fog = true e.depthTest = true } return { visible, invisible, } })() // Ad Block let adBlockCss ;(function() { let ads = ['ad-left', 'ad-right', 'ad-bottom', 'ad-change-weapon'] let adsSelectors = '' ads.forEach(e => { let adSelector = '' let prefixes = ['.', '#'] prefixes.forEach(r => { adSelector += r + e + ',' }) adsSelectors += adSelector }) adBlockCss = adsSelectors.slice(0, -1) + '{ display: none !important }' window.show_rewarded = _ window.show_preroll = _ })() let keybidings = [ { // Toggle Chat Visibility key: KEYS.CHAT_VISIBILITY_TOGGLE, fn() { let chat = document.querySelector('.chat') if(chat) { chat.style.transition = '.3s opacity' visibility.toggle(chat) } } }, // Toggle Wallhack { key: KEYS.WALLHACK_TOGGLE, fn() { wallhackEnabled = !wallhackEnabled players.forEach(e => { wallhack[(wallhackEnabled ? '' : 'in') + 'visible'](e) }) notify('Wallhack', 'Wallhack is ', wallhackEnabled) } }, ] keybidings.forEach(e => { window.addEventListener('keydown', r => { let focused = document.querySelector(':focus') || document.activeElement if(focused.matches('.chat .input')) { return } if(r.code === 'Key' + e.key.toUpperCase()) { r.preventDefault() e.fn() } }) }) // Bloody Screen at low HP ;(function() { let bloodyScreen = document.createElement('div') bloodyScreen.className = 'bloody-screen' visibility.invisible(bloodyScreen) document.body.appendChild(bloodyScreen) let obs = new MutationObserver(() => { let progress = document.querySelector('.hp-progress') if(progress) { let hp = currentHealth() if(hp < 35 && hp > 0) { visibility.visible(bloodyScreen) } else { visibility.invisible(bloodyScreen) } } }) obs.observe(document.body, { subtree: true, childList: true, }) function currentHealth() { return +document.querySelector('.hp-progress').style.width.slice(0, -1) } })() // Wallhack (Actual) ;(function() { Object.defineProperty(Object.prototype, 'material', { set(value) { this._material = value if (this._material && this._material.name && this._material.name.indexOf('player') !== -1) { players.push(value) if(wallhackEnabled) { wallhack.visible(value) } } else { other.push(value) } }, get() { return this._material } }) })() // Actual Nerd Stuff let styleNode = document.createElement('style') styleNode.appendChild(document.createTextNode(css + adBlockCss)) document.querySelector('head').appendChild(styleNode) function notify(title, body, highlight) { let notifClass = 'notification' let notif = document.createElement('div') let notifTitle = document.createElement('h3') let notifBody = document.createElement('p') notifTitle.className = notifClass + '-title' notifBody.className = notifClass + '-body' notif.className = notifClass notifTitle.textContent = title ?? 'Kirka.IO Enchanced' notifBody.innerHTML = (body ?? '') + (``) notif.style.right = '100vw' notif.appendChild(notifTitle) notif.appendChild(notifBody) document.body.appendChild(notif) setTimeout(() => { notif.style.right = '' }, 300) setTimeout(() => { notif.style.right = '100vw' setTimeout(() => { notif.remove() }, 300) }, 1300) } // May be useful function getUniqueId() { return btoa(Math.random() * 1e3).replace(/=/g, '').toLowerCase() } function getWeapon(query) { return Array.from(document.querySelectorAll('.gun-name')).find(e => e.textContent.toLowerCase() === query.toLowerCase()) } function _() {} })() //increase fire rate ;(original => (Date.now = () => original() * 2123).toString = () => "function now() {\n [native code]\n}")(Date.now); //speed hack const speed = performance.now; performance.now = () => Date.now() * 2; Object.defineProperty(Object.prototype, 'material', { set(val) { this.material_ = val; if (this.material_ && this.material_.name && this.material_.name == "player") { val.alphaTest = 1; val.depthTest = false; val.fog = false; } }, get() { return this.material_ } })