yolkbot 1.0.3 → 1.0.5

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.
@@ -0,0 +1,3 @@
1
+ import { Items } from './items.js';
2
+
3
+ export const findItemById = (id) => Items.find(item => item.id === id);
@@ -1,3 +1,3 @@
1
1
  /* eslint-disable */
2
2
 
3
- import{AUG as r,CSG1 as n,DozenGauge as a,Eggk47 as s,M24 as c,RPEGG as i,SMG as p}from"./guns.js";import{Items as l}from"./items.js";const x=t=>l.find(o=>o.id===t),k={none:0,pinned:2,team:4},S=3,g={AMMO:0,GRENADE:1},f={start:0,score:1,win:2,capturing:3,contested:4,takeover:5,abandoned:6,unclaimed:7},u="AIzaSyDP4SIjKaw6A4c-zvfYxICpbEjn1rRnN50",d=10,M=Math.ceil(30/d),E={reset:1,pause:2},G={ffa:0,team:1,spatula:2,kotc:3},R={locked:1,noTeamChange:2,noTeamShuffle:4},T=[s,a,n,i,p,c,r],e=typeof window<"u",y={Hat:1,Stamp:2,Primary:3,Secondary:4,Grenade:6,Melee:7},I={FORWARD:1,BACK:2,LEFT:4,RIGHT:8,JUMP:16,FIRE:32,MELEE:64,SCOPE:128},h={joinPublic:0,createPrivate:1,joinPrivate:2},B=!e&&typeof Bun>"u",b={HardBoiled:1,EggBreaker:2,Restock:4,OverHeal:8,DoubleEggs:16,MiniEgg:32},A={0:"Facebook",1:"Instagram",2:"Tiktok",3:"Discord",4:"Youtube",5:"Twitter",6:"Twitch"},C={Discord:"rew_1200",Tiktok:"rew_1208",Instagram:"rew_1219",Steam:"rew_1223",Facebook:"rew_1227",Twitter:"rew_1234",Twitch:"rew_twitch_social"},F=256,P={blue:1,red:2},_=["giveBasketBrosReward","mercZoneFinalGift","midMonthGiveMeEggs","newYolkerSignupReward","newYolkerItemReward","newYolkerWelcomeBack","WelcomeBack"],v=e?void 0:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36";export{k as ChatFlags,S as ChiknWinnerDailyLimit,g as CollectTypes,f as CoopStates,u as FirebaseKey,M as FramesBetweenSyncs,E as GameActions,G as GameModes,R as GameOptionFlags,T as GunList,e as IsBrowser,y as ItemTypes,I as Movements,h as PlayTypes,B as ProxiesEnabled,b as ShellStreaks,A as SocialMedias,C as SocialRewards,F as StateBufferSize,d as SyncRate,P as Teams,_ as URLRewards,v as UserAgent,x as findItemById};
3
+ import{AUG as t,CSG1 as o,DozenGauge as r,Eggk47 as n,M24 as a,RPEGG as s,SMG as c}from"./guns.js";import{findItemById as P}from"./findItemById.js";const l={none:0,pinned:2,team:4},d=3,m={AMMO:0,GRENADE:1},w={start:0,score:1,win:2,capturing:3,contested:4,takeover:5,abandoned:6,unclaimed:7},x="AIzaSyDP4SIjKaw6A4c-zvfYxICpbEjn1rRnN50",i=10,k=Math.ceil(30/i),S={reset:1,pause:2},g={ffa:0,team:1,spatula:2,kotc:3},u={locked:1,noTeamChange:2,noTeamShuffle:4},M=[n,r,o,s,c,a,t],e=typeof window<"u",f={Hat:1,Stamp:2,Primary:3,Secondary:4,Grenade:6,Melee:7},E={FORWARD:1,BACK:2,LEFT:4,RIGHT:8,JUMP:16,FIRE:32,MELEE:64,SCOPE:128},G={joinPublic:0,createPrivate:1,joinPrivate:2},R=!e&&typeof Bun>"u",T={HardBoiled:1,EggBreaker:2,Restock:4,OverHeal:8,DoubleEggs:16,MiniEgg:32},y={0:"Facebook",1:"Instagram",2:"Tiktok",3:"Discord",4:"Youtube",5:"Twitter",6:"Twitch"},I={Discord:"rew_1200",Tiktok:"rew_1208",Instagram:"rew_1219",Steam:"rew_1223",Facebook:"rew_1227",Twitter:"rew_1234",Twitch:"rew_twitch_social"},h=256,B={blue:1,red:2},b=["giveBasketBrosReward","mercZoneFinalGift","midMonthGiveMeEggs","newYolkerSignupReward","newYolkerItemReward","newYolkerWelcomeBack","WelcomeBack"],A=e?void 0:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36";export{l as ChatFlags,d as ChiknWinnerDailyLimit,m as CollectTypes,w as CoopStates,x as FirebaseKey,k as FramesBetweenSyncs,S as GameActions,g as GameModes,u as GameOptionFlags,M as GunList,e as IsBrowser,f as ItemTypes,E as Movements,G as PlayTypes,R as ProxiesEnabled,T as ShellStreaks,y as SocialMedias,I as SocialRewards,h as StateBufferSize,i as SyncRate,B as Teams,b as URLRewards,A as UserAgent,P as findItemById};
@@ -1,3 +1,3 @@
1
1
  /* eslint-disable */
