yolkbot 0.1.1-alpha.4 → 0.1.1-alpha.40

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.
@@ -127,7 +127,7 @@ export const Maps = [
127
127
  "Spatula": true,
128
128
  "King": true
129
129
  },
130
- "availability": "both",
130
+ "availability": "private",
131
131
  "numPlayers": "18"
132
132
  },
133
133
  {
@@ -335,7 +335,7 @@ export const Maps = [
335
335
  "Spatula": true,
336
336
  "King": true
337
337
  },
338
- "availability": "private",
338
+ "availability": "both",
339
339
  "numPlayers": "18"
340
340
  },
341
341
  {
@@ -348,7 +348,7 @@ export const Maps = [
348
348
  "Spatula": true,
349
349
  "King": true
350
350
  },
351
- "availability": "private",
351
+ "availability": "both",
352
352
  "numPlayers": "18"
353
353
  },
354
354
  {
@@ -400,7 +400,7 @@ export const Maps = [
400
400
  "Spatula": true,
401
401
  "King": true
402
402
  },
403
- "availability": "both",
403
+ "availability": "private",
404
404
  "numPlayers": "18"
405
405
  },
406
406
  {
@@ -491,7 +491,7 @@ export const Maps = [
491
491
  "Spatula": true,
492
492
  "King": true
493
493
  },
494
- "availability": "private",
494
+ "availability": "both",
495
495
  "numPlayers": "14"
496
496
  },
497
497
  {
@@ -574,7 +574,7 @@ export const Maps = [
574
574
  },
575
575
  {
576
576
  "filename": "metamorph",
577
- "hash": "hlpma5zbhi",
577
+ "hash": "l9o69l8e1b",
578
578
  "name": "Metamorph",
579
579
  "modes": {
580
580
  "FFA": true,
@@ -582,7 +582,7 @@ export const Maps = [
582
582
  "Spatula": true,
583
583
  "King": false
584
584
  },
585
- "availability": "both",
585
+ "availability": "private",
586
586
  "numPlayers": "14"
587
587
  },
588
588
  {
@@ -634,7 +634,7 @@ export const Maps = [
634
634
  "Spatula": true,
635
635
  "King": true
636
636
  },
637
- "availability": "private",
637
+ "availability": "both",
638
638
  "numPlayers": "18"
639
639
  },
640
640
  {
@@ -764,7 +764,7 @@ export const Maps = [
764
764
  "Spatula": true,
765
765
  "King": true
766
766
  },
767
- "availability": "both",
767
+ "availability": "private",
768
768
  "numPlayers": "14"
769
769
  },
770
770
  {
@@ -816,7 +816,7 @@ export const Maps = [
816
816
  "Spatula": true,
817
817
  "King": true
818
818
  },
819
- "availability": "both",
819
+ "availability": "private",
820
820
  "numPlayers": "16"
821
821
  },
822
822
  {
@@ -829,7 +829,7 @@ export const Maps = [
829
829
  "Spatula": true,
830
830
  "King": true
831
831
  },
832
- "availability": "both",
832
+ "availability": "private",
833
833
  "numPlayers": "18"
834
834
  },
835
835
  {
@@ -972,7 +972,7 @@ export const Maps = [
972
972
  "Spatula": true,
973
973
  "King": true
974
974
  },
975
- "availability": "private",
975
+ "availability": "both",
976
976
  "numPlayers": "18"
977
977
  },
978
978
  {
@@ -1024,7 +1024,7 @@ export const Maps = [
1024
1024
  "Spatula": true,
1025
1025
  "King": false
1026
1026
  },
1027
- "availability": "both",
1027
+ "availability": "private",
1028
1028
  "numPlayers": "12"
1029
1029
  },
1030
1030
  {
@@ -1076,7 +1076,20 @@ export const Maps = [
1076
1076
  "Spatula": true,
1077
1077
  "King": true
1078
1078
  },
1079
- "availability": "private",
1079
+ "availability": "both",
1080
+ "numPlayers": "18"
1081
+ },
1082
+ {
1083
+ "filename": "yolkido",
1084
+ "hash": "127ppvq4k6n",
1085
+ "name": "Yolkido Garrison",
1086
+ "modes": {
1087
+ "FFA": true,
1088
+ "Teams": true,
1089
+ "Spatula": true,
1090
+ "King": true
1091
+ },
1092
+ "availability": "both",
1080
1093
  "numPlayers": "18"
1081
1094
  }
1082
1095
  ];
@@ -102,7 +102,7 @@ export class SaveLoadoutDispatch {
102
102
  else if (changeKey === 'grenadeId') bot.me.character.grenade = findCosmetics ? findItemById(changeValue) : changeValue;
103
103
  else if (changeKey === 'meleeId') bot.me.character.melee = findCosmetics ? findItemById(changeValue) : changeValue;
104
104
  else if (changeKey === 'colorIdx') bot.me.character.eggColor = changeValue;
105
- else if (changeKey === 'primaryId') bot.me.character.primaryGun = findItemById(changeValue[bot.me.selectedGun]);
105
+ else if (changeKey === 'primaryId') bot.me.character.primaryGun = findCosmetics ? findItemById(changeValue[bot.me.selectedGun]) : changeValue;
106
106
  else if (changeKey === 'secondaryId') bot.me.character.secondaryGun = findCosmetics ? findItemById(changeValue[bot.me.selectedGun]) : changeValue;
107
107
  })
