yolkbot 1.5.7 → 1.5.9

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.
Files changed (85) hide show
  1. package/browser/build/global.js +1 -1
  2. package/browser/build/module.js +1 -1
  3. package/dist/api.js +1 -244
  4. package/dist/bot/GamePlayer.js +1 -84
  5. package/dist/bot.js +1 -1226
  6. package/dist/comm/CommIn.js +1 -76
  7. package/dist/comm/CommOut.js +1 -60
  8. package/dist/constants/CloseCode.js +1 -27
  9. package/dist/constants/CommCode.js +1 -53
  10. package/dist/constants/challenges.js +1 -1821
  11. package/dist/constants/findItemById.js +1 -3
  12. package/dist/constants/guns.js +1 -155
  13. package/dist/constants/index.js +1 -141
  14. package/dist/constants/items.js +1 -45979
  15. package/dist/constants/maps.js +1 -1289
  16. package/dist/constants/regions.js +1 -30
  17. package/dist/dispatches/BanPlayerDispatch.js +1 -32
  18. package/dist/dispatches/BootPlayerDispatch.js +1 -21
  19. package/dist/dispatches/ChatDispatch.js +1 -32
  20. package/dist/dispatches/FireDispatch.js +1 -15
  21. package/dist/dispatches/GameOptionsDispatch.js +1 -66
  22. package/dist/dispatches/GoToAmmoDispatch.js +1 -37
  23. package/dist/dispatches/GoToCoopDispatch.js +1 -37
  24. package/dist/dispatches/GoToGrenadeDispatch.js +1 -37
  25. package/dist/dispatches/GoToPlayerDispatch.js +1 -34
  26. package/dist/dispatches/GoToSpatulaDispatch.js +1 -23
  27. package/dist/dispatches/LookAtDispatch.js +1 -37
  28. package/dist/dispatches/LookAtPosDispatch.js +1 -29
  29. package/dist/dispatches/MeleeDispatch.js +1 -26
  30. package/dist/dispatches/MovementDispatch.js +1 -26
  31. package/dist/dispatches/PauseDispatch.js +1 -18
  32. package/dist/dispatches/ReloadDispatch.js +1 -35
  33. package/dist/dispatches/ReportPlayerDispatch.js +1 -44
  34. package/dist/dispatches/ResetGameDispatch.js +1 -19
  35. package/dist/dispatches/SaveLoadoutDispatch.js +1 -106
  36. package/dist/dispatches/SpawnDispatch.js +1 -26
  37. package/dist/dispatches/SwapWeaponDispatch.js +1 -25
  38. package/dist/dispatches/SwitchTeamDispatch.js +1 -34
  39. package/dist/dispatches/ThrowGrenadeDispatch.js +1 -21
  40. package/dist/dispatches/index.js +1 -73
  41. package/dist/enums.js +1 -114
  42. package/dist/env/fetch.js +8 -129
  43. package/dist/env/globals.js +1 -17
  44. package/dist/index.js +1 -22
  45. package/dist/packets/addPlayer.js +1 -63
  46. package/dist/packets/beginShellStreak.js +1 -44
  47. package/dist/packets/challengeCompleted.js +1 -16
  48. package/dist/packets/changeCharacter.js +1 -46
  49. package/dist/packets/chat.js +1 -10
  50. package/dist/packets/collectItem.js +1 -26
  51. package/dist/packets/die.js +1 -40
  52. package/dist/packets/endShellStreak.js +1 -21
  53. package/dist/packets/eventModifier.js +1 -8
  54. package/dist/packets/explode.js +1 -19
  55. package/dist/packets/fire.js +1 -21
  56. package/dist/packets/gameAction.js +1 -33
  57. package/dist/packets/gameJoined.js +1 -64
  58. package/dist/packets/gameOptions.js +1 -27
  59. package/dist/packets/hitMe.js +1 -12
  60. package/dist/packets/hitMeHardBoiled.js +1 -18
  61. package/dist/packets/hitThem.js +1 -12
  62. package/dist/packets/melee.js +1 -8
  63. package/dist/packets/metaGameState.js +1 -62
  64. package/dist/packets/pause.js +1 -17
  65. package/dist/packets/ping.js +1 -19
  66. package/dist/packets/playerInfo.js +1 -15
  67. package/dist/packets/reload.js +1 -17
  68. package/dist/packets/removePlayer.js +1 -10
  69. package/dist/packets/respawn.js +1 -31
  70. package/dist/packets/socketReady.js +1 -16
  71. package/dist/packets/spawnItem.js +1 -11
  72. package/dist/packets/swapWeapon.js +1 -11
  73. package/dist/packets/switchTeam.js +1 -13
  74. package/dist/packets/syncMe.js +1 -25
  75. package/dist/packets/syncThem.js +1 -63
  76. package/dist/packets/throwGrenade.js +1 -17
  77. package/dist/packets/updateBalance.js +1 -8
  78. package/dist/pathing/astar.js +1 -68
  79. package/dist/pathing/mapnode.js +1 -284
  80. package/dist/socket.js +1 -107
  81. package/dist/util.js +1 -128
  82. package/dist/wasm/bytes.js +1 -8
  83. package/dist/wasm/direct.js +1 -84
  84. package/dist/wasm/legacy.js +1 -176
  85. package/package.json +2 -7