2
2
 
3
- import{loginAnonymously as h}from"./api.js";import{GameModes as r,PlayTypes as c,ProxiesEnabled as d}from"./constants/index.js";import a from"./socket.js";class f{connected=!1;onceConnected=[];proxy=null;sessionId="";onListeners=new Map;onceListeners=new Map;#e=!1;constructor(e={}){if(e.instance||(e.instance="shellshock.io"),e.protocol||(e.protocol="wss"),e.sessionId||e.noLogin?this.sessionId=e.sessionId:this.#o(e.instance),e.proxy&&!d)throw new Error("proxies do not work and hence are not supported in the browser");e.proxy&&(this.proxy=e.proxy),this.#i(e.instance,e.protocol,e.noLogin)}async#i(e,i,s){const t=async()=>{try{this.ws=new a(`${i}://${e}/matchmaker/`,this.proxy),this.ws.onerror=async o=>(console.error(o),await new Promise(n=>setTimeout(n,100)),await t())}catch{await new Promise(o=>setTimeout(o,100)),await t()}};await t(),this.ws.onopen=()=>{this.connected=!0,this.ws.onerror=null,(this.sessionId||s)&&this.onceConnected.forEach(o=>o())},this.ws.onmessage=o=>{const n=JSON.parse(o.data);this.#s("msg",n)},this.ws.onclose=()=>{this.#e||(this.connected=!1,this.#i(e))}}async#o(e){const i=await h(this.proxy,e);(!i||typeof i=="string")&&this.#s("authFail",i),this.sessionId=i.sessionId,this.connected&&this.onceConnected.forEach(s=>s())}send(e){this.ws.send(JSON.stringify(e))}async waitForConnect(){return new Promise(e=>{this.connected?e():this.onceConnected.push(e)})}async getRegions(){return await this.waitForConnect(),new Promise(e=>{const i=s=>{s.command=="regionList"&&(this.regionList=s.regionList,this.off("msg",i),e(s.regionList))};this.on("msg",i),this.ws.onerror=s=>{throw new Error("failed to get regions",s)},this.ws.send(JSON.stringify({command:"regionList"}))})}async findPublicGame(e={}){if(await this.waitForConnect(),!e.region)throw new Error("did not specify a region in findGame, use <Matchmaker>.getRegions() for a list");if(this.regionList&&!this.regionList.find(s=>s.id==e.region))throw new Error("did not find region in regionList, if you are attempting to force a region, avoid calling getRegions()");if(!e.mode)throw new Error("did not specify a mode in findGame");if(r[e.mode]===void 0)throw new Error("invalid mode in findGame, see GameModes for a list");return new Promise(i=>{const s={command:"findGame",region:e.region,playType:c.joinPublic,gameType:r[e.mode],sessionId:this.sessionId},t=o=>{o.command=="gameFound"&&(this.off("msg",t),i(o))};this.on("msg",t),this.ws.send(JSON.stringify(s))})}getRandomRegion(){if(!this.regionList)throw new Error("called getRandomRegion() without region list cached, use <Matchmaker>.getRegions() before getRandomRegion()");return this.regionList[Math.floor(Math.random()*this.regionList.length)].id}getRandomGameMode(){const e=Object.keys(r);return e[Math.floor(Math.random()*e.length)]}close(){this.#e=!0,this.ws.close()}on(e,i){this.onListeners.has(e)||this.onListeners.set(e,[]),this.onListeners.get(e).push(i)}once(e,i){this.onceListeners.has(e)||this.onceListeners.set(e,[]),this.onceListeners.get(e).push(i)}off(e,i){this.onListeners.has(e)&&this.onListeners.set(e,this.onListeners.get(e).filter(s=>s!==i)),this.onceListeners.has(e)&&this.onceListeners.set(e,this.onceListeners.get(e).filter(s=>s!==i))}#s(e,...i){this.onListeners.has(e)&&this.onListeners.get(e).forEach(s=>s(...i)),this.onceListeners.has(e)&&(this.onceListeners.get(e).forEach(s=>s(...i)),this.onceListeners.delete(e))}}var L=f;export{f as Matchmaker,L as default};
3
+ import{loginAnonymously as h}from"./api.js";import{GameModes as r,PlayTypes as c,ProxiesEnabled as d}from"./constants/index.js";import{validate as a}from"./wasm/wrapper.js";import f from"./socket.js";class g{connected=!1;onceConnected=[];proxy=null;sessionId="";onListeners=new Map;onceListeners=new Map;#e=!1;constructor(e={}){if(e.instance||(e.instance="shellshock.io"),e.protocol||(e.protocol="wss"),e.sessionId||e.noLogin?this.sessionId=e.sessionId:this.#o(e.instance),e.proxy&&!d)throw new Error("proxies do not work and hence are not supported in the browser");e.proxy&&(this.proxy=e.proxy),this.#i(e.instance,e.protocol,e.noLogin)}async#i(e,i,s){const t=async()=>{try{this.ws=new f(`${i}://${e}/matchmaker/`,this.proxy),this.ws.onerror=async o=>(console.error(o),await new Promise(n=>setTimeout(n,100)),await t())}catch{await new Promise(o=>setTimeout(o,100)),await t()}};await t(),this.ws.onopen=()=>{this.connected=!0,this.ws.onerror=null,(this.sessionId||s)&&this.onceConnected.forEach(o=>o())},this.ws.onmessage=o=>{const n=JSON.parse(o.data);n.command==="validateUUID"&&this.ws.send(JSON.stringify({command:"validateUUID",hash:a(n.uuid)})),this.#s("msg",n)},this.ws.onclose=()=>{this.#e||(this.connected=!1,this.#i(e))}}async#o(e){const i=await h(this.proxy,e);(!i||typeof i=="string")&&this.#s("authFail",i),this.sessionId=i.sessionId,this.connected&&this.onceConnected.forEach(s=>s())}send(e){this.ws.send(JSON.stringify(e))}async waitForConnect(){return new Promise(e=>{this.connected?e():this.onceConnected.push(e)})}async getRegions(){return await this.waitForConnect(),new Promise(e=>{const i=s=>{s.command=="regionList"&&(this.regionList=s.regionList,this.off("msg",i),e(s.regionList))};this.on("msg",i),this.ws.onerror=s=>{throw new Error("failed to get regions",s)},this.ws.send(JSON.stringify({command:"regionList"}))})}async findPublicGame(e={}){if(await this.waitForConnect(),!e.region)throw new Error("did not specify a region in findGame, use <Matchmaker>.getRegions() for a list");if(this.regionList&&!this.regionList.find(s=>s.id==e.region))throw new Error("did not find region in regionList, if you are attempting to force a region, avoid calling getRegions()");if(!e.mode)throw new Error("did not specify a mode in findGame");if(r[e.mode]===void 0)throw new Error("invalid mode in findGame, see GameModes for a list");return new Promise(i=>{const s={command:"findGame",region:e.region,playType:c.joinPublic,gameType:r[e.mode],sessionId:this.sessionId},t=o=>{o.command=="gameFound"&&(this.off("msg",t),i(o))};this.on("msg",t),this.ws.send(JSON.stringify(s))})}getRandomRegion(){if(!this.regionList)throw new Error("called getRandomRegion() without region list cached, use <Matchmaker>.getRegions() before getRandomRegion()");return this.regionList[Math.floor(Math.random()*this.regionList.length)].id}getRandomGameMode(){const e=Object.keys(r);return e[Math.floor(Math.random()*e.length)]}close(){this.#e=!0,this.ws.close()}on(e,i){this.onListeners.has(e)||this.onListeners.set(e,[]),this.onListeners.get(e).push(i)}once(e,i){this.onceListeners.has(e)||this.onceListeners.set(e,[]),this.onceListeners.get(e).push(i)}off(e,i){this.onListeners.has(e)&&this.onListeners.set(e,this.onListeners.get(e).filter(s=>s!==i)),this.onceListeners.has(e)&&this.onceListeners.set(e,this.onceListeners.get(e).filter(s=>s!==i))}#s(e,...i){this.onListeners.has(e)&&this.onListeners.get(e).forEach(s=>s(...i)),this.onceListeners.has(e)&&(this.onceListeners.get(e).forEach(s=>s(...i)),this.onceListeners.delete(e))}}var u=g;export{g as Matchmaker,u as default};
@@ -0,0 +1,3 @@
1
+ /* eslint-disable */
2
+
3
+ import{getWasm as n}from"./wrapper.js";import{addToExternrefTable as c,passStringToWasm as f}from"./utils.js";const s=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>{n().__wbindgen_export_5.get(e.dtor)(e.a,e.b)}),d=(e,_,r,o,g)=>{const t={a:e,b:_,cnt:1,dtor:r},b=(...w)=>{t.cnt++;const i=t.a;t.a=0;try{return o(i,t.b,...w)}finally{--t.cnt===0?(g.__wbindgen_export_5.get(t.dtor)(i,t.b),s.unregister(t)):t.a=i}};return b.original=t,s.register(b,t,t),b},a={queueMicrotask:e=>{e()},document:{body:{},currentScript:{}}},u={textContent:""},p={wbg:{__wbg_appendChild_8204974b7328bf98:()=>{},__wbg_body_942ea927546a04ba:(...e)=>c(e[0].body),__wbg_call_672a4d21634d4a24:(...e)=>{console.trace("__wbg_call_672a4d21634d4a24",e)},__wbg_clearTimeout_5a54f8841c30079a:(...e)=>{clearTimeout(e[0])},__wbg_createElement_8c9931a732ee2fea:()=>u,__wbg_currentScript_696dfba63dbe2fbe:(...e)=>c(e[0].currentScript),__wbg_document_d249400bd7bd996d:()=>c(a.document),__wbg_get_e27dfaeb6f46bd45:()=>new Proxy({toString:()=>"test",valueOf:()=>"test"},{get:(e,_)=>_.toString().includes("Symbol")?r=>{if(r==="number")return 5}:e[_]}),__wbg_instanceof_Element_0af65443936d5154:()=>!0,__wbg_instanceof_HtmlScriptElement_2e62e6b65dda86a4:(...e)=>e[0]===a.document.currentScript,__wbg_instanceof_Window_def73ea0955fc569:()=>!0,__wbg_length_49b2ba67f0897e97:()=>132,__wbg_location_350d99456c2f3693:()=>({}),__wbg_newnoargs_105ed471475aaf50:()=>{console.trace("__wbg_newnoargs_105ed471475aaf50")},__wbg_now_807e54c39636c349:()=>Date.now(),__wbg_querySelectorAll_40998fd748f057ef:()=>[],__wbg_queueMicrotask_97d92b4fcc8a61c5:(...e)=>{a.queueMicrotask(e[0])},__wbg_queueMicrotask_d3219def82552485:(...e)=>e[0].queueMicrotask,__wbg_resolve_4851785c9c5f573d:(...e)=>Promise.resolve(e[0]),__wbg_setTimeout_db2dbaeefb6f39c7:(...e)=>setTimeout(e[0],e[1]),__wbg_sethref_7eb69a6b9ae98056:()=>{},__wbg_settextContent_d29397f7b994d314:async()=>{},__wbg_static_accessor_GLOBAL_88a902d13a557d07:(...e)=>{console.trace("__wbg_static_accessor_GLOBAL_88a902d13a557d07",e)},__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0:(...e)=>{console.trace("__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0",e)},__wbg_static_accessor_SELF_37c5d418e4bf5819:()=>c(a),__wbg_static_accessor_WINDOW_5de37043a91a9c40:(...e)=>{console.trace("__wbg_static_accessor_WINDOW_5de37043a91a9c40",e)},__wbg_textContent_215d0f87d539368a:e=>{const[_,r]=f(u.textContent),o=new DataView(n().memory.buffer);o.setInt32(e+4*1,r,!0),o.setInt32(e+4*0,_,!0)},__wbg_then_44b73946d2fb3e7d:(...e)=>{console.trace("__wbg_then_44b73946d2fb3e7d",e)},__wbindgen_cb_drop:(...e)=>{const _=e[0].original;return _.cnt--==1?(_.a=0,!0):!1},__wbindgen_closure_wrapper281:(...e)=>d(e[0],e[1],22,(..._)=>{n()._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h573d6777e73915f0(_[0],_[1])},n()),__wbindgen_closure_wrapper295:(...e)=>d(e[0],e[1],29,(..._)=>{n().closure28_externref_shim(_[0],_[1],_[2])},n()),__wbindgen_debug_string:(...e)=>{console.trace("__wbindgen_debug_string",e)},__wbindgen_init_externref_table:(...e)=>{console.trace("__wbindgen_init_externref_table",e)},__wbindgen_is_function:(...e)=>typeof e[0]=="function",__wbindgen_is_undefined:(...e)=>e[0]===void 0,__wbindgen_throw:(...e)=>{console.trace("__wbindgen_throw",e)}}};export{p as imports,d as makeMutClosure};
@@ -0,0 +1,3 @@
1
+ /* eslint-disable */
2
+
3
+ import{getWasm as n}from"./wrapper.js";const a=(r,e)=>(r=r>>>0,new TextDecoder().decode(new Uint8Array(n().memory.buffer).subarray(r,r+e))),s=r=>{const e=new TextEncoder().encode(r),t=n().__wbindgen_malloc(e.length,1)>>>0;return new Uint8Array(n().memory.buffer).subarray(t,t+e.length).set(e),[t,e.length]},c=r=>{const e=n().__externref_table_alloc();return n().__wbindgen_export_2.set(e,r),e};export{c as addToExternrefTable,a as getStringFromWasm,s as passStringToWasm};
Binary file
@@ -0,0 +1,3 @@
1
+ /* eslint-disable */
2
+
3
+ import{readFile as i}from"node:fs/promises";import{imports as l}from"./imports.js";import{getStringFromWasm as p,passStringToWasm as w}from"./utils.js";import{IsBrowser as f}from"../constants/index.js";let r;f?r=await(await fetch(new URL("./wasm_loader.wasm",import.meta.url).href)).arrayBuffer():r=await i(new URL("./wasm_loader.wasm",import.meta.url));const c=await WebAssembly.instantiate(r,l),a=c.instance.exports,x=()=>a,d=s=>{let t,e;try{const[m,n]=w(s),o=a.validate(m,n);return t=o[0],e=o[1],p(t,e)}finally{a.__wbindgen_free(t,e,1)}};export{x as getWasm,d as validate};
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.3",
4
+ "version": "1.0.5",
5
5
  "keywords": [
6
6
  "shell shockers",
7
7
  "shellshock.io",