108
108
  })
package/src/matchmaker.js CHANGED
@@ -10,11 +10,11 @@ export class Matchmaker {
10
10
  proxy = null;
11
11
  sessionId = '';
12
12
 
13
- forceClose = false;
14
-
15
13
  onListeners = new Map();
16
14
  onceListeners = new Map();
17
15
 
16
+ #forceClose = false;
17
+
18
18
  // sessionId: string, a custom session id
19
19
  // proxy: a socks5 proxy string
20
20
  // instance: a custom game instance
@@ -34,6 +34,11 @@ export class Matchmaker {
34
34
  const attempt = async () => {
35
35
  try {
36
36
  this.ws = new yolkws(`wss://${instance}/matchmaker/`, this.proxy);
37
+ this.ws.onerror = async (e) => {
38
+ console.error(e);
39
+ await new Promise((resolve) => setTimeout(resolve, 100));
40
+ return await attempt();
41
+ }
37
42
  } catch {
38
43
  await new Promise((resolve) => setTimeout(resolve, 100));
39
44
  await attempt();
@@ -44,6 +49,8 @@ export class Matchmaker {
44
49
 
45
50
  this.ws.onopen = () => {
46
51
  this.connected = true;
52
+ this.ws.onerror = null;
53
+
47
54
  if (this.sessionId) {
48
55
  this.onceConnected.forEach(func => func());
49
56
  }
@@ -55,7 +62,7 @@ export class Matchmaker {
55
62
  }
56
63
 
57
64
  this.ws.onclose = () => {
58
- if (this.forceClose) return;
65
+ if (this.#forceClose) return;
59
66
 
60
67
  this.connected = false;
61
68
  this.#createSocket(instance);
@@ -159,7 +166,7 @@ export class Matchmaker {
159
166
  }
160
167
 
161
168
  close() {
162
- this.forceClose = true;
169
+ this.#forceClose = true;
163
170
  this.ws.close();
164
171
  }
165
172
 
package/src/packet.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import CommOut from './comm/CommOut.js';
2
- import { CommCode } from './comm/Codes.js';
2
+ import { CommCode } from './constants/codes.js';
3
3
 
4
4
  class Packet {
5
5
  constructor(code, _args) {
@@ -18,7 +18,6 @@
18
18
 
19
19
  class NodeList {
20
20
  constructor(raw) {
21
- const now = Date.now();
22
21
  this.list = [];
23
22
  const addedPositions = {};
24
23
 
@@ -69,8 +68,6 @@ class NodeList {
69
68
  }
70
69
  }
71
70
  }
72
-
73
- console.log(`NodeList created in ${Date.now() - now}ms`);
74
71
  }
75
72
 
76
73
  add(node) {
@@ -14,7 +14,7 @@ export interface View {
14
14
 
15
15
  export interface Character {
16
16
  eggColor: string;
17
- primaryGun: Item;
17
+ primaryGun: Item | number;
18
18
  secondaryGun: Item | number;
19
19
  stamp: Item | number;
20
20
  hat: Item | number;
@@ -29,28 +29,51 @@ export interface Buffer {
29
29
  }
30
30
 
31
31
  export interface PlayerData {
32
- name_: string;
32
+ id_: string;
33
33
  uniqueId_: string;
34
- playing_: boolean;
35
- social_: string;
36
- hideBadge_: boolean;
34
+ name_: string;
35
+ safename_: string;
36
+ charClass_: number;
37
+ team_: 0 | 1 | 2;
38
+ primaryWeaponItem_: Item | number;
39
+ secondaryWeaponItem_: Item | number;
40
+ shellColor_: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13;
41
+ hatItem_: Item | number;
42
+ stampItem_: Item | number;
43
+ _unused: number;
44
+ _unused2: number;
45
+ grenadeItem_: Item | number;
46
+ meleeItem_: Item | number;
37
47
  x_: number;
38
48
  y_: number;
39
49
  z_: number;
50
+ dx_: number;
51
+ dy_: number;
52
+ dz_: number;
40
53
  yaw_: number;
41
54
  pitch_: number;
42
- shellColor_: string;
43
- primaryWeaponItem_: Item;
44
- secondaryWeaponItem_: Item | number;
45
- stampItem_: Item | number;
46
- hatItem_: Item | number;
47
- grenadeItem_: Item | number;
48
- meleeItem_: Item | number;
55
+ score_: number;
56
+ kills_: number;
57
+ deaths_: number;
58
+ streak_: number;
59
+ totalKills_: number;
60
+ totalDeaths_: number;
61
+ bestGameStreak_: number;
62
+ bestOverallStreak_: number;
63
+ shield_: number;
64
+ hp_: number;
65
+ playing_: boolean;
49
66
  weaponIdx_: number;
67
+ controlKeys_: number;
68
+ upgradeProductId_: number;
69
+ activeShellStreaks_: number;
70
+ social_: string;
71
+ hideBadge_: boolean;
50
72
  }
51
73
 
52
74
  export interface Social {
53
75
  id: number;
76
+ type: 'Facebook' | 'Instagram' | 'Tiktok' | 'Discord' | 'Youtube' | 'Twitter' | 'Twitch';
54
77
  url: string;
55
78
  active: boolean;
56
79
  }
@@ -58,11 +81,12 @@ export interface Social {
58
81
  export class GamePlayer {
59
82
  id: string;
60
83
  team: 0 | 1 | 2;
61
- data: PlayerData;
84
+ raw: PlayerData;
62
85
  name: string;
63
86
  uniqueId: string;
64
87
  playing: boolean;
65
- social: Social[];
88
+ socials: Social[];
89
+ isVip: boolean;
66
90
  showBadge: boolean;
67
91
  position: Position;
68
92
  jumping: boolean;
@@ -74,7 +98,7 @@ export class GamePlayer {
74
98
  weapons: AnyGun[];
75
99
  grenades: number;
76
100
  buffer: Buffer;
77
- kills: number;
101
+ streak: number;
78
102
  hp: number;
79
103
  hpShield: number;
80
104
  streakRewards: number[];
@@ -188,7 +188,9 @@ type intents = {
188
188
  PATHFINDING: 3,
189
189
  BUFFERS: 4,
190
190
  PING: 5,
191
- COSMETIC_DATA: 6
191
+ COSMETIC_DATA: 6,
192
+ PLAYER_HEALTH: 7,
193
+ PACKET_HOOK: 8
192
194
  }
193
195
 
194
196
  export class Bot {
@@ -196,7 +198,6 @@ export class Bot {
196
198
  Intents: intents;
197
199
 
198
200
  proxy: string;
199
- name?: string;
200
201
  autoUpdate: boolean;
201
202
  disablePathing: boolean;
202
203
  updateInterval: number;
@@ -230,7 +231,7 @@ export class Bot {
230
231
  update(): void;
231
232
 
232
233
  canSee(player: GamePlayer): boolean;
233
- getBestTarget(): GamePlayer | undefined;
234
+ getBestTarget(customFilter: (player: GamePlayer) => boolean): GamePlayer | undefined;
234
235
 
235
236
  onAny(cb: Function): void;
236
237
 
@@ -279,6 +280,8 @@ export class Bot {
279
280
  claimURLReward(reward: string): Promise<{ result: string; eggsGiven: number; itemIds: number[]; }>;
280
281
  claimSocialReward(rewardTag: string): Promise<{ result: string; eggsGiven: number; itemIds: number[]; }>;
281
282
  buyItem(itemId: number): Promise<{ result: string; currentBalance: number; itemId: number; }>;
283
+
284
+ quit(noCleanup?: boolean): void;
282
285
  }
283
286
 
284
287
  export default Bot;
@@ -30,6 +30,7 @@ declare class Eggk47 extends Gun {
30
30
  longReloadTime: number;
31
31
  shortReloadTime: number;
32
32
  weaponName: string;
33
+ internalName: string;
33
34
  standardMeshName: string;
34
35
  rof: number;
35
36
  recoil: number;
@@ -53,6 +54,7 @@ declare class DozenGauge extends Gun {
53
54
  longReloadTime: number;
54
55
  shortReloadTime: number;
55
56
  weaponName: string;
57
+ internalName: string;
56
58
  standardMeshName: string;
57
59
  rof: number;
58
60
  recoil: number;
@@ -80,6 +82,7 @@ declare class CSG1 extends Gun {
80
82
  shortReloadTime: number;
81
83
  highPrecision: boolean;
82
84
  weaponName: string;
85
+ internalName: string;
83
86
  standardMeshName: string;
84
87
  rof: number;
85
88
  recoil: number;
@@ -103,6 +106,7 @@ declare class Cluck9mm extends Gun {
103
106
  longReloadTime: number;
104
107
  shortReloadTime: number;
105
108
  weaponName: string;
109
+ internalName: string;
106
110
  standardMeshName: string;
107
111
  rof: number;
108
112
  recoil: number;
@@ -129,6 +133,7 @@ declare class RPEGG extends Gun {
129
133
  longReloadTime: number;
130
134
  shortReloadTime: number;
131
135
  weaponName: string;
136
+ internalName: string;
132
137
  standardMeshName: string;
133
138
  rof: number;
134
139
  recoil: number;
@@ -158,6 +163,7 @@ declare class SMG extends Gun {
158
163
  longReloadTime: number;
159
164
  shortReloadTime: number;
160
165
  weaponName: string;
166
+ internalName: string;
161
167
  standardMeshName: string;
162
168
  rof: number;
163
169
  recoil: number;
@@ -184,6 +190,7 @@ declare class M24 extends Gun {
184
190
  longReloadTime: number;
185
191
  shortReloadTime: number;
186
192
  weaponName: string;
193
+ internalName: string;
187
194
  standardMeshName: string;
188
195
  rof: number;
189
196
  recoil: number;
@@ -210,6 +217,7 @@ declare class AUG extends Gun {
210
217
  longReloadTime: number;
211
218
  shortReloadTime: number;
212
219
  weaponName: string;
220
+ internalName: string;
213
221
  standardMeshName: string;
214
222
  rof: number;
215
223
  recoil: number;
@@ -82,6 +82,16 @@ export declare const ShellStreaks: {
82
82
  MiniEgg: number;
83
83
  };
84
84
 
85
+ export declare const SocialMedias: {
86
+ 0: string;
87
+ 1: string;
88
+ 2: string;
89
+ 3: string;
90
+ 4: string;
91
+ 5: string;
92
+ 6: string;
93
+ };
94
+
85
95
  export declare const SocialRewards: {
86
96
  Discord: string;
87
97
  Tiktok: string;
@@ -99,4 +109,4 @@ export declare const Teams: {
99
109
 
100
110
  export declare const URLRewards: string[];
101
111
 
102
- export declare const UserAgent: string;
112
+ export declare const UserAgent: string | undefined;
@@ -40,20 +40,26 @@ type CommandSend = {
40
40
  export declare class Matchmaker {
41
41
  connected: boolean;
42
42
  onceConnected: Function[];
43
+
43
44
  proxy: string | null;
44
45
  sessionId: string;
45
- forceClose: boolean;
46
46
  onListeners: Map<string, Function[]>;
47
47
  onceListeners: Map<string, Function[]>;
48
48
 
49
+ regionList: Region[] | null;
50
+ ws: yolkws;
51
+
49
52
  constructor(params?: MatchmakerParams);
50
53
 
51
54
  send(msg: CommandSend): void;
52
- waitForConnect(): Promise<void>;
55
+
53
56
  getRegions(): Promise<Region[]>;
54
57
  findPublicGame(params: FindGameParams): Promise<RawGameData>;
58
+
55
59
  getRandomRegion(): string;
56
60
  getRandomGameMode(): keyof typeof GameModes;
61
+
62
+ waitForConnect(): Promise<void>;
57
63
  close(): void;
58
64
 
59
65
  on(event: string, callback: Function): void;