@@ -1,176 +1 @@
1
- import { wasmBytes } from "./bytes.js";
2
- const normalizeYaw = (yaw) => (yaw % (2 * Math.PI) + 2 * Math.PI) % (2 * Math.PI);
3
-
4
- export class WASM {
5
- wasm;
6
- debug = false;
7
- canvasListeners = { pointermove: () => {} };
8
- mockElement = { textContent: "" };
9
- processDate = null;
10
- processListeners = [];
11
- async initWasm() {
12
- const wasmInstantiated = await WebAssembly.instantiate(wasmBytes, this.getImports());
13
- this.wasm = wasmInstantiated.instance.exports;
14
- this.wasm.start();
15
- const [ptr, len] = this.passStringToWasm([...Array(14)].map(() => Math.random().toString(36)[2]).join(""));
16
- this.wasm.set_mouse_params(50, 1, 1, false, ptr, len);
17
- const movementX = Math.random() * 10 + 100;
18
- const movementY = Math.random() * 10 + 100;
19
- this.canvasListeners.pointermove({ movementX, movementY });
20
- }
21
- getStringFromWasm = (ptr, len) => {
22
- if (!this.wasm)
23
- return "";
24
- ptr >>>= 0;
25
- return new TextDecoder().decode(new Uint8Array(this.wasm.memory.buffer).subarray(ptr, ptr + len));
26
- };
27
- passStringToWasm = (str) => {
28
- if (!this.wasm)
29
- return [];
30
- const buf = new TextEncoder().encode(str);
31
- const ptr = this.wasm.__wbindgen_malloc(buf.length, 1) >>> 0;
32
- new Uint8Array(this.wasm.memory.buffer).subarray(ptr, ptr + buf.length).set(buf);
33
- return [ptr, buf.length];
34
- };
35
- addToExternrefTable = (obj) => {
36
- if (!this.wasm)
37
- return;
38
- const idx = this.wasm.__externref_table_alloc();
39
- this.wasm.__wbindgen_export_2.set(idx, obj);
40
- return idx;
41
- };
42
- getImports() {
43
- const CLOSURE_DTORS = new FinalizationRegistry((state) => {
44
- this.wasm.__wbindgen_export_5.get(state.dtor)(state.a, state.b);
45
- });
46
- const makeMutClosure = (arg0, arg1, dtor, f) => {
47
- const state = { a: arg0, b: arg1, cnt: 1, dtor };
48
- const real = (...args) => {
49
- state.cnt++;
50
- const a = state.a;
51
- state.a = 0;
52
- try {
53
- return f(a, state.b, ...args);
54
- } finally {
55
- if (--state.cnt === 0) {
56
- this.wasm.__wbindgen_export_5.get(state.dtor)(a, state.b);
57
- CLOSURE_DTORS.unregister(state);
58
- } else
59
- state.a = a;
60
- }
61
- };
62
- real.original = state;
63
- CLOSURE_DTORS.register(real, state, state);
64
- return real;
65
- };
66
- const __wbg_adapter_6 = (arg0, arg1, arg2) => this.wasm.closure9_externref_shim(arg0, arg1, arg2);
67
- return {
68
- wbg: {
69
- __wbg_addEventListener_775911544ac9d643: (_t, arg1, arg2, callback) => this.canvasListeners[this.getStringFromWasm(arg1, arg2)] = callback,
70
- __wbg_appendChild_87a6cc0aeb132c06: () => {},
71
- __wbg_axes_57e916a6e0ffb3e4: () => {},
72
- __wbg_body_8822ca55cb3730d2: () => this.addToExternrefTable(null),
73
- __wbg_call_13410aac570ffff7: () => {},
74
- __wbg_createElement_4909dfa2011f2abe: () => this.mockElement,
75
- __wbg_document_7d29d139bd619045: () => this.addToExternrefTable({}),
76
- __wbg_from_88bc52ce20ba6318: (...args) => Array.from(args[0]),
77
- __wbg_getGamepads_c373aed0f1e5e4a6: (...args) => args[0].getGamepads(),
78
- __wbg_get_458e874b43b18b25: (...args) => Reflect.get(args[0], args[1]),
79
- __wbg_get_0da715ceaecea5c8: (...args) => args[0][args[1] >>> 0],
80
- __wbg_has_b89e451f638123e3: () => true,
81
- __wbg_instanceof_Gamepad_2987f05b50f4775a: () => true,
82
- __wbg_instanceof_Window_12d20d558ef92592: () => true,
83
- __wbg_isTrusted_04e871d8dde8ea8a: () => true,
84
- __wbg_length_186546c51cd61acd: (...args) => args[0].length,
85
- __wbg_movementX_0ef0e79f7b9168fc: (...args) => args[0].movementX,
86
- __wbg_movementY_875c2fc2aabd99bf: (...args) => args[0].movementY,
87
- __wbg_navigator_65d5ad763926b868: (...args) => args[0].navigator,
88
- __wbg_new_19c25a3f2fa63a02: () => new Object,
89
- __wbg_newnoargs_254190557c45b4ec: () => {},
90
- __wbg_now_1e80617bcee43265: () => this.processDate || Date.now(),
91
- __wbg_set_453345bcda80b89a: (...args) => Reflect.set(args[0], args[1], args[2]),
92
- __wbg_settextContent_b55fe2f5f1399466: async (...args) => {
93
- this.mockElement.textContent = this.getStringFromWasm(args[1], args[2]);
94
- this.processListeners.forEach((listener) => listener(this.mockElement.textContent));
95
- this.processListeners = [];
96
- },
97
- __wbg_static_accessor_GLOBAL_8921f820c2ce3f12: () => {},
98
- __wbg_static_accessor_GLOBAL_THIS_f0a4409105898184: () => {},
99
- __wbg_static_accessor_SELF_995b214ae681ff99: () => this.addToExternrefTable({}),
100
- __wbg_static_accessor_WINDOW_cde3890479c675ea: () => {},
101
- __wbg_wbindgenbooleanget_3fe6f642c7d97746: (arg0) => {
102
- if (typeof arg0 === "boolean")
103
- return arg0 ? 1 : 0;
104
- return null;
105
- },
106
- __wbg_wbindgendebugstring_99ef257a3ddda34d: (arg0, arg1) => {
107
- const str = this.getStringFromWasm(arg0, arg1);
108
- const [ptr, len] = this.passStringToWasm(str);
109
- const dv = new DataView(this.wasm.memory.buffer);
110
- dv.setInt32(arg0 + 4 * 1, len, true);
111
- dv.setInt32(arg0 + 4 * 0, ptr, true);
112
- },
113
- __wbg_wbindgenisnull_f3037694abe4d97a: (arg0) => arg0 === null ? 1 : 0,
114
- __wbg_wbindgenisundefined_c4b71d073b92f3c5: (arg0) => typeof arg0 === "undefined" ? 1 : 0,
115
- __wbg_wbindgennumberget_f74b4c7525ac05cb: (arg0, arg1) => {
116
- const obj = arg1;
117
- const ret = typeof obj === "number" ? obj : null;
118
- const dv = new DataView(this.wasm.memory.buffer);
119
- dv.setFloat64(arg0 + 8 * 1, ret, true);
120
- dv.setInt32(arg0 + 4 * 0, 1, true);
121
- },
122
- __wbg_wbindgenthrow_451ec1a8469d7eb6: (a, b) => this.debug && console.log("call 31", a, b),
123
- __wbindgen_cast_01559742fdcca8af: (arg0, arg1) => makeMutClosure(arg0, arg1, 8, __wbg_adapter_6),
124
- __wbindgen_cast_2241b6af4c4b2941: (arg0, arg1) => this.getStringFromWasm(arg0, arg1),
125
- __wbindgen_cast_2495c10526b24646: (arg0, arg1) => makeMutClosure(arg0, arg1, 8, __wbg_adapter_6),
126
- __wbindgen_cast_d6cd19b81560fd6e: (arg0) => arg0,
127
- __wbindgen_init_externref_table: () => {
128
- const table = this.wasm.__wbindgen_export_2;
129
- const offset = table.grow(4);
130
- table.set(0, null);
131
- table.set(offset + 0, null);
132
- table.set(offset + 1, null);
133
- table.set(offset + 2, true);
134
- table.set(offset + 3, false);
135
- }
136
- }
137
- };
138
- }
139
- async process(str, date) {
140
- if (date)
141
- this.processDate = date;
142
- const promise = new Promise((resolve) => this.processListeners.push(resolve));
143
- const [ptr, len] = this.passStringToWasm(str);
144
- this.wasm.process(ptr, len);
145
- return promise;
146
- }
147
- validate(input) {
148
- let retPtr;
149
- let retLen;
150
- try {
151
- const [ptr, len] = this.passStringToWasm(input);
152
- const ret = this.wasm.validate(ptr, len);
153
- retPtr = ret[0];
154
- retLen = ret[1];
155
- return this.getStringFromWasm(retPtr, retLen);
156
- } finally {
157
- this.wasm.__wbindgen_free(retPtr, retLen, 1);
158
- }
159
- }
160
- getYawPitch = () => this.wasm.get_yaw_pitch();
161
- resetYawPitch = () => this.wasm.reset_yaw_pitch();
162
- coords(targetYaw, targetPitch) {
163
- this.wasm.reset_yaw_pitch();
164
- const current = this.wasm.get_yaw_pitch();
165
- const normalizedCurrentYaw = normalizeYaw(current.yaw);
166
- const normalizedTargetYaw = normalizeYaw(targetYaw);
167
- const yawDiff = (normalizedTargetYaw - normalizedCurrentYaw + Math.PI) % (2 * Math.PI) - Math.PI;
168
- const pitchDiff = targetPitch - current.pitch;
169
- const movementX = Math.round(-yawDiff / 0.0025);
170
- const movementY = Math.round(-pitchDiff / 0.0025);
171
- this.canvasListeners.pointermove({ movementX, movementY });
172
- const newYawPitch = this.wasm.get_yaw_pitch();
173
- return newYawPitch.coords;
174
- }
175
- }
176
- export default WASM;
1
+ import{wasmBytes}from"./bytes.js";const normalizeYaw=(yaw)=>(yaw%(2*Math.PI)+2*Math.PI)%(2*Math.PI);export class WASM{wasm;debug=false;canvasListeners={pointermove:()=>{}};mockElement={textContent:""};processDate=null;processListeners=[];async initWasm(){const wasmInstantiated=await WebAssembly.instantiate(wasmBytes,this.getImports());this.wasm=wasmInstantiated.instance.exports;this.wasm.start();const[ptr,len]=this.passStringToWasm([...Array(14)].map(()=>Math.random().toString(36)[2]).join(""));this.wasm.set_mouse_params(50,1,1,false,ptr,len);const movementX=Math.random()*10+100;const movementY=Math.random()*10+100;this.canvasListeners.pointermove({movementX,movementY})}getStringFromWasm=(ptr,len)=>{if(!this.wasm)return"";ptr>>>=0;return new TextDecoder().decode(new Uint8Array(this.wasm.memory.buffer).subarray(ptr,ptr+len))};passStringToWasm=(str)=>{if(!this.wasm)return[];const buf=new TextEncoder().encode(str);const ptr=this.wasm.__wbindgen_malloc(buf.length,1)>>>0;new Uint8Array(this.wasm.memory.buffer).subarray(ptr,ptr+buf.length).set(buf);return[ptr,buf.length]};addToExternrefTable=(obj)=>{if(!this.wasm)return;const idx=this.wasm.__externref_table_alloc();this.wasm.__wbindgen_export_2.set(idx,obj);return idx};getImports(){const CLOSURE_DTORS=new FinalizationRegistry((state)=>{this.wasm.__wbindgen_export_5.get(state.dtor)(state.a,state.b)});const makeMutClosure=(arg0,arg1,dtor,f)=>{const state={a:arg0,b:arg1,cnt:1,dtor};const real=(...args)=>{state.cnt++;const a=state.a;state.a=0;try{return f(a,state.b,...args)}finally{if(--state.cnt===0){this.wasm.__wbindgen_export_5.get(state.dtor)(a,state.b);CLOSURE_DTORS.unregister(state)}else state.a=a}};real.original=state;CLOSURE_DTORS.register(real,state,state);return real};const __wbg_adapter_6=(arg0,arg1,arg2)=>this.wasm.closure9_externref_shim(arg0,arg1,arg2);return{wbg:{__wbg_addEventListener_775911544ac9d643:(_t,arg1,arg2,callback)=>this.canvasListeners[this.getStringFromWasm(arg1,arg2)]=callback,__wbg_appendChild_87a6cc0aeb132c06:()=>{},__wbg_axes_57e916a6e0ffb3e4:()=>{},__wbg_body_8822ca55cb3730d2:()=>this.addToExternrefTable(null),__wbg_call_13410aac570ffff7:()=>{},__wbg_createElement_4909dfa2011f2abe:()=>this.mockElement,__wbg_document_7d29d139bd619045:()=>this.addToExternrefTable({}),__wbg_from_88bc52ce20ba6318:(...args)=>Array.from(args[0]),__wbg_getGamepads_c373aed0f1e5e4a6:(...args)=>args[0].getGamepads(),__wbg_get_458e874b43b18b25:(...args)=>Reflect.get(args[0],args[1]),__wbg_get_0da715ceaecea5c8:(...args)=>args[0][args[1]>>>0],__wbg_has_b89e451f638123e3:()=>true,__wbg_instanceof_Gamepad_2987f05b50f4775a:()=>true,__wbg_instanceof_Window_12d20d558ef92592:()=>true,__wbg_isTrusted_04e871d8dde8ea8a:()=>true,__wbg_length_186546c51cd61acd:(...args)=>args[0].length,__wbg_movementX_0ef0e79f7b9168fc:(...args)=>args[0].movementX,__wbg_movementY_875c2fc2aabd99bf:(...args)=>args[0].movementY,__wbg_navigator_65d5ad763926b868:(...args)=>args[0].navigator,__wbg_new_19c25a3f2fa63a02:()=>new Object,__wbg_newnoargs_254190557c45b4ec:()=>{},__wbg_now_1e80617bcee43265:()=>this.processDate||Date.now(),__wbg_set_453345bcda80b89a:(...args)=>Reflect.set(args[0],args[1],args[2]),__wbg_settextContent_b55fe2f5f1399466:async(...args)=>{this.mockElement.textContent=this.getStringFromWasm(args[1],args[2]);this.processListeners.forEach((listener)=>listener(this.mockElement.textContent));this.processListeners=[]},__wbg_static_accessor_GLOBAL_8921f820c2ce3f12:()=>{},__wbg_static_accessor_GLOBAL_THIS_f0a4409105898184:()=>{},__wbg_static_accessor_SELF_995b214ae681ff99:()=>this.addToExternrefTable({}),__wbg_static_accessor_WINDOW_cde3890479c675ea:()=>{},__wbg_wbindgenbooleanget_3fe6f642c7d97746:(arg0)=>{if(typeof arg0==="boolean")return arg0?1:0;return null},__wbg_wbindgendebugstring_99ef257a3ddda34d:(arg0,arg1)=>{const str=this.getStringFromWasm(arg0,arg1);const[ptr,len]=this.passStringToWasm(str);const dv=new DataView(this.wasm.memory.buffer);dv.setInt32(arg0+4*1,len,true);dv.setInt32(arg0+4*0,ptr,true)},__wbg_wbindgenisnull_f3037694abe4d97a:(arg0)=>arg0===null?1:0,__wbg_wbindgenisundefined_c4b71d073b92f3c5:(arg0)=>typeof arg0==="undefined"?1:0,__wbg_wbindgennumberget_f74b4c7525ac05cb:(arg0,arg1)=>{const obj=arg1;const ret=typeof obj==="number"?obj:null;const dv=new DataView(this.wasm.memory.buffer);dv.setFloat64(arg0+8*1,ret,true);dv.setInt32(arg0+4*0,1,true)},__wbg_wbindgenthrow_451ec1a8469d7eb6:(a,b)=>this.debug&&console.log("call 31",a,b),__wbindgen_cast_01559742fdcca8af:(arg0,arg1)=>makeMutClosure(arg0,arg1,8,__wbg_adapter_6),__wbindgen_cast_2241b6af4c4b2941:(arg0,arg1)=>this.getStringFromWasm(arg0,arg1),__wbindgen_cast_2495c10526b24646:(arg0,arg1)=>makeMutClosure(arg0,arg1,8,__wbg_adapter_6),__wbindgen_cast_d6cd19b81560fd6e:(arg0)=>arg0,__wbindgen_init_externref_table:()=>{const table=this.wasm.__wbindgen_export_2;const offset=table.grow(4);table.set(0,null);table.set(offset+0,null);table.set(offset+1,null);table.set(offset+2,true);table.set(offset+3,false)}}}}async process(str,date){if(date)this.processDate=date;const promise=new Promise((resolve)=>this.processListeners.push(resolve));const[ptr,len]=this.passStringToWasm(str);this.wasm.process(ptr,len);return promise}validate(input){let retPtr;let retLen;try{const[ptr,len]=this.passStringToWasm(input);const ret=this.wasm.validate(ptr,len);retPtr=ret[0];retLen=ret[1];return this.getStringFromWasm(retPtr,retLen)}finally{this.wasm.__wbindgen_free(retPtr,retLen,1)}}getYawPitch=()=>this.wasm.get_yaw_pitch();resetYawPitch=()=>this.wasm.reset_yaw_pitch();coords(targetYaw,targetPitch){this.wasm.reset_yaw_pitch();const current=this.wasm.get_yaw_pitch();const normalizedCurrentYaw=normalizeYaw(current.yaw);const normalizedTargetYaw=normalizeYaw(targetYaw);const yawDiff=(normalizedTargetYaw-normalizedCurrentYaw+Math.PI)%(2*Math.PI)-Math.PI;const pitchDiff=targetPitch-current.pitch;const movementX=Math.round(-yawDiff/0.0025);const movementY=Math.round(-pitchDiff/0.0025);this.canvasListeners.pointermove({movementX,movementY});const newYawPitch=this.wasm.get_yaw_pitch();return newYawPitch.coords}}export default WASM;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "yolkbot",
3
3
  "description": "yolkbot builds your dream shell shockers bot.",
4
- "version": "1.5.7",
4
+ "version": "1.5.9",
5
5
  "keywords": [
6
6
  "shell shockers",
7
7
  "league bot",
@@ -10,14 +10,9 @@
10
10
  ],
11
11
  "homepage": "https://yolkbot.xyz",
12
12
  "bugs": {
13
- "url": "https://github.com/yolkop/yolkbot/issues",
14
- "email": "hello@villainsrule.xyz"
13
+ "url": "https://yolkbot.xyz/community"
15
14
  },
16
15
  "author": "1ust",
17
- "repository": {
18
- "type": "git",
19
- "url": "git+https://github.com/yolkop/yolkbot.git"
20
- },
21
16
  "type": "module",
22
17
  "license": "SEE LICENSE IN LICENSE.md",
23
18
  "files": [