yolkbot 1.0.13 → 1.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -2
- package/browser/build/global.js +3 -3
- package/browser/build/module.js +1 -3
- package/dist/bot/GamePlayer.js +1 -1
- package/dist/bot.js +1 -1
- package/dist/constants/shellYoutube.js +1 -1
- package/dist/dispatches/BootPlayerDispatch.js +1 -1
- package/dist/dispatches/ChatDispatch.js +1 -1
- package/dist/dispatches/FireDispatch.js +1 -1
- package/dist/dispatches/GameOptionsDispatch.js +1 -1
- package/dist/dispatches/GoToAmmoDispatch.js +1 -1
- package/dist/dispatches/GoToCoopDispatch.js +1 -1
- package/dist/dispatches/GoToGrenadeDispatch.js +1 -1
- package/dist/dispatches/GoToPlayerDispatch.js +1 -1
- package/dist/dispatches/GoToSpatulaDispatch.js +1 -1
- package/dist/dispatches/LookAtDispatch.js +1 -1
- package/dist/dispatches/LookAtPosDispatch.js +1 -1
- package/dist/dispatches/MeleeDispatch.js +1 -1
- package/dist/dispatches/MovementDispatch.js +1 -1
- package/dist/dispatches/PauseDispatch.js +1 -1
- package/dist/dispatches/ReloadDispatch.js +1 -1
- package/dist/dispatches/ReportPlayerDispatch.js +1 -1
- package/dist/dispatches/SaveLoadoutDispatch.js +1 -1
- package/dist/dispatches/SpawnDispatch.js +1 -1
- package/dist/dispatches/SwapWeaponDispatch.js +1 -1
- package/dist/dispatches/SwitchTeamDispatch.js +1 -1
- package/dist/dispatches/ThrowGrenadeDispatch.js +1 -1
- package/dist/types/bot.d.ts +10 -4
- package/dist/types/dispatches/GameOptionsDispatch.d.ts +20 -0
- package/dist/types/dispatches/GoToPlayerDispatch.d.ts +3 -2
- package/dist/types/dispatches/LookAtDispatch.d.ts +2 -4
- package/dist/types/dispatches/MovementDispatch.d.ts +1 -1
- package/dist/types/dispatches/ReportPlayerDispatch.d.ts +2 -3
- package/dist/wasm/imports.js +1 -1
- package/package.json +4 -4
- package/dist/wasm/wasm_loader.wasm +0 -0
package/dist/bot/GamePlayer.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
|
|
3
|
-
import{GunList as e,ShellStreaks as t,SocialMedias as h}from"../constants/index.js";import{Cluck9mm as o}from"../constants/guns.js";class
|
|
3
|
+
import{GunList as e,ShellStreaks as t,SocialMedias as h}from"../constants/index.js";import{Cluck9mm as o}from"../constants/guns.js";class n{constructor(s){this.id=s.id,this.name=s.name,this.uniqueId=s.uniqueId,this.team=s.team,this.playing=s.playing,this.socials=s.social&&JSON.parse(s.social),this.socials&&this.socials.forEach(i=>i.type=h[i.id]),this.isVip=s.upgradeProductId>0,this.showBadge=!s.hideBadge||!1,this.position={x:s.x,y:s.y,z:s.z},this.jumping=!1,this.climbing=!1,this.view={yaw:s.yaw,pitch:s.pitch},this.inKotcZone=!1,this.character={eggColor:s.shellColor,primaryGun:s.primaryWeaponItem,secondaryGun:s.secondaryWeaponItem,stamp:s.stampItem,hat:s.hatItem,grenade:s.grenadeItem,melee:s.meleeItem,stampPos:{x:s.stampPosX,y:s.stampPosY}},this.stats={killsInGame:s.kills,deathsInGame:s.deaths,streak:s.streak,totalKills:s.totalKills,totalDeaths:s.totalDeaths,bestGameStreak:s.bestGameStreak,bestOverallStreak:s.bestOverallStreak},this.activeGun=s.weaponIdx,this.selectedGun=s.charClass,this.weapons=[],this.character.primaryGun&&(this.weapons[0]=new e[this.selectedGun],this.weapons[1]=new o),this.grenades=1,this.streak=s.score,this.streakRewards=Object.values(t).filter(i=>s.activeShellStreaks&i),this.hp=s.hp,this.hpShield=0,this.spawnShield=s.shield,this.randomSeed=0}}var u=n;export{n as GamePlayer,u as default};
|
package/dist/bot.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
|
|
3
|
-
import H from"./api.js";import s from"./comm/CommIn.js";import f from"./comm/CommOut.js";import{CloseCode as z}from"./comm/Codes.js";import{CommCode as c}from"./constants/codes.js";import U from"./bot/GamePlayer.js";import W from"./matchmaker.js";import j from"./socket.js";import{ChiknWinnerDailyLimit as q,CollectTypes as x,CoopStates as y,findItemById as d,FramesBetweenSyncs as w,GameActions as T,GameModes as g,GameOptionFlags as E,GunList as K,ItemTypes as $,Movements as G,PlayTypes as Y,ProxiesEnabled as Z,ShellStreaks as m,StateBufferSize as b}from"./constants/index.js";import R from"./dispatches/LookAtPosDispatch.js";import F from"./dispatches/MovementDispatch.js";import{NodeList as Q}from"./pathing/mapnode.js";import{coords as X}from"./wasm/wrapper.js";import{fetchMap as J,initKotcZones as V}from"./util.js";import{Challenges as tt}from"./constants/challenges.js";import{Maps as P}from"./constants/maps.js";const M=Object.fromEntries(Object.entries(y).map(([I,t])=>[t,I])),A=Object.fromEntries(Object.entries(g).map(([I,t])=>[t,I])),B={CHALLENGES:1,STATS:2,PATHFINDING:3,PING:5,COSMETIC_DATA:6,PLAYER_HEALTH:7,PACKET_HOOK:8,LOG_PACKETS:10,NO_LOGIN:11,DEBUG_BUFFER:12,DEBUG_BEST_TARGET:14},S=(I,t)=>(I%t+t)%t;class et{static Intents=B;Intents=B;#e=[];#t={};#i=[];#n;#o;constructor(t={}){t.proxy&&!Z&&this.processError("proxies do not work and hence are not supported in the browser"),this.intents=t.intents||[],this.intents.includes(this.Intents.COSMETIC_DATA)&&(d(1001)||this.processError("you cannot use the COSMETIC_DATA intent inside of the singlefile browser bundles")),this.instance=t.instance||"shellshock.io",this.protocol=t.protocol||"wss",this.proxy=t.proxy||"",this.httpProxy=t.httpProxy||"",this.state={name:"yolkbot",weaponIdx:0,inGame:!1,reloading:!1,swappingGun:!1,usingMelee:!1,stateIdx:0,serverStateIdx:0,shotsFired:0,buffer:[],left:!1,quit:!1},this.players={},this.me=new U({}),this.game={raw:{},code:"",socket:null,gameModeId:0,gameMode:A[0],mapIdx:0,map:{filename:"",hash:"",name:"",modes:{FFA:!1,Teams:!1,Spatula:!1,King:!1},availability:"both",numPlayers:"18",raw:{},nodes:{},zones:[]},playerLimit:0,isGameOwner:!1,isPrivate:!0,options:{gravity:1,damage:1,healthRegen:1,locked:!1,noTeamChange:!1,noTeamShuffle:!1,weaponsDisabled:Array(7).fill(!1),mustUseSecondary:!1},collectables:[[],[]],teamScore:[0,0,0],spatula:{coords:{x:0,y:0,z:0},controlledBy:0,controlledByTeam:0},stage:y.capturing,zoneNumber:0,activeZone:[],capturing:0,captureProgress:0,numCapturing:0,stageName:"",capturePercent:0},this.#o=this.game,this.account={id:0,firebaseId:"",sessionId:"",session:"",email:"",password:"",cw:{atLimit:!1,limit:0,secondsUntilPlay:0,canPlayAgain:Date.now()},loadout:{hatId:null,meleeId:0,stampId:null,classIdx:0,colorIdx:0,grenadeId:0,primaryId:[3100,3600,3400,3800,4e3,4200,4500],secondaryId:new Array(7).fill(3e3),stampPositionX:0,stampPositionY:0},ownedItemIds:[],vip:!1,accountAge:0,emailVerified:!1,eggBalance:0,rawLoginData:{}},this.#n=this.account,this.matchmaker=null,this.api=new H({instance:this.instance,protocol:this.protocol,proxy:this.proxy,httpProxy:this.httpProxy,maxRetries:t?.apiMaxRetries}),this.ping=0,this.lastPingTime=-1,this.lastDeathTime=-1,this.lastChatTime=-1,this.lastUpdateTick=0,this.controlKeys=0,this.pathing={nodeList:null,followingPath:!1,activePath:null,activeNode:null,activeNodeIdx:0},this.hasQuit=!1}dispatch(t){t.check(this)?t.execute(this):this.#e.push(t)}async createAccount(t,e){this.account.email=t,this.account.password=e;const a=await this.api.createAccount(t,e);return this.#s(a)}async login(t,e){this.account.email=t,this.account.password=e;const a=await this.api.loginWithCredentials(t,e);return this.#s(a)}async loginWithRefreshToken(t){const e=await this.api.loginWithRefreshToken(t);return this.#s(e)}async loginAnonymously(){delete this.account.email,delete this.account.password;const t=await this.api.loginAnonymously();return this.#s(t)}#s(t){return typeof t!="object"?(this.emit("authFail",t),!1):t.banRemaining?(this.emit("banned",t.banRemaining),!1):t.playerOutput?(t=t.playerOutput,this.account.rawLoginData=t,this.account.accountAge=t.accountAge,this.account.eggBalance=t.currentBalance,this.account.emailVerified=t.emailVerified,this.account.firebaseId=t.firebaseId,this.account.id=t.id,this.account.loadout=t.loadout,this.account.ownedItemIds=t.ownedItemIds,this.account.session=t.session,this.account.sessionId=t.sessionId,this.account.vip=t.upgradeProductId&&!t.upgradeIsExpired,this.intents.includes(this.Intents.STATS)&&(this.account.stats={lifetime:t.statsLifetime,monthly:t.statsCurrent}),this.intents.includes(this.Intents.CHALLENGES)&&this.#a(t.challenges),this.emit("authSuccess",this.account),this.account):(this.emit("authFail",t),!1)}#a(t){this.account.challenges=[];for(const e of t){const a=tt.find(i=>i.id===e.challengeId);a&&(delete e.playerId,this.account.challenges.push({raw:{challengeInfo:a,challengeData:e},id:e.challengeId,name:a.loc.title,desc:a.loc.desc,rewardEggs:a.reward,isRerolled:!!e.reset,isClaimed:!!e.claimed,isCompleted:!!e.completed,progressNum:e.progress,goalNum:a.goal}))}}async initMatchmaker(){return!this.account.sessionId&&!this.intents.includes(this.Intents.NO_LOGIN)&&!await this.loginAnonymously()?!1:(this.matchmaker||(this.matchmaker=new W({sessionId:this.account.sessionId,proxy:this.proxy,instance:this.instance,protocol:this.protocol,noLogin:this.intents.includes(this.Intents.NO_LOGIN),api:this.api}),this.matchmaker.on("authFail",t=>this.emit("authFail",t)),this.matchmaker.on("error",t=>this.processError(t)),await this.matchmaker.getRegions()),!0)}async#c(t){return await this.initMatchmaker()?(await this.matchmaker.waitForConnect(),await new Promise(e=>{const a=i=>{i.command==="gameFound"&&(this.matchmaker.off("msg",a),this.game.raw=i,this.game.code=i.id,e()),i.error&&i.error==="gameNotFound"&&(this.processError(`Game ${t} not found (likely expired).`),this.leave())};this.matchmaker.on("msg",a),this.matchmaker.send({command:"joinGame",id:t,observe:!1,sessionId:this.account.sessionId})})):!1}async findPublicGame(t){return this.matchmaker||this.initMatchmaker(),this.matchmaker?await this.matchmaker.findPublicGame(t):!1}async createPrivateGame(t={}){if(!await this.initMatchmaker())return!1;if(!t.region&&!this.matchmaker.regionList&&!this.matchmaker.regionList.length)return this.processError("pass a region to createPrivateGame or call getRegions() for a random one");if(t.region||(t.region=this.matchmaker.getRandomRegion()),!t.mode)return this.processError("pass a mode to createPrivateGame");if(typeof g[t.mode]!="number")return this.processError("invalid mode passed to createPrivateGame, see GameModes for a list");t.map||(t.map=P[P.length*Math.random()|0].name);const e=P.find(n=>n.name.toLowerCase()===t.map.toLowerCase()),a=P.indexOf(e);return a===-1?this.processError("invalid map, see the Maps constant for a list"):(await this.matchmaker.waitForConnect(),await new Promise(n=>{const o=r=>{r.command==="gameFound"&&(this.matchmaker.off("msg",o),n(r))};this.matchmaker.on("msg",o),this.matchmaker.send({command:"findGame",region:t.region,playType:Y.createPrivate,gameType:g[t.mode],sessionId:this.account.sessionId,noobLobby:!1,map:a})}))}async join(t,e){if(this.state.name=t||"yolkbot",typeof e=="string"?(e.includes("#")&&(e=e.split("#")[1]),await this.#c(e)):typeof e=="object"&&(this.account.id===0&&await this.loginAnonymously(),this.game.raw=e,this.game.code=this.game.raw.id),!this.game.raw.id)return this.processError("invalid game data passed to <bot>.join");const a=async()=>{try{const i=this.instance.startsWith("localhost:")?this.instance:`${this.game.raw.subdomain}.${this.instance}`;this.game.socket=new j(`${this.protocol}://${i}/game/${this.game.raw.id}`,this.proxy),this.game.socket.onerror=async n=>(this.processError(n),await new Promise(o=>setTimeout(o,100)),await a())}catch{await new Promise(i=>setTimeout(i,100)),await a()}};await a(),this.game.socket.binaryType="arraybuffer",this.game.socket.onopen=()=>this.game.socket.onerror=null,this.game.socket.onmessage=i=>this.processPacket(i.data),this.game.socket.onclose=i=>{this.state.left?this.state.left=!1:(this.emit("close",i.code),this.leave(-1))}}#r(){if(Object.entries(this.me.position).map(e=>Math.floor(e[1])).join(",")===this.pathing.activePath[this.pathing.activePath.length-1].positionStr)this.pathing.followingPath=!1,this.pathing.activePath=null,this.pathing.activeNode=null,this.pathing.activeNodeIdx=0,this.dispatch(new F(0));else{let e;this.pathing.activeNodeIdx<this.pathing.activePath.length-1?(e=this.pathing.activePath[this.pathing.activeNodeIdx+1].flatCenter(),this.dispatch(new R(e))):(e=this.pathing.activePath[this.pathing.activeNodeIdx].flatCenter(),this.dispatch(new R(e)));for(const a of this.pathing.activePath)if(a.flatRadialDistance(this.me.position)<.1&&a.position.y===Math.floor(this.me.position.y)&&this.pathing.activePath.indexOf(a)>=this.pathing.activeNodeIdx){this.pathing.activeNodeIdx=this.pathing.activePath.indexOf(a)+1,this.pathing.activeNode=this.pathing.activePath[this.pathing.activeNodeIdx];break}this.controlKeys&G.FORWARD||this.dispatch(new F(G.FORWARD))}}update(){if(!this.hasQuit){if(this.pathing.followingPath&&this.intents.includes(this.Intents.PATHFINDING)&&this.#r(),this.#e.length>0)for(let t=0;t<this.#e.length;t++){const e=this.#e[t];e.check(this)&&(e.execute(this),this.#e.splice(t,1))}if(this.me.playing){const t=this.state.stateIdx;if(this.intents.includes(this.Intents.DEBUG_BUFFER)&&(console.log("setting buffer for idx",t),console.log("checking...shotsFired",this.state.shotsFired)),this.state.buffer[t]={controlKeys:this.controlKeys,yaw:this.me.view.yaw,pitch:this.me.view.pitch,shotsFired:this.state.shotsFired},this.state.shotsFired=0,this.lastUpdateTick>=2){this.emit("tick");const e=f.getBuffer();e.packInt8(c.syncMe),e.packInt8(this.state.stateIdx),e.packInt8(this.state.serverStateIdx);const a=S(this.state.stateIdx-w+1,b);for(let i=0;i<w;i++){const n=S(a+i,b);this.intents.includes(this.Intents.DEBUG_BUFFER)&&console.log("going with",this.state.stateIdx,a,n,this.state.buffer[n]),e.packInt8(this.state.buffer[n]?.controlKeys||0),e.packInt8(this.state.buffer[n]?.shotsFired||0);const o=this.state.buffer[n]?.yaw||this.me.view.yaw,r=this.state.buffer[n]?.pitch||this.me.view.pitch,u=X(o,r);e.packString(u),e.packInt8(100)}e.send(this.game.socket),this.state.buffer=[],this.lastUpdateTick=0}else this.lastUpdateTick++;this.state.stateIdx=S(this.state.stateIdx+1,b)}if(this.intents.includes(this.Intents.PLAYER_HEALTH))for(const t of Object.values(this.players)){if(t.playing&&t.hp>0){const e=.1*(this.game.isPrivate?this.game.options.healthRegen:1);t.streakRewards.includes(m.OverHeal)?t.hp=Math.max(100,t.hp-e):t.hp=Math.min(100,t.hp+e)}t.spawnShield>0&&(t.spawnShield-=6)}}}on(t,e){Object.keys(this.#t).includes(t)?this.#t[t].push(e):this.#t[t]=[e]}onAny(t){this.#i.push(t)}off(t,e){e?this.#t[t]=this.#t[t].filter(a=>a!==e):this.#t[t]=[]}emit(t,...e){if(!this.hasQuit){if(this.#t[t])for(const a of this.#t[t])a(...e);for(const a of this.#i)a(t,...e)}}#h(){const t=s.unPackInt8U(),e=s.unPackInt8U(),a=s.unPackString().valueOf(),i=this.players[t];this.emit("chat",i,a,e)}#l(){const t=s.unPackInt8U(),e=this.intents.includes(this.Intents.COSMETIC_DATA),a={id:t,uniqueId:s.unPackString(),name:s.unPackString(),safename:s.unPackString(),charClass:s.unPackInt8U(),team:s.unPackInt8U(),primaryWeaponItem:e?d(s.unPackInt16U()):s.unPackInt16U(),secondaryWeaponItem:e?d(s.unPackInt16U()):s.unPackInt16U(),shellColor:s.unPackInt8U(),hatItem:e?d(s.unPackInt16U()):s.unPackInt16U(),stampItem:e?d(s.unPackInt16U()):s.unPackInt16U(),stampPosX:s.unPackInt8(),stampPosY:s.unPackInt8(),grenadeItem:e?d(s.unPackInt16U()):s.unPackInt16U(),meleeItem:e?d(s.unPackInt16U()):s.unPackInt16U(),x:s.unPackFloat(),y:s.unPackFloat(),z:s.unPackFloat(),$dx:s.unPackFloat(),$dy:s.unPackFloat(),$dz:s.unPackFloat(),yaw:s.unPackRadU(),pitch:s.unPackRad(),score:s.unPackInt32U(),kills:s.unPackInt16U(),deaths:s.unPackInt16U(),streak:s.unPackInt16U(),totalKills:s.unPackInt32U(),totalDeaths:s.unPackInt32U(),bestGameStreak:s.unPackInt16U(),bestOverallStreak:s.unPackInt16U(),shield:s.unPackInt8U(),hp:s.unPackInt8U(),playing:s.unPackInt8U(),weaponIdx:s.unPackInt8U(),$controlKeys:s.unPackInt8U(),upgradeProductId:s.unPackInt8U(),activeShellStreaks:s.unPackInt8U(),social:s.unPackLongString(),hideBadge:s.unPackInt8U()};s.unPackInt8U(),s.unPackInt8U(),s.unPackInt8U(),this.players[a.id]||(this.players[a.id]=new U(a)),this.emit("playerJoin",this.players[a.id]),this.me.id===a.id&&(this.me=this.players[a.id],this.emit("botJoined",this.me))}#m(){const t=s.unPackInt8U(),e=s.unPackInt16U(),a=s.unPackFloat(),i=s.unPackFloat(),n=s.unPackFloat(),o=s.unPackInt8U(),r=s.unPackInt8U(),u=s.unPackInt8U(),p=s.unPackInt8U(),k=s.unPackInt8U(),h=this.players[t];h&&(h.playing=!0,h.randomSeed=e,h.weapons[0]&&h.weapons[0].ammo&&(h.weapons[0].ammo.rounds=o),h.weapons[0]&&h.weapons[0].ammo&&(h.weapons[0].ammo.store=r),h.weapons[1]&&h.weapons[1].ammo&&(h.weapons[1].ammo.rounds=u),h.weapons[1]&&h.weapons[1].ammo&&(h.weapons[1].ammo.store=p),h.grenades=k,h.position={x:a,y:i,z:n},h.spawnShield=120,this.emit("playerRespawn",h))}#u(){const t=s.unPackInt8U(),e=s.unPackFloat(),a=s.unPackFloat(),i=s.unPackFloat(),n=s.unPackInt8U(),o=this.players[t];if(!o||o.id===this.me.id){for(let p=0;p<w;p++)s.unPackInt8U(),s.unPackRadU(),s.unPackRad(),s.unPackInt8U();return}for(let p=0;p<w-1;p++)s.unPackInt8U(),s.unPackRadU(),s.unPackRad(),s.unPackInt8U();s.unPackInt8U();const r=s.unPackRadU();o.view.yaw=r;const u=s.unPackRad();o.view.pitch=u,s.unPackInt8U(),o.position.x!==e&&(o.position.x=e),o.position.z!==i&&(o.position.z=i),(!o.jumping||Math.abs(o.position.y-a)>.5&&o.position.y!==a)&&(o.position.y=a),o.climbing!==n&&(o.climbing=n)}#d(){const t=s.unPackInt8U(),e=this.players[t];e&&(e.playing=!1,this.emit("playerPause",e))}#p(){const t=s.unPackInt8U(),e=s.unPackInt8U(),a=this.players[t];a&&(a.activeGun=e,this.emit("playerSwapWeapon",a,e))}#g(){const t=s.unPackInt8U(),e=s.unPackInt8U();s.unPackInt8U(),s.unPackInt8U(),s.unPackInt8U();const a=this.players[t],i=this.players[e];a&&(a.playing=!1,a.streak=0,a.lastDeathTime=Date.now(),a.hp=100,a.spawnShield=0),i&&i.streak++,this.emit("playerDeath",a,i)}#k(){const t=s.unPackInt8U();for(let i=0;i<6;i++)s.unPackFloat();const e=this.players[t];if(!e)return;const a=e.weapons[e.activeGun];a&&a.ammo&&(a.ammo.rounds--,this.emit("playerFire",e,a))}#f(){const t=s.unPackInt16U(),e=s.unPackInt8U(),a=s.unPackFloat(),i=s.unPackFloat(),n=s.unPackFloat();this.game.collectables[e].push({id:t,x:a,y:i,z:n}),this.emit("spawnItem",e,t,{x:a,y:i,z:n})}#I(){const t=s.unPackInt8U(),e=s.unPackInt8U(),a=s.unPackInt8U(),i=s.unPackInt16U(),n=this.players[t];if(this.game.collectables[e]=this.game.collectables[e].filter(o=>o.id!==i),e===x.AMMO){const o=n.weapons[a];o&&o.ammo&&(o.ammo.store=Math.min(o.ammo.storeMax,o.ammo.store+o.ammo.pickup),this.emit("collectAmmo",n,o))}e===x.GRENADE&&(n.grenades++,n.grenades>3&&(n.grenades=3),this.emit("collectGrenade",n))}#P(){const t=s.unPackInt8U(),e=s.unPackInt8U(),a=this.players[t];if(!a)return;const i=a.hp;a.hp=e,this.emit("playerDamaged",a,i,a.hp)}#y(){const t=s.unPackInt8U();s.unPackFloat(),s.unPackFloat();const e=this.me.hp;this.me.hp=t,this.emit("selfDamaged",e,this.me.hp)}#w(){const t=s.unPackInt8U(),e=this.players[t];s.unPackInt8U();const a=s.unPackInt8U(),i=s.unPackFloat(),n=s.unPackFloat(),o=s.unPackFloat();if(s.unPackInt8U(),s.unPackInt8U(),s.unPackInt8U(),!e)return;this.state.serverStateIdx=a;const r=e.position.x,u=e.position.y,p=e.position.z;e.position.x=i,e.position.y=n,e.position.z=o,(r!==i||u!==n||p!==o)&&this.emit("selfMoved",e,{x:r,y:u,z:p},{x:i,y:n,z:o})}#U(){const t=f.getBuffer();t.packInt8(c.eventModifier),t.send(this.game.socket)}#b(){const t=s.unPackInt8U(),e={...this.players[t]};delete this.players[t.toString()],this.emit("playerLeave",e)}#S(){if(this.game.gameModeId===g.spatula){this.game.teamScore[1]=s.unPackInt16U(),this.game.teamScore[2]=s.unPackInt16U();const t={x:s.unPackFloat(),y:s.unPackFloat(),z:s.unPackFloat()},e=s.unPackInt8U(),a=s.unPackInt8U();this.game.spatula={coords:t,controlledBy:e,controlledByTeam:a},this.emit("gameStateChange",this.game)}else this.game.gameModeId===g.kotc?(this.game.stage=s.unPackInt8U(),this.game.zoneNumber=s.unPackInt8U(),this.game.capturing=s.unPackInt8U(),this.game.captureProgress=s.unPackInt16U(),this.game.numCapturing=s.unPackInt8U(),this.game.teamScore[1]=s.unPackInt8U(),this.game.teamScore[2]=s.unPackInt8U(),this.game.stageName=M[this.game.stage],this.game.capturePercent=this.game.captureProgress/1e3,this.game.activeZone=this.game.map.zones?this.game.map.zones[this.game.zoneNumber-1]:null,this.emit("gameStateChange",this.game)):this.game.gameModeId===g.team&&(this.game.teamScore[1]=s.unPackInt16U(),this.game.teamScore[2]=s.unPackInt16U());this.game.gameModeId!==g.spatula&&delete this.game.spatula,this.game.gameModeId!==g.kotc&&(delete this.game.stage,delete this.game.zoneNumber,delete this.game.capturing,delete this.game.captureProgress,delete this.game.numCapturing,delete this.game.stageName,delete this.game.numCapturing,delete this.game.activeZone),this.game.gameModeId===g.ffa&&delete this.game.teamScore}#v(){const t=s.unPackInt8U(),e=s.unPackInt8U(),a=this.players[t];switch(e){case m.HardBoiled:t===this.me.id&&(this.me.shieldHp=100),a.streakRewards.push(m.HardBoiled);break;case m.EggBreaker:a.streakRewards.push(m.EggBreaker);break;case m.Restock:{a.grenades=3,a.weapons[0]&&a.weapons[0].ammo&&(a.weapons[0].ammo.rounds=a.weapons[0].ammo.capacity,a.weapons[0].ammo.store=a.weapons[0].ammo.storeMax),a.weapons[1]&&a.weapons[1].ammo&&(a.weapons[1].ammo.rounds=a.weapons[1].ammo.capacity,a.weapons[1].ammo.store=a.weapons[1].ammo.storeMax);break}case m.OverHeal:a.hp=Math.min(200,a.hp+100),a.streakRewards.push(m.OverHeal);break;case m.DoubleEggs:a.streakRewards.push(m.DoubleEggs);break;case m.MiniEgg:a.streakRewards.push(m.MiniEgg);break}this.emit("playerBeginStreak",a,e)}#C(){const t=s.unPackInt8U(),e=s.unPackInt8U(),a=this.players[t];[m.EggBreaker,m.OverHeal,m.DoubleEggs,m.MiniEgg].includes(e)&&a.streakRewards.includes(e)&&(a.streakRewards=a.streakRewards.filter(n=>n!==e)),this.emit("playerEndStreak",e,a)}#x(){const t=s.unPackInt8U(),e=s.unPackInt8U();s.unPackFloat(),s.unPackFloat(),this.me.shieldHp=t,this.me.hp=e,this.me.shieldHp<=0?(this.me.streakRewards=this.me.streakRewards.filter(a=>a!==m.HardBoiled),this.emit("selfShieldLost")):this.emit("selfShieldHit",this.me.shieldHp)}#T(){const t={...this.game.options};let e=s.unPackInt8U(),a=s.unPackInt8U(),i=s.unPackInt8U();(e<1||e>4)&&(e=4),(a<0||a>8)&&(a=4),i>16&&(i=4),this.game.options.gravity=e/4,this.game.options.damage=a/4,this.game.options.healthRegen=i/4;const n=s.unPackInt8U();return Object.keys(E).forEach(o=>{const r=n&E[o]?1:0;this.game.options[o]=r}),this.game.options.weaponsDisabled=Array.from({length:7},()=>s.unPackInt8U()===1),this.game.options.mustUseSecondary=this.game.options.weaponsDisabled.every(o=>o),this.emit("gameOptionsChange",t,this.game.options),!1}#E(){const t=s.unPackInt8U();t===T.pause&&(this.emit("gameForcePause"),setTimeout(()=>this.me.playing=!1,3e3)),t===T.reset&&(Object.values(this.players).forEach(e=>e.streak=0),this.game.gameModeId!==g.ffa&&(this.game.teamScore=[0,0,0]),this.game.gameModeId===g.spatula&&(this.game.spatula.controlledBy=0,this.game.spatula.controlledByTeam=0,this.game.spatula.coords={x:0,y:0,z:0}),this.game.gameModeId===g.kotc&&(this.game.stage=y.capturing,this.game.zoneNumber=0,this.game.activeZone=null,this.game.capturing=0,this.game.captureProgress=0,this.game.numCapturing=0,this.game.stageName=M[y.capturing],this.game.capturePercent=0),this.emit("gameReset"))}#G(){if(!this.intents.includes(this.Intents.PING))return;const t=this.ping;this.ping=Date.now()-this.lastPingTime,this.emit("pingUpdate",t,this.ping),setTimeout(()=>{const e=f.getBuffer();e.packInt8(c.ping),e.send(this.game.socket),this.lastPingTime=Date.now()},1e3)}#R(){const t=s.unPackInt8U(),e=s.unPackInt8U(),a=this.players[t];if(!a)return;const i=a.team;a.team=e,a.streak=0,this.emit("playerSwitchTeam",a,i,e)}#F(){const t=s.unPackInt8U(),e=s.unPackInt8U(),a=s.unPackInt16U(),i=s.unPackInt16U(),n=s.unPackInt8U(),o=s.unPackInt16U(),r=s.unPackInt16U(),u=s.unPackInt16U(),p=s.unPackInt16U();s.unPackInt8(),s.unPackInt8();const k=this.intents.includes(this.Intents.COSMETIC_DATA),h=k?d(a):a,O=k?d(i):i,L=k?d(o):o,N=k?d(r):r,D=k?d(u):u,_=k?d(p):p,l=this.players[t];if(l){const v={...l.character},C=l.selectedGun;l.character.eggColor=n,l.character.primaryGun=h,l.character.secondaryGun=O,l.character.stamp=N,l.character.hat=L,l.character.grenade=D,l.character.melee=_,l.selectedGun=e,l.weapons[0]=new K[e],C!==l.selectedGun&&this.emit("playerChangeGun",l,C,l.selectedGun),v!==l.character&&this.emit("playerChangeCharacter",l,v,l.character)}}#M(){const t=s.unPackInt32U(),e=this.account.eggBalance;this.account.eggBalance=t,this.emit("balanceUpdate",t-e,t)}#A(){this.me.playing=!1,this.emit("selfRespawnFail")}#B(){const t=s.unPackInt8U(),e=this.players[t];e&&this.emit("playerMelee",e)}#O(){const t=s.unPackInt8U(),e=this.players[t];if(!e)return;const a=e.weapons[e.activeGun];if(a.ammo){const i=Math.min(Math.min(a.ammo.capacity,a.ammo.reload)-a.ammo.rounds,a.ammo.store);a.ammo.rounds+=i,a.ammo.store-=i}this.emit("playerReload",e,a)}#L(){const t=f.getBuffer();t.packInt8(c.gameOptions),t.packInt8(this.game.options.gravity*4),t.packInt8(this.game.options.damage*4),t.packInt8(this.game.options.healthRegen*4);const e=(this.game.options.locked?1:0)|(this.game.options.noTeamChange?2:0)|(this.game.options.noTeamShuffle?4:0);t.packInt8(e),this.game.options.weaponsDisabled.forEach(a=>{t.packInt8(a?1:0)}),t.send(this.game.socket)}#N(){const t=s.unPackInt8U();let e=s.unPackInt16U();const a=s.unPackFloat(),i=s.unPackFloat(),n=s.unPackFloat(),o=s.unPackInt8U(),r=s.unPackFloat();this.intents.includes(this.Intents.COSMETIC_DATA)&&(e=d(e)),t===$.Grenade?this.emit("grenadeExploded",e,{x:a,y:i,z:n},o,r):this.emit("rocketHit",{x:a,y:i,z:n},o,r)}#D(){const t=s.unPackInt8U(),e=s.unPackFloat(),a=s.unPackFloat(),i=s.unPackFloat(),n=s.unPackFloat(),o=s.unPackFloat(),r=s.unPackFloat(),u=this.players[t];u&&(u.grenades--,this.emit("playerThrowGrenade",u,{x:e,y:a,z:i},{x:n,y:o,z:r}))}#_(){const t=s.unPackInt8U(),e=s.unPackInt8U(),a=this.players[t];if(!a)return;if(!this.intents.includes(this.Intents.CHALLENGES))return this.emit("challengeComplete",a,e);const i=this.account.challenges.find(n=>n.id===e);this.emit("challengeComplete",a,i),a.id===this.me.id&&this.refreshChallenges()}#H(){const t=f.getBuffer();t.packInt8(c.joinGame),t.packString(this.state.name),t.packString(this.game.raw.uuid),t.packInt8(0),t.packInt8(this.state.weaponIdx||this.account?.loadout?.classIdx||0),t.packInt32(this.account.session),t.packString(this.account.firebaseId),t.packString(this.account.sessionId),t.send(this.game.socket)}async#z(){if(this.me.id=s.unPackInt8U(),this.me.team=s.unPackInt8U(),this.game.gameModeId=s.unPackInt8U(),this.game.gameMode=A[this.game.gameModeId],this.game.mapIdx=s.unPackInt8U(),this.game.map=P[this.game.mapIdx],this.intents.includes(this.Intents.PATHFINDING)&&(this.game.map.raw=await J(this.game.map.filename,this.game.map.hash),this.pathing.nodeList=new Q(this.game.map.raw),this.game.gameModeId===g.kotc)){const e=this.game.map.raw.data["DYNAMIC.capture-zone.none"];e?this.game.map.zones=V(e):delete this.game.map.zones}this.game.playerLimit=s.unPackInt8U(),this.game.isGameOwner=s.unPackInt8U()===1,this.game.isPrivate=s.unPackInt8U()===1,s.unPackInt8U(),this.state.inGame=!0,this.lastDeathTime=Date.now();const t=f.getBuffer();if(t.packInt8(c.clientReady),t.send(this.game.socket),this.updateIntervalId=setInterval(()=>this.update(),100/3),this.intents.includes(this.Intents.PING)){this.lastPingTime=Date.now();const e=f.getBuffer();e.packInt8(c.ping),e.send(this.game.socket)}this.emit("gameReady")}processPacket(t){s.init(t),this.intents.includes(this.Intents.PACKET_HOOK)&&this.emit("packet",t);let e=0,a=0,i=!1;for(;s.isMoreDataAvailable()&&!i;){const n=s.unPackInt8U();switch(n){case c.syncThem:this.#u();break;case c.fire:this.#k();break;case c.hitThem:this.#P();break;case c.syncMe:this.#w();break;case c.hitMe:this.#y();break;case c.swapWeapon:this.#p();break;case c.collectItem:this.#I();break;case c.respawn:this.#m();break;case c.die:this.#g();break;case c.pause:this.#d();break;case c.chat:this.#h();break;case c.addPlayer:this.#l();break;case c.removePlayer:this.#b();break;case c.eventModifier:this.#U();break;case c.metaGameState:this.#S();break;case c.beginShellStreak:this.#v();break;case c.endShellStreak:this.#C();break;case c.hitMeHardBoiled:this.#x();break;case c.gameOptions:this.#T();break;case c.ping:this.#G();break;case c.switchTeam:this.#R();break;case c.changeCharacter:this.#F();break;case c.reload:this.#O();break;case c.explode:this.#N();break;case c.throwGrenade:this.#D();break;case c.spawnItem:this.#f();break;case c.melee:this.#B();break;case c.updateBalance:this.#M();break;case c.challengeCompleted:this.#_();break;case c.socketReady:this.#H();break;case c.gameJoined:this.#z();break;case c.gameAction:this.#E();break;case c.requestGameOptions:this.#L();break;case c.respawnDenied:this.#A();break;case c.expireUpgrade:case c.clientReady:break;case c.musicInfo:s.unPackLongString();break;default:console.error(`processPacket: I got but couldn't identify a: ${Object.keys(c).find(o=>c[o]===n)} ${n}`),e&&console.error(`processPacket: It may be a result of the ${e} command (${a}).`),i=!0;break}e=Object.keys(c).find(o=>c[o]===n),a=n,this.intents.includes(this.Intents.LOG_PACKETS)&&console.log(`[LOG_PACKETS] Packet ${e}: ${a}`)}}async checkChiknWinner(){const t=await this.api.queryServices({cmd:"chicknWinnerReady",id:this.account.id,sessionId:this.account.sessionId});return typeof t=="string"?t:(this.account.cw.limit=t.limit,this.account.cw.atLimit=t.limit>=4,this.account.cw.secondsUntilPlay=(this.account.cw.atLimit?t.period:t.span)||0,this.account.cw.canPlayAgain=Date.now()+this.account.cw.secondsUntilPlay*1e3,this.account.cw)}async playChiknWinner(t=!0){if(this.account.cw.atLimit||this.account.cw.limit>q)return"hit_daily_limit";if(this.account.cw.canPlayAgain>Date.now()&&t)return"on_cooldown";const e=await this.api.queryServices({cmd:"incentivizedVideoReward",firebaseId:this.account.firebaseId,id:this.account.id,sessionId:this.account.sessionId,token:null});return typeof e=="string"?e:e.error?e.error==="RATELIMITED"||e.error==="RATELMITED"?(await this.checkChiknWinner(),"on_cooldown"):e.error==="SESSION_EXPIRED"?"session_expired":(console.error("Unknown Chikn Winner response, report this on Github:",e),"unknown_error"):e.reward?(this.account.eggBalance+=e.reward.eggsGiven,e.reward.itemIds.forEach(a=>this.account.ownedItemIds.push(a)),await this.checkChiknWinner(),e.reward):(console.error("Unknown Chikn Winner response, report this on Github:",e),"unknown_error")}async resetChiknWinner(){if(this.account.eggBalance<200)return"not_enough_eggs";if(!this.account.cw.atLimit)return"not_at_limit";const t=await this.api.queryServices({cmd:"chwReset",sessionId:this.account.sessionId});return typeof t=="string"?t:t.result!=="SUCCESS"?(console.error("Unknown Chikn Winner reset response, report this on Github:",t),"unknown_error"):(this.account.eggBalance-=200,await this.checkChiknWinner(),this.account.cw)}canSee(t){return this.intents.includes(this.Intents.PATHFINDING)?this.pathing.nodeList.hasLineOfSight(this.me.position,t.position):this.processError("You must have the PATHFINDING intent to use this method.")}getBestTarget(t=()=>!0){const a=Object.values(this.players).filter(n=>n?.playing).filter(n=>n.hp>0).filter(n=>n.id!==this.me.id).filter(n=>this.me.team===0||n.team!==this.me.team).filter(n=>!!t(n)).map(n=>({player:n,distance:Math.sqrt(Math.pow(n.position.x-this.me.position.x,2)+Math.pow(n.position.y-this.me.position.y,2)+Math.pow(n.position.z-this.me.position.z,2))})).sort((n,o)=>n.distance-o.distance);if(!a.length)return this.intents.includes(this.Intents.DEBUG_BEST_TARGET)&&console.log("no targets found"),null;const i=a.find(n=>this.canSee(n.player));return this.intents.includes(this.Intents.DEBUG_BEST_TARGET)&&(console.log("detected ",a.length,"targets"),console.log("closest target: ",a[0].player.name),console.log("all targets (ordered): ",a.map(n=>n.player.name)),console.log("found LoS player?",!!i),i&&console.log("closest LoS player: ",i.player.name)),i?{player:i.player,inLoS:!0}:{player:a[0].player,inLoS:!1}}async refreshChallenges(){const t=await this.api.queryServices({cmd:"challengeGetDaily",sessionId:this.account.sessionId,playerId:this.account.id});return this.#a(t),this.account.challenges}async rerollChallenge(t){const e=await this.api.queryServices({cmd:"challengeRerollSlot",sessionId:this.account.sessionId,slotId:t});return this.#a(e),this.account.challenges}async claimChallenge(t){const e=await this.api.queryServices({cmd:"challengeClaimReward",sessionId:this.account.sessionId,slotId:t});return this.#a(e.challenges),e.reward>0&&(this.account.eggBalance+=e.reward),{eggReward:e.reward,updatedChallenges:this.account.challenges}}async refreshBalance(){const t=await this.api.queryServices({cmd:"checkBalance",firebaseId:this.account.firebaseId,sessionId:this.account.sessionId});return this.account.eggBalance=t.currentBalance,t.currentBalance}async redeemCode(t){const e=await this.api.queryServices({cmd:"redeem",firebaseId:this.account.firebaseId,sessionId:this.account.sessionId,id:this.account.id,code:t});return e.result==="SUCCESS"?(this.account.eggBalance=e.eggs_given,e.item_ids.forEach(a=>this.account.ownedItemIds.push(a)),{result:e,eggsGiven:e.eggs_given,itemIds:e.item_ids}):e}async claimURLReward(t){const e=await this.api.queryServices({cmd:"urlRewardParams",firebaseId:this.account.firebaseId,sessionId:this.account.sessionId,reward:t});return e.result==="SUCCESS"&&(this.account.eggBalance+=e.eggsGiven,e.itemIds.forEach(a=>this.account.ownedItemIds.push(a))),e}async claimSocialReward(t){const e=await this.api.queryServices({cmd:"reward",firebaseId:this.account.firebaseId,sessionId:this.account.sessionId,rewardTag:t});return e.result==="SUCCESS"&&(this.account.eggBalance+=e.eggsGiven,e.itemIds.forEach(a=>this.account.ownedItemIds.push(a))),e}async buyItem(t){const e=await this.api.queryServices({cmd:"buy",firebaseId:this.account.firebaseId,sessionId:this.account.sessionId,itemId:t,save:!0});return e.result==="SUCCESS"&&(this.account.eggBalance=e.currentBalance,this.account.ownedItemIds.push(e.itemId)),e}processError(t){if(this.#t.error&&this.#t.error.length)this.emit("error",t);else throw t}leave(t=z.mainMenu){this.hasQuit||(t>-1&&(this.game?.socket?.close(t),this.state.left=!0,this.emit("leave",t)),clearInterval(this.updateIntervalId),this.#e=[],this.state.reloading=!1,this.state.swappingGun=!1,this.state.usingMelee=!1,this.state.stateIdx=0,this.state.serverStateIdx=0,this.state.shotsFired=0,this.state.buffer=[],this.players={},this.me=new U({}),this.game=this.#o,this.ping=0,this.lastPingTime=-1,this.lastDeathTime=-1,this.lastChatTime=-1,this.lastUpdateTick=0,this.controlKeys=0,this.pathing={nodeList:null,followingPath:!1,activePath:null,activeNode:null,activeNodeIdx:0})}logout(){this.account=this.#n}quit(t=!1){this.hasQuit||(this.leave(),this.matchmaker&&(this.matchmaker.close(),t||(this.matchmaker=null)),t||(delete this.account,delete this.api,delete this.game,delete this.me,delete this.players,delete this.state),this.hasQuit=!0)}}var It=et;export{et as Bot,It as default};
|
|
3
|
+
import z from"./api.js";import s from"./comm/CommIn.js";import f from"./comm/CommOut.js";import{CloseCode as H}from"./comm/Codes.js";import{CommCode as c}from"./constants/codes.js";import v from"./bot/GamePlayer.js";import W from"./matchmaker.js";import K from"./socket.js";import{ChiknWinnerDailyLimit as j,CollectTypes as G,CoopStates as U,findItemById as d,FramesBetweenSyncs as b,GameActions as M,GameModes as p,GameOptionFlags as F,GunList as Z,ItemTypes as q,Movements as S,PlayTypes as $,ProxiesEnabled as Y,ShellStreaks as u,StateBufferSize as C}from"./constants/index.js";import R from"./dispatches/LookAtPosDispatch.js";import A from"./dispatches/MovementDispatch.js";import{NodeList as J}from"./pathing/mapnode.js";import{coords as Q}from"./wasm/wrapper.js";import{fetchMap as X,initKotcZones as V}from"./util.js";import{Challenges as tt}from"./constants/challenges.js";import{Maps as y}from"./constants/maps.js";const B=Object.fromEntries(Object.entries(U).map(([I,t])=>[t,I])),O=Object.fromEntries(Object.entries(p).map(([I,t])=>[t,I])),L={CHALLENGES:1,STATS:2,PATHFINDING:3,PING:5,COSMETIC_DATA:6,PLAYER_HEALTH:7,PACKET_HOOK:8,LOG_PACKETS:10,NO_LOGIN:11,DEBUG_BUFFER:12,DEBUG_BEST_TARGET:14,KOTC_ZONES:15},x=(I,t)=>(I%t+t)%t;class et{static Intents=L;Intents=L;#e=[];#t={};#i=[];#n;#o;constructor(t={}){t.proxy&&!Y&&this.processError("proxies do not work and hence are not supported in the browser"),this.intents=t.intents||[],this.intents.includes(this.Intents.COSMETIC_DATA)&&(d(1001)||this.processError("you cannot use the COSMETIC_DATA intent inside of the singlefile browser bundles")),this.instance=t.instance||"shellshock.io",this.protocol=t.protocol||"wss",this.proxy=t.proxy||"",this.httpProxy=t.httpProxy||"",this.state={name:"yolkbot",weaponIdx:0,inGame:!1,yaw:0,pitch:0,controlKeys:0,reloading:!1,swappingGun:!1,usingMelee:!1,stateIdx:0,serverStateIdx:0,shotsFired:0,buffer:[],left:!1,quit:!1},this.players={},this.me=new v({}),this.game={raw:{},code:"",socket:null,gameModeId:0,gameMode:O[0],mapIdx:0,map:{filename:"",hash:"",name:"",modes:{FFA:!1,Teams:!1,Spatula:!1,King:!1},availability:"both",numPlayers:"18",raw:{},nodes:{},zones:[]},playerLimit:0,isGameOwner:!1,isPrivate:!0,options:{gravity:1,damage:1,healthRegen:1,locked:!1,noTeamChange:!1,noTeamShuffle:!1,weaponsDisabled:Array(7).fill(!1),mustUseSecondary:!1},collectables:[[],[]],teamScore:[0,0,0],spatula:{coords:{x:0,y:0,z:0},controlledBy:0,controlledByTeam:0},stage:U.capturing,zoneNumber:0,activeZone:[],capturing:0,captureProgress:0,numCapturing:0,stageName:"",capturePercent:0},this.#o=this.game,this.account={id:0,firebaseId:"",sessionId:"",session:"",email:"",password:"",cw:{atLimit:!1,limit:0,secondsUntilPlay:0,canPlayAgain:Date.now()},loadout:{hatId:null,meleeId:0,stampId:null,classIdx:0,colorIdx:0,grenadeId:0,primaryId:[3100,3600,3400,3800,4e3,4200,4500],secondaryId:new Array(7).fill(3e3),stampPositionX:0,stampPositionY:0},ownedItemIds:[],vip:!1,accountAge:0,emailVerified:!1,eggBalance:0,rawLoginData:{}},this.#n=this.account,this.matchmaker=null,this.api=new z({instance:this.instance,protocol:this.protocol,proxy:this.proxy,httpProxy:this.httpProxy,maxRetries:t?.apiMaxRetries}),this.ping=0,this.lastPingTime=-1,this.lastDeathTime=-1,this.lastChatTime=-1,this.lastUpdateTick=0,this.pathing={nodeList:null,followingPath:!1,activePath:null,activeNode:null,activeNodeIdx:0},this.hasQuit=!1}dispatch(t){return t.validate(this)?(t.check(this)?t.execute(this):this.#e.push(t),!0):!1}async createAccount(t,e){this.account.email=t,this.account.password=e;const a=await this.api.createAccount(t,e);return this.#s(a)}async login(t,e){this.account.email=t,this.account.password=e;const a=await this.api.loginWithCredentials(t,e);return this.#s(a)}async loginWithRefreshToken(t){const e=await this.api.loginWithRefreshToken(t);return this.#s(e)}async loginAnonymously(){delete this.account.email,delete this.account.password;const t=await this.api.loginAnonymously();return this.#s(t)}#s(t){return typeof t!="object"?(this.emit("authFail",t),!1):t.banRemaining?(this.emit("banned",t.banRemaining),!1):t.playerOutput?(t=t.playerOutput,this.account.rawLoginData=t,this.account.accountAge=t.accountAge,this.account.eggBalance=t.currentBalance,this.account.emailVerified=t.emailVerified,this.account.firebaseId=t.firebaseId,this.account.id=t.id,this.account.loadout=t.loadout,this.account.ownedItemIds=t.ownedItemIds,this.account.session=t.session,this.account.sessionId=t.sessionId,this.account.vip=t.upgradeProductId&&!t.upgradeIsExpired,this.intents.includes(this.Intents.STATS)&&(this.account.stats={lifetime:t.statsLifetime,monthly:t.statsCurrent}),this.intents.includes(this.Intents.CHALLENGES)&&this.#a(t.challenges),this.emit("authSuccess",this.account),this.account):(this.emit("authFail",t),!1)}#a(t){this.account.challenges=[];for(const e of t){const a=tt.find(i=>i.id===e.challengeId);a&&(delete e.playerId,this.account.challenges.push({raw:{challengeInfo:a,challengeData:e},id:e.challengeId,name:a.loc.title,desc:a.loc.desc,rewardEggs:a.reward,isRerolled:!!e.reset,isClaimed:!!e.claimed,isCompleted:!!e.completed,progressNum:e.progress,goalNum:a.goal}))}}async initMatchmaker(){return!this.account.sessionId&&!this.intents.includes(this.Intents.NO_LOGIN)&&!await this.loginAnonymously()?!1:(this.matchmaker||(this.matchmaker=new W({sessionId:this.account.sessionId,proxy:this.proxy,instance:this.instance,protocol:this.protocol,noLogin:this.intents.includes(this.Intents.NO_LOGIN),api:this.api}),this.matchmaker.on("authFail",t=>this.emit("authFail",t)),this.matchmaker.on("error",t=>this.processError(t)),await this.matchmaker.getRegions()),!0)}async#c(t){return await this.initMatchmaker()?(await this.matchmaker.waitForConnect(),await new Promise(e=>{const a=i=>{i.command==="gameFound"&&(this.matchmaker.off("msg",a),this.game.raw=i,this.game.code=i.id,e()),i.error&&i.error==="gameNotFound"&&(this.processError(`Game ${t} not found (likely expired).`),this.leave())};this.matchmaker.on("msg",a),this.matchmaker.send({command:"joinGame",id:t,observe:!1,sessionId:this.account.sessionId})})):!1}async findPublicGame(t){return this.matchmaker||this.initMatchmaker(),this.matchmaker?await this.matchmaker.findPublicGame(t):!1}async createPrivateGame(t={}){if(!await this.initMatchmaker())return!1;if(!t.region&&!this.matchmaker.regionList&&!this.matchmaker.regionList.length)return this.processError("pass a region to createPrivateGame or call getRegions() for a random one");if(t.region||(t.region=this.matchmaker.getRandomRegion()),!t.mode)return this.processError("pass a mode to createPrivateGame");if(typeof p[t.mode]!="number")return this.processError("invalid mode passed to createPrivateGame, see GameModes for a list");t.map||(t.map=y[y.length*Math.random()|0].name);const e=y.find(o=>o.name.toLowerCase()===t.map.toLowerCase()),a=y.indexOf(e);return a===-1?this.processError("invalid map, see the Maps constant for a list"):(await this.matchmaker.waitForConnect(),await new Promise(o=>{const n=l=>{l.command==="gameFound"&&(this.matchmaker.off("msg",n),o(l))};this.matchmaker.on("msg",n),this.matchmaker.send({command:"findGame",region:t.region,playType:$.createPrivate,gameType:p[t.mode],sessionId:this.account.sessionId,noobLobby:!1,map:a})}))}async join(t,e){if(this.state.name=t||"yolkbot",typeof e=="string"?(e.includes("#")&&(e=e.split("#")[1]),await this.#c(e)):typeof e=="object"&&(this.account.id===0&&await this.loginAnonymously(),this.game.raw=e,this.game.code=this.game.raw.id),!this.game.raw.id)return this.processError("invalid game data passed to <bot>.join");const a=async()=>{try{const i=this.instance.startsWith("localhost:")?this.instance:`${this.game.raw.subdomain}.${this.instance}`;this.game.socket=new K(`${this.protocol}://${i}/game/${this.game.raw.id}`,this.proxy),this.game.socket.onerror=async o=>(this.processError(o),await new Promise(n=>setTimeout(n,100)),await a())}catch{await new Promise(i=>setTimeout(i,100)),await a()}};await a(),this.game.socket.binaryType="arraybuffer",this.game.socket.onopen=()=>this.game.socket.onerror=null,this.game.socket.onmessage=i=>this.processPacket(i.data),this.game.socket.onclose=i=>{this.state.left?this.state.left=!1:(this.emit("close",i.code),this.leave(-1))}}#r(){if(Object.entries(this.me.position).map(e=>Math.floor(e[1])).join(",")===this.pathing.activePath[this.pathing.activePath.length-1].positionStr)this.pathing.followingPath=!1,this.pathing.activePath=null,this.pathing.activeNode=null,this.pathing.activeNodeIdx=0,this.dispatch(new A(0));else{let e;this.pathing.activeNodeIdx<this.pathing.activePath.length-1?(e=this.pathing.activePath[this.pathing.activeNodeIdx+1].flatCenter(),this.dispatch(new R(e))):(e=this.pathing.activePath[this.pathing.activeNodeIdx].flatCenter(),this.dispatch(new R(e)));for(const a of this.pathing.activePath)if(a.flatRadialDistance(this.me.position)<.1&&a.position.y===Math.floor(this.me.position.y)&&this.pathing.activePath.indexOf(a)>=this.pathing.activeNodeIdx){this.pathing.activeNodeIdx=this.pathing.activePath.indexOf(a)+1,this.pathing.activeNode=this.pathing.activePath[this.pathing.activeNodeIdx];break}this.state.controlKeys&S.FORWARD||this.dispatch(new A(S.FORWARD))}}update(){if(!this.hasQuit){if(this.pathing.followingPath&&this.intents.includes(this.Intents.PATHFINDING)&&this.#r(),this.#e.length>0)for(let t=0;t<this.#e.length;t++){const e=this.#e[t];e.check(this)&&(e.execute(this),this.#e.splice(t,1))}if(this.me.playing){const t=this.state.stateIdx;if(this.intents.includes(this.Intents.DEBUG_BUFFER)&&(console.log("setting buffer for idx",t),console.log("checking...shotsFired",this.state.shotsFired)),this.me.jumping=!!(this.state.controlKeys&S.JUMP),this.state.buffer[t]={controlKeys:this.state.controlKeys,yaw:this.state.yaw,pitch:this.state.pitch,shotsFired:this.state.shotsFired},this.state.shotsFired=0,this.lastUpdateTick>=2){this.emit("tick");const e=f.getBuffer();e.packInt8(c.syncMe),e.packInt8(this.state.stateIdx),e.packInt8(this.state.serverStateIdx);const a=x(this.state.stateIdx-b+1,C);for(let i=0;i<b;i++){const o=x(a+i,C);this.intents.includes(this.Intents.DEBUG_BUFFER)&&console.log("going with",this.state.stateIdx,a,o,this.state.buffer[o]),e.packInt8(this.state.buffer[o]?.controlKeys||0),e.packInt8(this.state.buffer[o]?.shotsFired||0);const n=this.state.buffer[o]?.yaw||this.state.yaw,l=this.state.buffer[o]?.pitch||this.state.pitch,r=Q(n,l);e.packString(r),e.packInt8(100)}e.send(this.game.socket),this.state.buffer=[],this.lastUpdateTick=0}else this.lastUpdateTick++;this.state.stateIdx=x(this.state.stateIdx+1,C)}if(this.intents.includes(this.Intents.PLAYER_HEALTH))for(const t of Object.values(this.players)){if(t.playing&&t.hp>0){const e=.1*(this.game.isPrivate?this.game.options.healthRegen:1);t.streakRewards.includes(u.OverHeal)?t.hp=Math.max(100,t.hp-e):t.hp=Math.min(100,t.hp+e)}t.spawnShield>0&&(t.spawnShield-=6)}}}on(t,e){Object.keys(this.#t).includes(t)?this.#t[t].push(e):this.#t[t]=[e]}onAny(t){this.#i.push(t)}off(t,e){e?this.#t[t]=this.#t[t].filter(a=>a!==e):this.#t[t]=[]}emit(t,...e){if(!this.hasQuit){if(this.#t[t])for(const a of this.#t[t])a(...e);for(const a of this.#i)a(t,...e)}}#h(){const t=s.unPackInt8U(),e=s.unPackInt8U(),a=s.unPackString().valueOf(),i=this.players[t];this.emit("chat",i,a,e)}#l(){const t=s.unPackInt8U(),e=this.intents.includes(this.Intents.COSMETIC_DATA),a={id:t,uniqueId:s.unPackString(),name:s.unPackString(),safename:s.unPackString(),charClass:s.unPackInt8U(),team:s.unPackInt8U(),primaryWeaponItem:e?d(s.unPackInt16U()):s.unPackInt16U(),secondaryWeaponItem:e?d(s.unPackInt16U()):s.unPackInt16U(),shellColor:s.unPackInt8U(),hatItem:e?d(s.unPackInt16U()):s.unPackInt16U(),stampItem:e?d(s.unPackInt16U()):s.unPackInt16U(),stampPosX:s.unPackInt8(),stampPosY:s.unPackInt8(),grenadeItem:e?d(s.unPackInt16U()):s.unPackInt16U(),meleeItem:e?d(s.unPackInt16U()):s.unPackInt16U(),x:s.unPackFloat(),y:s.unPackFloat(),z:s.unPackFloat(),$dx:s.unPackFloat(),$dy:s.unPackFloat(),$dz:s.unPackFloat(),yaw:s.unPackRadU(),pitch:s.unPackRad(),score:s.unPackInt32U(),kills:s.unPackInt16U(),deaths:s.unPackInt16U(),streak:s.unPackInt16U(),totalKills:s.unPackInt32U(),totalDeaths:s.unPackInt32U(),bestGameStreak:s.unPackInt16U(),bestOverallStreak:s.unPackInt16U(),shield:s.unPackInt8U(),hp:s.unPackInt8U(),playing:s.unPackInt8U(),weaponIdx:s.unPackInt8U(),$controlKeys:s.unPackInt8U(),upgradeProductId:s.unPackInt8U(),activeShellStreaks:s.unPackInt8U(),social:s.unPackLongString(),hideBadge:s.unPackInt8U()};s.unPackInt8U(),s.unPackInt8U(),s.unPackInt8U(),this.players[a.id]||(this.players[a.id]=new v(a)),this.emit("playerJoin",this.players[a.id]),this.me.id===a.id&&(this.me=this.players[a.id],this.emit("botJoined",this.me))}#m(){const t=s.unPackInt8U(),e=s.unPackInt16U(),a=s.unPackFloat(),i=s.unPackFloat(),o=s.unPackFloat(),n=s.unPackInt8U(),l=s.unPackInt8U(),r=s.unPackInt8U(),g=s.unPackInt8U(),k=s.unPackInt8U(),h=this.players[t];h&&(h.playing=!0,h.randomSeed=e,h.weapons[0]&&h.weapons[0].ammo&&(h.weapons[0].ammo.rounds=n),h.weapons[0]&&h.weapons[0].ammo&&(h.weapons[0].ammo.store=l),h.weapons[1]&&h.weapons[1].ammo&&(h.weapons[1].ammo.rounds=r),h.weapons[1]&&h.weapons[1].ammo&&(h.weapons[1].ammo.store=g),h.grenades=k,h.position={x:a,y:i,z:o},h.spawnShield=120,this.emit("playerRespawn",h))}#u(){const t=s.unPackInt8U(),e=s.unPackFloat(),a=s.unPackFloat(),i=s.unPackFloat(),o=s.unPackInt8U(),n=this.players[t];if(!n||n.id===this.me.id){for(let r=0;r<b;r++)s.unPackInt8U(),s.unPackRadU(),s.unPackRad(),s.unPackInt8U();return}for(let r=0;r<b;r++)s.unPackInt8U()&S.JUMP?n.jumping=!0:n.jumping=!1,n.view.yaw=s.unPackRadU(),n.view.pitch=s.unPackRad(),s.unPackInt8U();const l=n.position.x!==e||n.position.y!==a||n.position.z!==i||n.climbing!==o;if(n.position.x!==e&&(n.position.x=e),n.position.z!==i&&(n.position.z=i),(!n.jumping||Math.abs(n.position.y-a)>.5&&n.position.y!==a)&&(n.position.y=a),n.climbing!==o&&(n.climbing=o),l&&(this.emit("playerMove",n,n.position),this.game.gameModeId===p.kotc)){const r=this.game.activeZone;if(!r){n.inKotcZone&&(n.inKotcZone=!1,this.emit("playerLeaveZone",n,r));return}const g=Math.round(e),k=Math.floor(a),h=Math.round(i),w=r.some(P=>P.x===g&&P.y===k&&P.z===h);n.inKotcZone&&!w?(n.inKotcZone=!1,this.emit("playerLeaveZone",n)):!n.inKotcZone&&w&&(n.inKotcZone=!0,this.emit("playerEnterZone",n))}}#d(){const t=s.unPackInt8U(),e=this.players[t];e&&(e.playing=!1,this.emit("playerPause",e))}#p(){const t=s.unPackInt8U(),e=s.unPackInt8U(),a=this.players[t];a&&(a.activeGun=e,this.emit("playerSwapWeapon",a,e))}#g(){const t=s.unPackInt8U(),e=s.unPackInt8U();s.unPackInt8U(),s.unPackInt8U(),s.unPackInt8U();const a=this.players[t],i=this.players[e];a&&(a.playing=!1,a.streak=0,a.lastDeathTime=Date.now(),a.hp=100,a.spawnShield=0),i&&i.streak++,this.emit("playerDeath",a,i)}#k(){const t=s.unPackInt8U();for(let i=0;i<6;i++)s.unPackFloat();const e=this.players[t];if(!e)return;const a=e.weapons[e.activeGun];a&&a.ammo&&(a.ammo.rounds--,this.emit("playerFire",e,a))}#f(){const t=s.unPackInt16U(),e=s.unPackInt8U(),a=s.unPackFloat(),i=s.unPackFloat(),o=s.unPackFloat();this.game.collectables[e].push({id:t,x:a,y:i,z:o}),this.emit("spawnItem",e,t,{x:a,y:i,z:o})}#I(){const t=s.unPackInt8U(),e=s.unPackInt8U(),a=s.unPackInt8U(),i=s.unPackInt16U(),o=this.players[t];if(this.game.collectables[e]=this.game.collectables[e].filter(n=>n.id!==i),e===G.AMMO){const n=o.weapons[a];n&&n.ammo&&(n.ammo.store=Math.min(n.ammo.storeMax,n.ammo.store+n.ammo.pickup),this.emit("collectAmmo",o,n))}e===G.GRENADE&&(o.grenades++,o.grenades>3&&(o.grenades=3),this.emit("collectGrenade",o))}#P(){const t=s.unPackInt8U(),e=s.unPackInt8U(),a=this.players[t];if(!a)return;const i=a.hp;a.hp=e,this.emit("playerDamaged",a,i,a.hp)}#y(){const t=s.unPackInt8U();s.unPackFloat(),s.unPackFloat();const e=this.me.hp;this.me.hp=t,this.emit("selfDamaged",e,this.me.hp)}#w(){const t=s.unPackInt8U(),e=this.players[t];s.unPackInt8U();const a=s.unPackInt8U(),i=s.unPackFloat(),o=s.unPackFloat(),n=s.unPackFloat();if(this.me.climbing=!!s.unPackInt8U(),s.unPackInt8U(),s.unPackInt8U(),!e)return;this.state.serverStateIdx=a;const l=e.position.x,r=e.position.y,g=e.position.z;e.position.x=i,e.position.y=o,e.position.z=n,(l!==i||r!==o||g!==n)&&this.emit("selfMoved",e,{x:l,y:r,z:g},{x:i,y:o,z:n})}#U(){const t=f.getBuffer();t.packInt8(c.eventModifier),t.send(this.game.socket)}#b(){const t=s.unPackInt8U(),e={...this.players[t]};delete this.players[t.toString()],this.emit("playerLeave",e)}#S(){if(this.game.gameModeId===p.spatula){this.game.teamScore[1]=s.unPackInt16U(),this.game.teamScore[2]=s.unPackInt16U();const t={x:s.unPackFloat(),y:s.unPackFloat(),z:s.unPackFloat()},e=s.unPackInt8U(),a=s.unPackInt8U();this.game.spatula={coords:t,controlledBy:e,controlledByTeam:a},this.emit("gameStateChange",this.game)}else this.game.gameModeId===p.kotc?(this.game.stage=s.unPackInt8U(),this.game.zoneNumber=s.unPackInt8U(),this.game.capturing=s.unPackInt8U(),this.game.captureProgress=s.unPackInt16U(),this.game.numCapturing=s.unPackInt8U(),this.game.teamScore[1]=s.unPackInt8U(),this.game.teamScore[2]=s.unPackInt8U(),this.game.stageName=B[this.game.stage],this.game.capturePercent=this.game.captureProgress/1e3,this.game.activeZone=this.game.map.zones?this.game.map.zones[this.game.zoneNumber-1]:null,this.emit("gameStateChange",this.game)):this.game.gameModeId===p.team&&(this.game.teamScore[1]=s.unPackInt16U(),this.game.teamScore[2]=s.unPackInt16U());this.game.gameModeId!==p.spatula&&delete this.game.spatula,this.game.gameModeId!==p.kotc&&(delete this.game.stage,delete this.game.zoneNumber,delete this.game.capturing,delete this.game.captureProgress,delete this.game.numCapturing,delete this.game.stageName,delete this.game.numCapturing,delete this.game.activeZone),this.game.gameModeId===p.ffa&&delete this.game.teamScore}#v(){const t=s.unPackInt8U(),e=s.unPackInt8U(),a=this.players[t];switch(e){case u.HardBoiled:t===this.me.id&&(this.me.shieldHp=100),a.streakRewards.push(u.HardBoiled);break;case u.EggBreaker:a.streakRewards.push(u.EggBreaker);break;case u.Restock:{a.grenades=3,a.weapons[0]&&a.weapons[0].ammo&&(a.weapons[0].ammo.rounds=a.weapons[0].ammo.capacity,a.weapons[0].ammo.store=a.weapons[0].ammo.storeMax),a.weapons[1]&&a.weapons[1].ammo&&(a.weapons[1].ammo.rounds=a.weapons[1].ammo.capacity,a.weapons[1].ammo.store=a.weapons[1].ammo.storeMax);break}case u.OverHeal:a.hp=Math.min(200,a.hp+100),a.streakRewards.push(u.OverHeal);break;case u.DoubleEggs:a.streakRewards.push(u.DoubleEggs);break;case u.MiniEgg:a.streakRewards.push(u.MiniEgg);break}this.emit("playerBeginStreak",a,e)}#C(){const t=s.unPackInt8U(),e=s.unPackInt8U(),a=this.players[t];[u.EggBreaker,u.OverHeal,u.DoubleEggs,u.MiniEgg].includes(e)&&a.streakRewards.includes(e)&&(a.streakRewards=a.streakRewards.filter(o=>o!==e)),this.emit("playerEndStreak",a,e)}#x(){const t=s.unPackInt8U(),e=s.unPackInt8U();s.unPackFloat(),s.unPackFloat(),this.me.shieldHp=t,this.me.hp=e,this.me.shieldHp<=0?(this.me.streakRewards=this.me.streakRewards.filter(a=>a!==u.HardBoiled),this.emit("selfShieldLost")):this.emit("selfShieldHit",this.me.shieldHp)}#T(){const t={...this.game.options};let e=s.unPackInt8U(),a=s.unPackInt8U(),i=s.unPackInt8U();(e<1||e>4)&&(e=4),(a<0||a>8)&&(a=4),i>16&&(i=4),this.game.options.gravity=e/4,this.game.options.damage=a/4,this.game.options.healthRegen=i/4;const o=s.unPackInt8U();return Object.keys(F).forEach(n=>{const l=o&F[n]?1:0;this.game.options[n]=l}),this.game.options.weaponsDisabled=Array.from({length:7},()=>s.unPackInt8U()===1),this.game.options.mustUseSecondary=this.game.options.weaponsDisabled.every(n=>n),this.emit("gameOptionsChange",t,this.game.options),!1}#E(){const t=s.unPackInt8U();t===M.pause&&(this.emit("gameForcePause"),setTimeout(()=>this.me.playing=!1,3e3)),t===M.reset&&(Object.values(this.players).forEach(e=>e.streak=0),this.game.gameModeId!==p.ffa&&(this.game.teamScore=[0,0,0]),this.game.gameModeId===p.spatula&&(this.game.spatula.controlledBy=0,this.game.spatula.controlledByTeam=0,this.game.spatula.coords={x:0,y:0,z:0}),this.game.gameModeId===p.kotc&&(this.game.stage=U.capturing,this.game.zoneNumber=0,this.game.activeZone=null,this.game.capturing=0,this.game.captureProgress=0,this.game.numCapturing=0,this.game.stageName=B[U.capturing],this.game.capturePercent=0),this.emit("gameReset"))}#G(){if(!this.intents.includes(this.Intents.PING))return;const t=this.ping;this.ping=Date.now()-this.lastPingTime,this.emit("pingUpdate",t,this.ping),setTimeout(()=>{const e=f.getBuffer();e.packInt8(c.ping),e.send(this.game.socket),this.lastPingTime=Date.now()},1e3)}#M(){const t=s.unPackInt8U(),e=s.unPackInt8U(),a=this.players[t];if(!a)return;const i=a.team;a.team=e,a.streak=0,this.emit("playerSwitchTeam",a,i,e)}#F(){const t=s.unPackInt8U(),e=s.unPackInt8U(),a=s.unPackInt16U(),i=s.unPackInt16U(),o=s.unPackInt8U(),n=s.unPackInt16U(),l=s.unPackInt16U(),r=s.unPackInt16U(),g=s.unPackInt16U();s.unPackInt8(),s.unPackInt8();const k=this.intents.includes(this.Intents.COSMETIC_DATA),h=k?d(a):a,w=k?d(i):i,P=k?d(n):n,N=k?d(l):l,D=k?d(r):r,_=k?d(g):g,m=this.players[t];if(m){const T={...m.character},E=m.selectedGun;m.character.eggColor=o,m.character.primaryGun=h,m.character.secondaryGun=w,m.character.stamp=N,m.character.hat=P,m.character.grenade=D,m.character.melee=_,m.selectedGun=e,m.weapons[0]=new Z[e],E!==m.selectedGun&&this.emit("playerChangeGun",m,E,m.selectedGun),T!==m.character&&this.emit("playerChangeCharacter",m,T,m.character)}}#R(){const t=s.unPackInt32U(),e=this.account.eggBalance;this.account.eggBalance=t,this.emit("balanceUpdate",t-e,t)}#A(){this.me.playing=!1,this.emit("selfRespawnFail")}#B(){const t=s.unPackInt8U(),e=this.players[t];e&&this.emit("playerMelee",e)}#O(){const t=s.unPackInt8U(),e=this.players[t];if(!e)return;const a=e.weapons[e.activeGun];if(a.ammo){const i=Math.min(Math.min(a.ammo.capacity,a.ammo.reload)-a.ammo.rounds,a.ammo.store);a.ammo.rounds+=i,a.ammo.store-=i}this.emit("playerReload",e,a)}updateGameOptions(){const t=f.getBuffer();t.packInt8(c.gameOptions),t.packInt8(this.game.options.gravity*4),t.packInt8(this.game.options.damage*4),t.packInt8(this.game.options.healthRegen*4);const e=(this.game.options.locked?1:0)|(this.game.options.noTeamChange?2:0)|(this.game.options.noTeamShuffle?4:0);t.packInt8(e),this.game.options.weaponsDisabled.forEach(a=>{t.packInt8(a?1:0)}),t.send(this.game.socket)}#L(){this.updateGameOptions()}#N(){const t=s.unPackInt8U();let e=s.unPackInt16U();const a=s.unPackFloat(),i=s.unPackFloat(),o=s.unPackFloat(),n=s.unPackInt8U(),l=s.unPackFloat();this.intents.includes(this.Intents.COSMETIC_DATA)&&(e=d(e)),t===q.Grenade?this.emit("grenadeExploded",e,{x:a,y:i,z:o},n,l):this.emit("rocketHit",{x:a,y:i,z:o},n,l)}#D(){const t=s.unPackInt8U(),e=s.unPackFloat(),a=s.unPackFloat(),i=s.unPackFloat(),o=s.unPackFloat(),n=s.unPackFloat(),l=s.unPackFloat(),r=this.players[t];r&&(r.grenades--,this.emit("playerThrowGrenade",r,{x:e,y:a,z:i},{x:o,y:n,z:l}))}#_(){const t=s.unPackInt8U(),e=s.unPackInt8U(),a=this.players[t];if(!a)return;if(!this.intents.includes(this.Intents.CHALLENGES))return this.emit("challengeComplete",a,e);const i=this.account.challenges.find(o=>o.id===e);this.emit("challengeComplete",a,i),a.id===this.me.id&&this.refreshChallenges()}#z(){const t=f.getBuffer();t.packInt8(c.joinGame),t.packString(this.state.name),t.packString(this.game.raw.uuid),t.packInt8(0),t.packInt8(this.state.weaponIdx||this.account?.loadout?.classIdx||0),t.packInt32(this.account.session),t.packString(this.account.firebaseId),t.packString(this.account.sessionId),t.send(this.game.socket)}async#H(){if(this.me.id=s.unPackInt8U(),this.me.team=s.unPackInt8U(),this.game.gameModeId=s.unPackInt8U(),this.game.gameMode=O[this.game.gameModeId],this.game.mapIdx=s.unPackInt8U(),this.game.map=y[this.game.mapIdx],this.intents.includes(this.Intents.KOTC_ZONES)||this.intents.includes(this.Intents.PATHFINDING)){if(this.game.map.raw=await X(this.game.map.filename,this.game.map.hash),this.game.gameModeId===p.kotc){const e=this.game.map.raw.data["DYNAMIC.capture-zone.none"];e?this.game.map.zones=V(e):delete this.game.map.zones}this.intents.includes(this.Intents.PATHFINDING)&&(this.pathing.nodeList=new J(this.game.map.raw))}this.game.playerLimit=s.unPackInt8U(),this.game.isGameOwner=s.unPackInt8U()===1,this.game.isPrivate=s.unPackInt8U()===1,s.unPackInt8U(),this.state.inGame=!0,this.lastDeathTime=Date.now();const t=f.getBuffer();if(t.packInt8(c.clientReady),t.send(this.game.socket),this.updateIntervalId=setInterval(()=>this.update(),100/3),this.intents.includes(this.Intents.PING)){this.lastPingTime=Date.now();const e=f.getBuffer();e.packInt8(c.ping),e.send(this.game.socket)}this.emit("gameReady")}processPacket(t){s.init(t),this.intents.includes(this.Intents.PACKET_HOOK)&&this.emit("packet",t);let e=0,a=0,i=!1;for(;s.isMoreDataAvailable()&&!i;){const o=s.unPackInt8U();switch(o){case c.syncThem:this.#u();break;case c.fire:this.#k();break;case c.hitThem:this.#P();break;case c.syncMe:this.#w();break;case c.hitMe:this.#y();break;case c.swapWeapon:this.#p();break;case c.collectItem:this.#I();break;case c.respawn:this.#m();break;case c.die:this.#g();break;case c.pause:this.#d();break;case c.chat:this.#h();break;case c.addPlayer:this.#l();break;case c.removePlayer:this.#b();break;case c.eventModifier:this.#U();break;case c.metaGameState:this.#S();break;case c.beginShellStreak:this.#v();break;case c.endShellStreak:this.#C();break;case c.hitMeHardBoiled:this.#x();break;case c.gameOptions:this.#T();break;case c.ping:this.#G();break;case c.switchTeam:this.#M();break;case c.changeCharacter:this.#F();break;case c.reload:this.#O();break;case c.explode:this.#N();break;case c.throwGrenade:this.#D();break;case c.spawnItem:this.#f();break;case c.melee:this.#B();break;case c.updateBalance:this.#R();break;case c.challengeCompleted:this.#_();break;case c.socketReady:this.#z();break;case c.gameJoined:this.#H();break;case c.gameAction:this.#E();break;case c.requestGameOptions:this.#L();break;case c.respawnDenied:this.#A();break;case c.expireUpgrade:case c.clientReady:break;case c.musicInfo:s.unPackLongString();break;default:console.error(`processPacket: I got but couldn't identify a: ${Object.keys(c).find(n=>c[n]===o)} ${o}`),e&&console.error(`processPacket: It may be a result of the ${e} command (${a}).`),i=!0;break}e=Object.keys(c).find(n=>c[n]===o),a=o,this.intents.includes(this.Intents.LOG_PACKETS)&&console.log(`[LOG_PACKETS] Packet ${e}: ${a}`)}}async checkChiknWinner(){const t=await this.api.queryServices({cmd:"chicknWinnerReady",id:this.account.id,sessionId:this.account.sessionId});return typeof t=="string"?t:(this.account.cw.limit=t.limit,this.account.cw.atLimit=t.limit>=4,this.account.cw.secondsUntilPlay=(this.account.cw.atLimit?t.period:t.span)||0,this.account.cw.canPlayAgain=Date.now()+this.account.cw.secondsUntilPlay*1e3,this.account.cw)}async playChiknWinner(t=!0){if(this.account.cw.atLimit||this.account.cw.limit>j)return"hit_daily_limit";if(this.account.cw.canPlayAgain>Date.now()&&t)return"on_cooldown";const e=await this.api.queryServices({cmd:"incentivizedVideoReward",firebaseId:this.account.firebaseId,id:this.account.id,sessionId:this.account.sessionId,token:null});return typeof e=="string"?e:e.error?e.error==="RATELIMITED"||e.error==="RATELMITED"?(await this.checkChiknWinner(),"on_cooldown"):e.error==="SESSION_EXPIRED"?"session_expired":(console.error("Unknown Chikn Winner response, report this on Github:",e),"unknown_error"):e.reward?(this.account.eggBalance+=e.reward.eggsGiven,e.reward.itemIds.forEach(a=>this.account.ownedItemIds.push(a)),await this.checkChiknWinner(),e.reward):(console.error("Unknown Chikn Winner response, report this on Github:",e),"unknown_error")}async resetChiknWinner(){if(this.account.eggBalance<200)return"not_enough_eggs";if(!this.account.cw.atLimit)return"not_at_limit";const t=await this.api.queryServices({cmd:"chwReset",sessionId:this.account.sessionId});return typeof t=="string"?t:t.result!=="SUCCESS"?(console.error("Unknown Chikn Winner reset response, report this on Github:",t),"unknown_error"):(this.account.eggBalance-=200,await this.checkChiknWinner(),this.account.cw)}canSee(t){return this.intents.includes(this.Intents.PATHFINDING)?this.pathing.nodeList.hasLineOfSight(this.me.position,t.position):this.processError("You must have the PATHFINDING intent to use this method.")}getBestTarget(t=()=>!0){const a=Object.values(this.players).filter(o=>o?.playing).filter(o=>o.hp>0).filter(o=>o.id!==this.me.id).filter(o=>this.me.team===0||o.team!==this.me.team).filter(o=>!!t(o)).map(o=>({player:o,distance:Math.sqrt(Math.pow(o.position.x-this.me.position.x,2)+Math.pow(o.position.y-this.me.position.y,2)+Math.pow(o.position.z-this.me.position.z,2))})).sort((o,n)=>o.distance-n.distance);if(!a.length)return this.intents.includes(this.Intents.DEBUG_BEST_TARGET)&&console.log("no targets found"),null;const i=a.find(o=>this.canSee(o.player));return this.intents.includes(this.Intents.DEBUG_BEST_TARGET)&&(console.log("detected ",a.length,"targets"),console.log("closest target: ",a[0].player.name),console.log("all targets (ordered): ",a.map(o=>o.player.name)),console.log("found LoS player?",!!i),i&&console.log("closest LoS player: ",i.player.name)),i?{player:i.player,inLoS:!0}:{player:a[0].player,inLoS:!1}}async refreshChallenges(){const t=await this.api.queryServices({cmd:"challengeGetDaily",sessionId:this.account.sessionId,playerId:this.account.id});return this.#a(t),this.account.challenges}async rerollChallenge(t){const e=await this.api.queryServices({cmd:"challengeRerollSlot",sessionId:this.account.sessionId,slotId:t});return this.#a(e),this.account.challenges}async claimChallenge(t){const e=await this.api.queryServices({cmd:"challengeClaimReward",sessionId:this.account.sessionId,slotId:t});return this.#a(e.challenges),e.reward>0&&(this.account.eggBalance+=e.reward),{eggReward:e.reward,updatedChallenges:this.account.challenges}}async refreshBalance(){const t=await this.api.queryServices({cmd:"checkBalance",firebaseId:this.account.firebaseId,sessionId:this.account.sessionId});return this.account.eggBalance=t.currentBalance,t.currentBalance}async redeemCode(t){const e=await this.api.queryServices({cmd:"redeem",firebaseId:this.account.firebaseId,sessionId:this.account.sessionId,id:this.account.id,code:t});return e.result==="SUCCESS"?(this.account.eggBalance=e.eggs_given,e.item_ids.forEach(a=>this.account.ownedItemIds.push(a)),{result:e,eggsGiven:e.eggs_given,itemIds:e.item_ids}):e}async claimURLReward(t){const e=await this.api.queryServices({cmd:"urlRewardParams",firebaseId:this.account.firebaseId,sessionId:this.account.sessionId,reward:t});return e.result==="SUCCESS"&&(this.account.eggBalance+=e.eggsGiven,e.itemIds.forEach(a=>this.account.ownedItemIds.push(a))),e}async claimSocialReward(t){const e=await this.api.queryServices({cmd:"reward",firebaseId:this.account.firebaseId,sessionId:this.account.sessionId,rewardTag:t});return e.result==="SUCCESS"&&(this.account.eggBalance+=e.eggsGiven,e.itemIds.forEach(a=>this.account.ownedItemIds.push(a))),e}async buyItem(t){const e=await this.api.queryServices({cmd:"buy",firebaseId:this.account.firebaseId,sessionId:this.account.sessionId,itemId:t,save:!0});return e.result==="SUCCESS"&&(this.account.eggBalance=e.currentBalance,this.account.ownedItemIds.push(e.itemId)),e}processError(t){if(this.#t.error&&this.#t.error.length)this.emit("error",t);else throw t}leave(t=H.mainMenu){this.hasQuit||(t>-1&&(this.game?.socket?.close(t),this.state.left=!0,this.emit("leave",t)),clearInterval(this.updateIntervalId),this.#e=[],this.state.reloading=!1,this.state.swappingGun=!1,this.state.usingMelee=!1,this.state.stateIdx=0,this.state.serverStateIdx=0,this.state.shotsFired=0,this.state.buffer=[],this.players={},this.me=new v({}),this.game=this.#o,this.ping=0,this.lastPingTime=-1,this.lastDeathTime=-1,this.lastChatTime=-1,this.lastUpdateTick=0,this.pathing={nodeList:null,followingPath:!1,activePath:null,activeNode:null,activeNodeIdx:0})}logout(){this.account=this.#n}quit(t=!1){this.hasQuit||(this.leave(),this.matchmaker&&(this.matchmaker.close(),t||(this.matchmaker=null)),t||(delete this.account,delete this.api,delete this.game,delete this.me,delete this.players,delete this.state),this.hasQuit=!0)}}var It=et;export{et as Bot,It as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
|
|
3
|
-
const t=[{active:!0,link:"https://www.youtube.com/watch?v
|
|
3
|
+
const t=[{active:!0,link:"https://www.youtube.com/watch?v=pFWVehYYD6c",desc:"",imageExt:"",id:"pFWVehYYD6c",author:"Clingzter ",title:"The Ancient Side of Shell Shockers",externalImg:"https://i.ytimg.com/vi/pFWVehYYD6c/hqdefault.jpg"},{active:!0,link:"https://www.youtube.com/watch?v=7j7kSrF2Viw",desc:"",imageExt:"",id:"7j7kSrF2Viw",author:"Fire Dragon",title:"Cracking The Killstreak shotgun\u{1F52B}",externalImg:"https://i.ytimg.com/vi/7j7kSrF2Viw/hqdefault.jpg"},{active:!0,link:"https://www.youtube.com/watch?v=hp7WXq1PjeM",desc:"",imageExt:"",id:"hp7WXq1PjeM",author:"Godric Gryffindor",title:"Top 5 Most Popular Maps",externalImg:"https://i.ytimg.com/vi/hp7WXq1PjeM/hqdefault.jpg"},{active:!0,link:"https://www.youtube.com/watch?v=-Pj2j-PC020",desc:"",imageExt:"",id:"-Pj2j-PC020",author:"Shell League",title:"CRAZY KotC match Highlights",externalImg:"https://i.ytimg.com/vi/-Pj2j-PC020/hqdefault.jpg"},{active:!0,link:"https://www.youtube.com/watch?v=6z9KKTk4kdw",desc:"",imageExt:"",id:"6z9KKTk4kdw",author:"TheKingmanYT",title:"1v1ing THE GOAT KT_VEI",externalImg:"https://i.ytimg.com/vi/6z9KKTk4kdw/hqdefault.jpg"},{active:!0,link:"https://www.youtube.com/watch?v=Jn1cT1PEi0s",desc:"",imageExt:"",id:"Jn1cT1PEi0s",author:"Meep ",title:"10 Kill Streak /w Ancient Guns! | New Update",externalImg:"https://i.ytimg.com/vi/Jn1cT1PEi0s/hqdefault.jpg"},{active:!0,link:"https://www.youtube.com/watch?v=iKx-xz5T_T8",desc:"",imageExt:"",id:"iKx-xz5T_T8",author:"Bubbleaxe",title:"WALKIN | Montage",externalImg:"https://i.ytimg.com/vi/iKx-xz5T_T8/hqdefault.jpg"},{active:!0,link:"https://www.youtube.com/watch?v=I7MEVsuYVkY",desc:"",imageExt:"",id:"I7MEVsuYVkY",author:"Galactic",title:"Smooth Lofi gameplay w/Phoenix Yt",externalImg:"https://i.ytimg.com/vi/I7MEVsuYVkY/hqdefault.jpg"},{active:!0,link:"https://www.youtube.com/watch?v=Xs5OLOpfHcc",desc:"",imageExt:"",id:"Xs5OLOpfHcc",author:"Clingzter ",title:"The Eggstra Value Pack is LOADED!!",externalImg:"https://i.ytimg.com/vi/Xs5OLOpfHcc/hqdefault.jpg"}];export{t as ShellYoutube};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import r from"../comm/CommOut.js";import{CommCode as u}from"../constants/codes.js";class o{constructor(e){this.uniqueId=e}validate(e){return typeof this.uniqueId=="string"&&e.game.isGameOwner&&Object.values(e.players).find(t=>t.uniqueId===this.uniqueId)}check(){return!0}execute(e){const t=r.getBuffer();t.packInt8(u.bootPlayer),t.packString(this.uniqueId),t.send(e.game.socket)}}var a=o;export{o as BootPlayerDispatch,a as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import a from"../comm/CommOut.js";import{CommCode as i}from"../constants/codes.js";class s{constructor(t,e=!1){this.msg=t,this.noLimit=e}validate(){return!(typeof this.msg!="string"||this.msg.length<1||this.msg.length>64)}check(t){return!(!t.state.inGame||t.lastChatTime+3e3>Date.now()&&!this.noLimit||!t.game.isPrivate&&!t.account.emailVerified&&t.account.accountAge<1e3*60*60*12)}execute(t){const e=a.getBuffer();e.packInt8(i.chat),e.packString(this.msg),e.send(t.game.socket),t.lastChatTime=Date.now()}}var c=s;export{s as ChatDispatch,c as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
|
|
3
|
-
class t{constructor(e){this.amount=e||1}check(e){return e.me.playing&&!e.state.reloading&&!e.state.swappingGun&&!e.state.usingMelee&&
|
|
3
|
+
class t{constructor(e){this.amount=e||1}validate(){return this.amount>=1}check(e){return e.me.playing&&!e.state.reloading&&!e.state.swappingGun&&!e.state.usingMelee&&e.me.weapons[e.me.activeGun].ammo.rounds>=this.amount}execute(e){e.state.shotsFired+=this.amount||1}}var s=t;export{t as FireDispatch,s as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const i=Array.from({length:4},(n,e)=>(e+1)*.25),t=Array.from({length:9},(n,e)=>e*.25),h=Array.from({length:17},(n,e)=>e*.25);class o{constructor(e){this.changes=e}#e(e){const a={};return a.gravity=this.changes.gravity||e.game.options.gravity,a.damage=this.changes.damage||e.game.options.damage,a.healthRegen=this.changes.healthRegen||e.game.options.healthRegen,a.locked=this.changes.locked!==void 0?this.changes.locked:e.game.options.locked,a.noTeamChange=this.changes.noTeamChange!==void 0?this.changes.noTeamChange:e.game.options.noTeamChange,a.noTeamShuffle=this.changes.noTeamShuffle!==void 0?this.changes.noTeamShuffle:e.game.options.noTeamShuffle,a.weaponsDisabled=[typeof this.changes.disableEggk<"u"?this.changes.disableEggk:e.game.options.weaponsDisabled[0],typeof this.changes.disableScrambler<"u"?this.changes.disableScrambler:e.game.options.weaponsDisabled[1],typeof this.changes.disableFreeRanger<"u"?this.changes.disableFreeRanger:e.game.options.weaponsDisabled[2],typeof this.changes.disableRPG<"u"?this.changes.disableRPG:e.game.options.weaponsDisabled[3],typeof this.changes.disableWhipper<"u"?this.changes.disableWhipper:e.game.options.weaponsDisabled[4],typeof this.changes.disableCrackshot<"u"?this.changes.disableCrackshot:e.game.options.weaponsDisabled[5],typeof this.changes.disableTriHard<"u"?this.changes.disableTriHard:e.game.options.weaponsDisabled[6]],this.changes.toDisable&&Array.isArray(this.changes.toDisable)&&this.changes.toDisable.forEach(s=>a.weaponsDisabled[s]=!0),this.changes.toEnable&&Array.isArray(this.changes.toEnable)&&this.changes.toEnable.forEach(s=>a.weaponsDisabled[s]=!1),this.changes.rawWeaponsDisabled&&Array.isArray(this.changes.rawWeaponsDisabled)&&this.changes.rawWeaponsDisabled.length===7&&(a.weaponsDisabled=this.changes.rawWeaponsDisabled.map(s=>!!s)),a.mustUseSecondary=a.weaponsDisabled.every(s=>s),a}validate(e){const a=this.#e(e);return!(!i.includes(a.gravity)||!t.includes(a.damage)||!h.includes(a.healthRegen)||typeof a.locked!="boolean"||typeof a.noTeamChange!="boolean"||typeof a.noTeamShuffle!="boolean"||!Array.isArray(a.weaponsDisabled)||a.weaponsDisabled.length!==7||a.weaponsDisabled.some(s=>typeof s!="boolean"))}check(e){return e.game.isGameOwner}execute(e){e.game.options=this.#e(e),e.updateGameOptions()}}var r=o;export{o as GameOptionsDispatch,r as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
|
|
3
|
-
import m from"../pathing/astar.js";class g{check(t){return t.me.playing&&t.game.collectables[0].length
|
|
3
|
+
import m from"../pathing/astar.js";class g{validate(t){return t.intents.includes(t.Intents.PATHFINDING)}check(t){return t.me.playing&&t.game.collectables[0].length}execute(t){this.pather=new m(t.pathing.nodeList);let a=200,n=null;for(const e of t.game.collectables[0]){const i=e.x-t.me.position.x,s=e.y-t.me.position.y,o=e.z-t.me.position.z,r=Math.sqrt(i*i+s*s+o*o);r<a&&(a=r,n=e)}const c=Object.entries(t.me.position).map(e=>Math.floor(e[1])),h=Object.entries(n).map(e=>Math.floor(e[1])),p=t.pathing.nodeList.at(...c),l=t.pathing.nodeList.at(...h);if(t.pathing.activePath=this.pather.path(p,l),!t.pathing.activePath)return t.processError("no path found");if(t.pathing.activePath.length<2)return t.processError("path too short");t.pathing.followingPath=!0,t.pathing.activeNode=t.pathing.activePath[1],t.pathing.activeNodeIdx=1}}var u=g;export{g as GoToAmmoDispatch,u as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
|
|
3
|
-
import d from"../pathing/astar.js";class
|
|
3
|
+
import d from"../pathing/astar.js";class l{validate(t){return t.intents.includes(t.Intents.PATHFINDING)}check(t){return t.me.playing&&t.game.zoneNumber&&t.game.activeZone}execute(t){this.pather=new d(t.pathing.nodeList);let n=200,a=null;for(const e of t.game.activeZone){const i=e.x-t.me.position.x,o=e.y-t.me.position.y,s=e.z-t.me.position.z,r=Math.sqrt(i*i+o*o+s*s);r<n&&(n=r,a=e)}const c=Object.entries(t.me.position).map(e=>Math.floor(e[1])),p=Object.entries(a).map(e=>Math.floor(e[1])),h=t.pathing.nodeList.at(...c),g=t.pathing.nodeList.at(...p);if(t.pathing.activePath=this.pather.path(h,g),!t.pathing.activePath)return t.processError("no path found");if(t.pathing.activePath.length<2)return t.processError("path too short");t.pathing.followingPath=!0,t.pathing.activeNode=t.pathing.activePath[1],t.pathing.activeNodeIdx=1}}var u=l;export{l as GoToCoopDispatch,u as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import d from"../pathing/astar.js";class g{validate(t){return t.intents.includes(t.Intents.PATHFINDING)}check(t){return t.me.playing&&t.game.collectables[1].length}execute(t){this.pather=new d(t.pathing.nodeList);let n=200,a=null;for(const e of t.game.collectables[1]){const i=e.x-t.me.position.x,s=e.y-t.me.position.y,r=e.z-t.me.position.z,o=Math.sqrt(i*i+s*s+r*r);o<n&&(n=o,a=e)}const c=Object.entries(t.me.position).map(e=>Math.floor(e[1])),h=Object.entries(a).map(e=>Math.floor(e[1])),p=t.pathing.nodeList.at(...c),l=t.pathing.nodeList.at(...h);if(t.pathing.activePath=this.pather.path(p,l),!t.pathing.activePath)return t.processError("no path found");if(t.pathing.activePath.length<2)return t.processError("path too short");t.pathing.followingPath=!0,t.pathing.activeNode=t.pathing.activePath[1],t.pathing.activeNodeIdx=1}}var u=g;export{g as GoToGrenadeDispatch,u as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
|
|
3
|
-
import h from"../pathing/astar.js";class
|
|
3
|
+
import h from"../pathing/astar.js";class p{idOrName;constructor(t){this.idOrName=t}validate(t){return!t.intents.includes(t.Intents.PATHFINDING)||!this.idOrName?!1:!!(t.players[this.idOrName.toString()]||t.players.find(i=>i.name===this.idOrName))}check(t){if(!t.me.playing)return!1;const e=t.players[this.idOrName.toString()]||t.players.find(i=>i.name===this.idOrName);return e&&e.playing&&e.position&&e.position.x}execute(t){this.pather=new h(t.pathing.nodeList);const e=t.players[this.idOrName.toString()]||t.players.find(a=>a.name===this.idOrName),i=Object.entries(t.me.position).map(a=>Math.floor(a[1])),r=Object.entries(e.position).map(a=>Math.floor(a[1])),n=t.pathing.nodeList.at(...i),s=t.pathing.nodeList.at(...r);if(t.pathing.activePath=this.pather.path(n,s),!t.pathing.activePath)return t.processError("no path found");if(t.pathing.activePath.length<2)return t.processError("path too short");t.pathing.followingPath=!0,t.pathing.activeNode=t.pathing.activePath[1],t.pathing.activeNodeIdx=1}}var d=p;export{p as GoToPlayerDispatch,d as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import s from"../pathing/astar.js";class p{validate(t){return t.intents.includes(t.Intents.PATHFINDING)}check(t){return t.me.playing&&t.game.spatula&&t.game.spatula.coords&&t.game.spatula.coords.x}execute(t){this.pather=new s(t.pathing.nodeList);const e=Object.entries(t.me.position).map(a=>Math.floor(a[1])),i=Object.entries(t.game.spatula.coords).map(a=>Math.floor(a[1])),n=t.pathing.nodeList.at(...e),r=t.pathing.nodeList.at(...i);if(t.pathing.activePath=this.pather.path(n,r),!t.pathing.activePath)return t.processError("no path found");if(t.pathing.activePath.length<2)return t.processError("path too short");t.pathing.followingPath=!0,t.pathing.activeNode=t.pathing.activePath[1],t.pathing.activeNodeIdx=1}}var c=p;export{p as GoToSpatulaDispatch,c as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const c=(i,t)=>(i%t+t)%t,p=Math.PI*2,n=i=>Math.round(i*8192)/8192,h=i=>n(c(Math.atan2(-i.x,-i.z),p)),d=i=>n(Math.atan2(i.y,Math.hypot(i.x,i.z)));class l{idOrName;constructor(t){this.idOrName=t}validate(t){return!!(t.players[this.idOrName.toString()]||t.players.find(e=>e.name===this.idOrName))}check(t){if(!t.me.playing)return!1;const a=t.players[this.idOrName.toString()]||t.players.find(e=>e.name===this.idOrName);return a&&a.playing&&a.position&&a.position.x}execute(t){const a=t.players[this.idOrName.toString()]||t.players.find(o=>o.name===this.idOrName),e={x:a.position.x-t.me.position.x,y:a.position.y-t.me.position.y-.05,z:a.position.z-t.me.position.z},s=h(e),r=d(e);t.state.yaw=s,t.state.pitch=r}}var y=l;export{l as LookAtDispatch,y as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const e=(s,t)=>(s%t+t)%t,n=Math.PI*2,c=s=>Math.round(s*8192)/8192,h=s=>c(e(Math.atan2(-s.x,-s.z),n)),p=s=>c(Math.atan2(s.y,Math.hypot(s.x,s.z)));class r{constructor(t){this.pos=t}validate(){return this.pos&&this.pos.x&&this.pos.y&&this.pos.z}check(t){return t.me.playing}execute(t){const o={x:this.pos.x-t.me.position.x,y:this.pos.y-t.me.position.y,z:this.pos.z-t.me.position.z},a=h(o),i=p(o);t.state.yaw=a,t.state.pitch=i}}var x=r;export{r as LookAtPosDispatch,x as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import s from"../comm/CommOut.js";import{CommCode as u}from"../constants/codes.js";class a{validate(){return!0}check(e){return e.me.playing&&!e.state.reloading&&!e.state.swappingGun&&!e.state.usingMelee}execute(e){const t=s.getBuffer();t.packInt8(u.melee),t.send(e.game.socket),e.usingMelee=!0,setTimeout(()=>{e.usingMelee=!1,e.swappingGun=!0,setTimeout(()=>{e.swappingGun=!1},.5*e.me.weapons[0].equipTime)},100/3*17)}}var p=a;export{a as MeleeDispatch,p as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
|
|
3
|
-
class
|
|
3
|
+
import{Movements as t}from"../constants/index.js";class r{constructor(e){typeof e=="number"?this.inputKeys=e:typeof e==typeof[]&&(this.inputKeys=e.reduce((s,i)=>s|i,0))}validate(){return!(typeof this.inputKeys!="number"||this.inputKeys&t.FORWARD&&this.inputKeys&t.BACKWARD||this.inputKeys&t.LEFT&&this.inputKeys&t.RIGHT)}check(e){return e.me.playing}execute(e){e.state.controlKeys=this.inputKeys}}var f=r;export{r as MovementDispatch,f as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import a from"../comm/CommOut.js";import{CommCode as m}from"../constants/codes.js";class o{validate(){return!0}check(e){return e.me.playing}execute(e){const t=a.getBuffer();t.packInt8(m.pause),t.send(e.game.socket),setTimeout(()=>e.me.playing=!1,3e3)}}var p=o;export{o as PauseDispatch,p as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
|
|
3
|
-
import s from"../comm/CommOut.js";import{CommCode as
|
|
3
|
+
import s from"../comm/CommOut.js";import{CommCode as r}from"../constants/codes.js";class i{validate(){return!0}check(e){return e.me.playing&&!e.state.reloading&&!e.state.swappingGun&&!e.state.usingMelee}execute(e){const o=s.getBuffer();o.packInt8(r.reload),o.send(e.game.socket);const a=e.me.weapons[e.me.activeGun];if(a.ammo){const t=Math.min(Math.min(a.ammo.capacity,a.ammo.reload)-a.ammo.rounds,a.ammo.store);a.ammo.rounds+=t,a.ammo.store-=t}e.emit("playerReload",e.me,a);const m=e.me.weapons[e.me.activeGun],n=m.ammo.rounds<1;e.state.reloading=!0,setTimeout(()=>e.state.reloading=!1,n?m.longReloadTime:m.shortReloadTime)}}var d=i;export{i as ReloadDispatch,d as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import a from"../comm/CommOut.js";import{CommCode as i}from"../constants/codes.js";class n{constructor(r,e={}){this.idOrName=r,this.reasons=[!!e.cheating,!!e.harassment,!!e.offensive,!!e.other],this.reasons.includes(!0)||(this.reasons[3]=!0);for(let t=0;t<this.reasons.length;t++)this.reasons[t]===!0&&(this.reasonInt|=1<<t)}validate(){return!(this.reasons.every(e=>e===!1)||!(bot.players[this.idOrName.toString()]||bot.players.find(e=>e.name===this.idOrName)))}check(r){return r.state.inGame?!!(r.players[this.idOrName.toString()]||r.players.find(t=>t.name===this.idOrName)):!1}execute(r){const e=r.players[this.idOrName.toString()]||r.players.find(s=>s.name===this.idOrName),t=a.getBuffer();t.packInt8(i.reportPlayer),t.packString(e.uniqueId),t.packInt8(this.reasonInt),t.send(r.game.socket)}}var f=n;export{n as ReportPlayerDispatch,f as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
|
|
3
|
-
import{findItemById as t,GunList as l,ItemTypes as i}from"../constants/index.js";import
|
|
3
|
+
import{findItemById as t,GunList as l,ItemTypes as i}from"../constants/index.js";import o from"../comm/CommOut.js";import{CommCode as f}from"../constants/codes.js";const I=n=>t(n)&&t(n).unlock==="default",m=(n,e)=>t(n)&&t(n).item_type_id===e;class u{constructor(e){this.changes={classIdx:e.gunId,hatId:e.hatId,stampId:e.stampId,grenadeId:e.grenadeId,meleeId:e.meleeId,colorIdx:e.eggColor,primaryId:e.primaryIds,secondaryId:e.secondaryIds},this.changes=Object.fromEntries(Object.entries(this.changes).filter(([,s])=>!!s))}validate(e){const s=this.changes;if(s.colorIdx&&s.colorIdx>=7&&!e.account.vip||s.colorIdx&&s.colorIdx>=14||m(s.hatId,i.Hat)&&!I(s.hatId)&&!e.account.ownedItemIds.includes(s.hatId)||m(s.stampId,i.Stamp)&&!I(s.stampId)&&!e.account.ownedItemIds.includes(s.stampId)||m(s.grenadeId,i.Grenade)&&!I(s.grenadeId)&&!e.account.ownedItemIds.includes(s.grenadeId)||m(s.meleeId,i.Melee)&&!I(s.meleeId)&&!e.account.ownedItemIds.includes(s.meleeId)||typeof s.classIdx=="number"&&s.classIdx>6||s.classIdx<0)return!1;if(this.changes.primaryId)for(let c=0;c<7;c++){const d=this.changes.primaryId[c];if(!m(d,i.Primary)||!I(d)&&!e.account.ownedItemIds.includes(d))return!1}if(this.changes.secondaryId)for(let c=0;c<7;c++){const d=this.changes.secondaryId[c];if(!m(d,i.Secondary)||!I(d)&&!e.account.ownedItemIds.includes(d))return!1}return!0}check(e){return!e.me.playing}execute(e){e.me&&this.changes.classIdx&&this.changes.classIdx!==e.me.selectedGun&&(e.me.weapons[0]=new l[this.changes.classIdx]),e.state.weaponIdx=this.changes.classIdx||e.state.weaponIdx;const s={...e.account.loadout,...this.changes},c=e.api.queryServices({cmd:"saveLoadout",save:!0,firebaseId:e.account.firebaseId,sessionId:e.account.sessionId,loadout:s});e.account.loadout=s,e.me&&c.then(()=>{if(e.state.inGame){const a=o.getBuffer();a.packInt8(f.changeCharacter),a.packInt8(this.changes?.classIdx||e.me.selectedGun),a.send(e.game.socket)}const d=e.intents.includes(e.Intents.COSMETIC_DATA);Object.entries(this.changes).forEach(([a,r])=>{a==="classIdx"?e.me.selectedGun=r:a==="hatId"?e.me.character.hat=d?t(r):r:a==="stampId"?e.me.character.stamp=d?t(r):r:a==="grenadeId"?e.me.character.grenade=d?t(r):r:a==="meleeId"?e.me.character.melee=d?t(r):r:a==="colorIdx"?e.me.character.eggColor=r:a==="primaryId"?e.me.character.primaryGun=d?t(r[e.me.selectedGun]):r:a==="secondaryId"&&(e.me.character.secondaryGun=d?t(r[e.me.selectedGun]):r)})})}}var y=u;export{u as SaveLoadoutDispatch,y as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
|
|
3
|
-
import r from"../comm/CommOut.js";import{CommCode as a}from"../constants/codes.js";class
|
|
3
|
+
import r from"../comm/CommOut.js";import{CommCode as a}from"../constants/codes.js";class u{validate(){return!0}check(e){return!e.me.playing&&e.lastDeathTime+6e3<Date.now()}execute(e){const t=r.getBuffer();t.packInt8(a.requestRespawn),t.send(e.game.socket),e.state.buffer=[]}}var n=u;export{u as SpawnDispatch,n as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
|
|
3
|
-
import t from"../comm/CommOut.js";import{CommCode as
|
|
3
|
+
import t from"../comm/CommOut.js";import{CommCode as p}from"../constants/codes.js";class u{constructor(e){this.manualWeapon=e}validate(){return typeof this.manualWeapon=="number"||this.manualWeapon===void 0}check(e){return e.me.playing&&!e.state.reloading&&!e.state.swappingGun&&!e.state.usingMelee}execute(e){let n=+!e.me.activeGun;typeof this.manualWeapon=="number"&&(n=this.manualWeapon),e.me.activeGun=n;const a=t.getBuffer();a.packInt8(p.swapWeapon),a.packInt8(e.me.activeGun),a.send(e.game.socket)}}var i=u;export{u as SwapWeaponDispatch,i as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
|
|
3
|
-
import n from"../comm/CommOut.js";import{CommCode as i}from"../constants/codes.js";class f{check(e){if(!e.state.inGame||e.me.playing||e.game.gameModeId===0)return!1;if(e.game.isPrivate)return!e.game.options.noTeamChange;const t=e.players,r=e.me.team,m=t.filter(a=>a.team===r).length,s=t.filter(a=>a.team!==r).length;return!(s>m||m===s)}execute(e){const t=n.getBuffer();t.packInt8(i.switchTeam),t.send(e.game.socket)}}var
|
|
3
|
+
import n from"../comm/CommOut.js";import{CommCode as i}from"../constants/codes.js";class f{validate(){return!0}check(e){if(!e.state.inGame||e.me.playing||e.game.gameModeId===0)return!1;if(e.game.isPrivate)return!e.game.options.noTeamChange;const t=e.players,r=e.me.team,m=t.filter(a=>a.team===r).length,s=t.filter(a=>a.team!==r).length;return!(s>m||m===s)}execute(e){const t=n.getBuffer();t.packInt8(i.switchTeam),t.send(e.game.socket)}}var o=f;export{f as SwitchTeamDispatch,o as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
|
|
3
|
-
import r from"../comm/CommOut.js";import{CommCode as o}from"../constants/codes.js";class
|
|
3
|
+
import r from"../comm/CommOut.js";import{CommCode as o}from"../constants/codes.js";class a{constructor(e=1){this.power=e}validate(){return typeof this.power=="number"&&this.power>=0&&this.power<=1}check(e){return e.me.playing&&!e.state.reloading&&!e.state.swappingGun&&!e.state.usingMelee}execute(e){const t=r.getBuffer();t.packInt8(o.throwGrenade),t.packFloat(this.power),t.send(e.game.socket)}}var i=a;export{a as ThrowGrenadeDispatch,i as default};
|
package/dist/types/bot.d.ts
CHANGED
|
@@ -9,7 +9,8 @@ type intents = {
|
|
|
9
9
|
LOG_PACKETS: 10,
|
|
10
10
|
NO_LOGIN: 11,
|
|
11
11
|
DEBUG_BUFFER: 12,
|
|
12
|
-
DEBUG_BEST_TARGET: 14
|
|
12
|
+
DEBUG_BEST_TARGET: 14,
|
|
13
|
+
KOTC_ZONES: 15
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
import { Character, GamePlayer, Position } from './bot/GamePlayer';
|
|
@@ -284,7 +285,7 @@ export class Bot {
|
|
|
284
285
|
join(botName: string, data: string | RawGameData): Promise<void>;
|
|
285
286
|
|
|
286
287
|
processPacket(data: number[]): void;
|
|
287
|
-
dispatch(disp: ADispatch):
|
|
288
|
+
dispatch(disp: ADispatch): boolean;
|
|
288
289
|
update(): void;
|
|
289
290
|
|
|
290
291
|
canSee(player: GamePlayer): boolean;
|
|
@@ -298,10 +299,12 @@ export class Bot {
|
|
|
298
299
|
on(event: 'balanceUpdate', cb: (oldBalance: number, newBalance: number) => void): void;
|
|
299
300
|
on(event: 'banned', cb: (banRemaining: string) => void): void;
|
|
300
301
|
on(event: 'botJoined', cb: (botPlayer: GamePlayer) => void): void;
|
|
302
|
+
on(event: 'challengeComplete', cb: (player: GamePlayer, challengeId: number) => void): void;
|
|
301
303
|
on(event: 'chat', cb: (player: GamePlayer | undefined, message: string, flags: number) => void): void;
|
|
302
304
|
on(event: 'close', cb: (code: number) => void): void;
|
|
303
305
|
on(event: 'collectAmmo', cb: (player: GamePlayer, weapon: AnyGun) => void): void;
|
|
304
306
|
on(event: 'collectGrenade', cb: (player: GamePlayer) => void): void;
|
|
307
|
+
on(event: 'error', cb: (error: string) => void): void;
|
|
305
308
|
on(event: 'gameForcePause', cb: () => void): void;
|
|
306
309
|
on(event: 'gameOptionsChange', cb: (oldOptions: GameOptions, newOptions: GameOptions) => void): void;
|
|
307
310
|
on(event: 'gameReady', cb: () => void): void;
|
|
@@ -311,21 +314,24 @@ export class Bot {
|
|
|
311
314
|
on(event: 'leave', cb: (closeCode: number) => void): void;
|
|
312
315
|
on(event: 'packet', cb: (packet: ArrayBuffer) => void): void;
|
|
313
316
|
on(event: 'pingUpdate', cb: (oldPing: number, newPing: number) => void): void;
|
|
314
|
-
on(event: 'playerBeginStreak', cb: (player: GamePlayer,
|
|
317
|
+
on(event: 'playerBeginStreak', cb: (player: GamePlayer, streakType: number) => void): void;
|
|
315
318
|
on(event: 'playerChangeCharacter', cb: (player: GamePlayer, oldCharacter: Character, newCharacter: Character) => void): void;
|
|
316
319
|
on(event: 'playerChangeGun', cb: (player: GamePlayer, oldGun: number, newGun: number) => void): void;
|
|
317
320
|
on(event: 'playerDamaged', cb: (player: GamePlayer, oldHp: number, newHp: number) => void): void;
|
|
318
321
|
on(event: 'playerDeath', cb: (player: GamePlayer, killer: GamePlayer) => void): void;
|
|
322
|
+
on(event: 'playerEndStreak', cb: (player: GamePlayer, streakType: number) => void): void;
|
|
323
|
+
on(event: 'playerEnterZone', cb: (player: GamePlayer) => void): void;
|
|
319
324
|
on(event: 'playerFire', cb: (player: GamePlayer, weapon: AnyGun) => void): void;
|
|
320
325
|
on(event: 'playerJoin', cb: (player: GamePlayer) => void): void;
|
|
321
326
|
on(event: 'playerLeave', cb: (player: GamePlayer) => void): void;
|
|
327
|
+
on(event: 'playerLeaveZone', cb: (player: GamePlayer) => void): void;
|
|
322
328
|
on(event: 'playerMelee', cb: (player: GamePlayer) => void): void;
|
|
329
|
+
on(event: 'playerMove', cb: (player: GamePlayer, position: Position) => void): void;
|
|
323
330
|
on(event: 'playerPause', cb: (player: GamePlayer) => void): void;
|
|
324
331
|
on(event: 'playerReload', cb: (player: GamePlayer, weapon: AnyGun) => void): void;
|
|
325
332
|
on(event: 'playerRespawn', cb: (player: GamePlayer) => void): void;
|
|
326
333
|
on(event: 'playerSwapWeapon', cb: (player: GamePlayer, nowActive: number) => void): void;
|
|
327
334
|
on(event: 'playerSwitchTeam', cb: (player: GamePlayer, oldTeam: number, newTeam: number) => void): void;
|
|
328
|
-
on(event: 'quit', cb: () => void): void;
|
|
329
335
|
on(event: 'rocketHit', cb: (pos: Position, damage: number, blastRadius: number) => void): void;
|
|
330
336
|
on(event: 'selfDamaged', cb: (oldHealth: number, newHealth: number) => void): void;
|
|
331
337
|
on(event: 'selfMoved', cb: (oldPosition: Position, newPosition: Position) => void): void;
|
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
import Bot from '../bot';
|
|
2
2
|
|
|
3
|
+
export interface GameOptionChanges {
|
|
4
|
+
gravity?: number;
|
|
5
|
+
damage?: number;
|
|
6
|
+
healthRegen?: number;
|
|
7
|
+
locked?: boolean;
|
|
8
|
+
noTeamChange?: boolean;
|
|
9
|
+
noTeamShuffle?: boolean;
|
|
10
|
+
disableEggk?: boolean;
|
|
11
|
+
disableScrambler?: boolean;
|
|
12
|
+
disableFreeRanger?: boolean;
|
|
13
|
+
disableRPG?: boolean;
|
|
14
|
+
disableWhipper?: boolean;
|
|
15
|
+
disableCrackshot?: boolean;
|
|
16
|
+
disableTriHard?: boolean;
|
|
17
|
+
toDisable?: number[];
|
|
18
|
+
toEnable?: number[];
|
|
19
|
+
rawWeaponsDisabled?: boolean[];
|
|
20
|
+
}
|
|
21
|
+
|
|
3
22
|
export declare class GameOptionsDispatch {
|
|
23
|
+
constructor(changes: GameOptionChanges);
|
|
4
24
|
check(bot: Bot): boolean;
|
|
5
25
|
execute(bot: Bot): void;
|
|
6
26
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import Bot from '../bot';
|
|
2
|
-
import GamePlayer from '../bot/GamePlayer';
|
|
3
2
|
|
|
4
3
|
export declare class GoToPlayerDispatch {
|
|
5
|
-
|
|
4
|
+
idOrName: string;
|
|
5
|
+
|
|
6
|
+
constructor(idOrName: string);
|
|
6
7
|
|
|
7
8
|
check(bot: Bot): boolean;
|
|
8
9
|
execute(bot: Bot): void;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import Bot from '../bot';
|
|
2
2
|
|
|
3
3
|
declare class LookAtDispatch {
|
|
4
|
-
idOrName:
|
|
5
|
-
id?: number;
|
|
6
|
-
name?: string;
|
|
4
|
+
idOrName: string;
|
|
7
5
|
|
|
8
|
-
constructor(idOrName:
|
|
6
|
+
constructor(idOrName: string);
|
|
9
7
|
|
|
10
8
|
check(bot: Bot): boolean;
|
|
11
9
|
execute(bot: Bot): void;
|
|
@@ -8,12 +8,11 @@ export interface CheatingReasons {
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export class ReportPlayerDispatch {
|
|
11
|
-
|
|
12
|
-
name?: string;
|
|
11
|
+
irOrName: string;
|
|
13
12
|
reasons: boolean[];
|
|
14
13
|
reasonInt: number;
|
|
15
14
|
|
|
16
|
-
constructor(idOrName:
|
|
15
|
+
constructor(idOrName: string, reasons?: CheatingReasons);
|
|
17
16
|
|
|
18
17
|
check(bot: Bot): boolean;
|
|
19
18
|
execute(bot: Bot): void;
|
package/dist/wasm/imports.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
|
|
3
|
-
import{jsResolve as p,dateToUse as y,getWasm as b}from"./wrapper.js";import{addToExternrefTable as o,getStringFromWasm as d,passStringToWasm as i}from"./utils.js";const w=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>{b().__wbindgen_export_5.get(e.dtor)(e.a,e.b)}),u=(e,_,n,r)=>{const t={a:e,b:_,cnt:1,dtor:n},a=(...l)=>{t.cnt++;const s=t.a;t.a=0;try{return r(s,t.b,...l)}finally{--t.cnt===0?(b().__wbindgen_export_5.get(t.dtor)(s,t.b),w.unregister(t)):t.a=s}};return a.original=t,w.register(a,t,t),a},f=(e,_,n)=>b().closure30_externref_shim(e,_,n),v={},m={document:{body:{},currentScript:{}}},c={textContent:""};let g=
|
|
3
|
+
import{jsResolve as p,dateToUse as y,getWasm as b}from"./wrapper.js";import{addToExternrefTable as o,getStringFromWasm as d,passStringToWasm as i}from"./utils.js";const w=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>{b().__wbindgen_export_5.get(e.dtor)(e.a,e.b)}),u=(e,_,n,r)=>{const t={a:e,b:_,cnt:1,dtor:n},a=(...l)=>{t.cnt++;const s=t.a;t.a=0;try{return r(s,t.b,...l)}finally{--t.cnt===0?(b().__wbindgen_export_5.get(t.dtor)(s,t.b),w.unregister(t)):t.a=s}};return a.original=t,w.register(a,t,t),a},f=(e,_,n)=>b().closure30_externref_shim(e,_,n),v={},m={document:{body:{},currentScript:{}}},c={textContent:""};let g=2;const I={wbg:{__wbg_addEventListener_90e553fdce254421:(e,_,n,r)=>{const t=d(_,n);v[t]=r},__wbg_appendChild_8204974b7328bf98:()=>{},__wbg_axes_b1da727bd9ea422d:()=>{},__wbg_body_942ea927546a04ba:(...e)=>o(e[0].body),__wbg_call_672a4d21634d4a24:()=>{},__wbg_childNodes_c4423003f3a9441f:()=>[],__wbg_createElement_8c9931a732ee2fea:()=>c,__wbg_document_d249400bd7bd996d:()=>o(m.document),__wbg_from_2a5d3e218e67aa85:(...e)=>Array.from(e[0]),__wbg_getElementById_f827f0d6648718a8:()=>o({}),__wbg_getGamepads_1f997cef580c9088:(...e)=>e[0].getGamepads(),__wbg_get_67b2ba62fc30de12:(...e)=>Reflect.get(e[0],e[1]),__wbg_get_b9b93047fe3cf45b:(...e)=>e[0][e[1]>>>0],__wbg_instanceof_Gamepad_365ec8404255ce00:()=>!0,__wbg_instanceof_HtmlCanvasElement_2ea67072a7624ac5:()=>!0,__wbg_instanceof_Window_def73ea0955fc569:()=>!0,__wbg_isTrusted_cc994b7949c53593:()=>!0,__wbg_item_8be407c958853a13:(...e)=>{const _=e[0][e[1]>>>0];return o(_)},__wbg_length_49b2ba67f0897e97:()=>(g--,g<=0?0:g),__wbg_length_e2d2a49132c1b256:(...e)=>e[0].length,__wbg_movementX_1aa05f864931369b:(...e)=>e[0].movementX,__wbg_movementY_8acfedb38a70e624:(...e)=>e[0].movementY,__wbg_navigator_1577371c070c8947:(...e)=>e[0].navigator,__wbg_new_405e22f390576ce2:()=>new Object,__wbg_newnoargs_105ed471475aaf50:()=>{},__wbg_nodeType_5e1153141daac26a:()=>3,__wbg_now_807e54c39636c349:()=>y||Date.now(),__wbg_set_bb8cecf6a62b9f46:(...e)=>Reflect.set(e[0],e[1],e[2]),__wbg_settextContent_d29397f7b994d314:async(...e)=>{c.textContent=d(e[1],e[2]),p?.(c.textContent)},__wbg_static_accessor_GLOBAL_88a902d13a557d07:()=>{},__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0:()=>{},__wbg_static_accessor_SELF_37c5d418e4bf5819:()=>o(m),__wbg_static_accessor_WINDOW_5de37043a91a9c40:()=>{},__wbg_textContent_215d0f87d539368a:(e,_)=>{const[n,r]=i(_===c?c.textContent:"Blue Wizard Digital"),t=new DataView(b().memory.buffer);t.setInt32(e+4*1,r,!0),t.setInt32(e+4*0,n,!0)},__wbindgen_debug_string:()=>{},__wbindgen_init_externref_table:()=>{},__wbindgen_throw:()=>{},__wbindgen_number_new:e=>e,__wbindgen_string_new:(e,_)=>d(e,_),__wbindgen_string_get:(e,_)=>{const n=d(e,_),[r,t]=i(n),a=new DataView(b().memory.buffer);a.setInt32(e+4*1,t,!0),a.setInt32(e+4*0,r,!0)},__wbindgen_is_undefined:e=>e===void 0?1:0,__wbindgen_boolean_get:e=>{const _=e;return typeof _=="boolean"?_?1:0:2},__wbindgen_closure_wrapper100:(e,_)=>u(e,_,31,f),__wbindgen_closure_wrapper99:(e,_)=>u(e,_,31,f),__wbindgen_number_get:(e,_)=>{const n=_,r=typeof n=="number"?n:void 0,t=new DataView(b().memory.buffer);t.setFloat64(e+8*1,r,!0),t.setInt32(e+4*0,1,!0)}}};export{v as canvasListeners,I as imports,u as makeMutClosure};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yolkbot",
|
|
3
3
|
"description": "create a shell shockers bot in under 10 lines.",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.15",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"shell shockers",
|
|
7
7
|
"shellshock.io",
|
|
@@ -93,13 +93,13 @@
|
|
|
93
93
|
},
|
|
94
94
|
"dependencies": {
|
|
95
95
|
"smallsocks": "^1.0.2",
|
|
96
|
-
"undici": "^7.
|
|
96
|
+
"undici": "^7.10.0",
|
|
97
97
|
"ws": "^8.18.2"
|
|
98
98
|
},
|
|
99
99
|
"devDependencies": {
|
|
100
|
-
"@stylistic/eslint-plugin": "^4.
|
|
100
|
+
"@stylistic/eslint-plugin": "^4.4.0",
|
|
101
101
|
"esbuild": "^0.25.4",
|
|
102
102
|
"eslint": "^9.27.0",
|
|
103
|
-
"globals": "^
|
|
103
|
+
"globals": "^16.2.0"
|
|
104
104
|
}
|
|
105
105
|
}
|
|
Binary file
|