yolkbot 0.1.1-alpha.11 → 0.1.1-alpha.13
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/build/browser.js +6 -6
- package/package.json +1 -1
- package/src/bot/GamePlayer.js +18 -16
- package/src/bot.js +10 -13
- package/src/constants/guns.js +18 -2
- package/src/constants/index.js +10 -0
- package/src/dispatches/SaveLoadoutDispatch.js +1 -1
- package/src/types/bot/GamePlayer.d.ts +39 -15
- package/src/types/constants/guns.d.ts +8 -0
- package/src/types/constants/index.d.ts +10 -0
package/package.json
CHANGED
package/src/bot/GamePlayer.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GunList } from '#constants';
|
|
1
|
+
import { GunList, ShellStreaks, SocialMedias } from '#constants';
|
|
2
2
|
import { Cluck9mm } from '../constants/guns.js';
|
|
3
3
|
|
|
4
4
|
export class GamePlayer {
|
|
@@ -6,28 +6,31 @@ export class GamePlayer {
|
|
|
6
6
|
this.id = id;
|
|
7
7
|
this.team = team;
|
|
8
8
|
|
|
9
|
-
this.
|
|
9
|
+
this.raw = playerData;
|
|
10
10
|
|
|
11
11
|
this.name = playerData.name_;
|
|
12
12
|
this.uniqueId = playerData.uniqueId_;
|
|
13
13
|
|
|
14
14
|
this.playing = playerData.playing_;
|
|
15
15
|
|
|
16
|
-
this.
|
|
16
|
+
this.socials = playerData.social_ && JSON.parse(playerData.social_);
|
|
17
|
+
if (this.socials) this.socials.forEach((social) => social.type = SocialMedias[social.id]);
|
|
18
|
+
|
|
19
|
+
this.isVip = playerData.upgradeProductId_ > 0;
|
|
17
20
|
this.showBadge = !playerData.hideBadge_ || false;
|
|
18
21
|
|
|
19
22
|
this.position = {
|
|
20
|
-
x:
|
|
21
|
-
y:
|
|
22
|
-
z:
|
|
23
|
+
x: playerData.x_,
|
|
24
|
+
y: playerData.y_,
|
|
25
|
+
z: playerData.z_
|
|
23
26
|
};
|
|
24
27
|
|
|
25
28
|
this.jumping = false;
|
|
26
29
|
this.climbing = false;
|
|
27
30
|
|
|
28
31
|
this.view = {
|
|
29
|
-
yaw:
|
|
30
|
-
pitch:
|
|
32
|
+
yaw: playerData.yaw_,
|
|
33
|
+
pitch: playerData.pitch_
|
|
31
34
|
};
|
|
32
35
|
|
|
33
36
|
this.character = {
|
|
@@ -40,15 +43,14 @@ export class GamePlayer {
|
|
|
40
43
|
melee: playerData.meleeItem_
|
|
41
44
|
}
|
|
42
45
|
|
|
43
|
-
this.activeGun =
|
|
46
|
+
this.activeGun = playerData.weaponIdx_;
|
|
44
47
|
this.selectedGun = 0;
|
|
45
48
|
this.weapons = [{}, {}];
|
|
46
49
|
|
|
47
50
|
if (this.character.primaryGun) {
|
|
48
|
-
|
|
49
|
-
this.selectedGun = this.character.primaryGun.exclusive_for_class;
|
|
51
|
+
this.selectedGun = playerData.charClass_;
|
|
50
52
|
|
|
51
|
-
this.weapons[0] = new
|
|
53
|
+
this.weapons[0] = new GunList[this.selectedGun]();
|
|
52
54
|
this.weapons[1] = new Cluck9mm();
|
|
53
55
|
}
|
|
54
56
|
|
|
@@ -60,11 +62,11 @@ export class GamePlayer {
|
|
|
60
62
|
2: {}
|
|
61
63
|
};
|
|
62
64
|
|
|
63
|
-
this.
|
|
64
|
-
this.hp =
|
|
65
|
+
this.streak = playerData.score_;
|
|
66
|
+
this.hp = playerData.hp_;
|
|
65
67
|
|
|
66
|
-
this.hpShield =
|
|
67
|
-
this.streakRewards =
|
|
68
|
+
this.hpShield = playerData.shield_;
|
|
69
|
+
this.streakRewards = Object.values(ShellStreaks).filter(streak => playerData.activeShellStreaks_ & streak);
|
|
68
70
|
|
|
69
71
|
this.randomSeed = 0;
|
|
70
72
|
this.serverStateIdx = 0;
|
package/src/bot.js
CHANGED
|
@@ -799,25 +799,21 @@ export class Bot {
|
|
|
799
799
|
|
|
800
800
|
#processAddPlayerPacket() {
|
|
801
801
|
const id_ = CommIn.unPackInt8U();
|
|
802
|
-
const uniqueId = CommIn.unPackString();
|
|
803
|
-
const name = CommIn.unPackString();
|
|
804
|
-
const safename = CommIn.unPackString(); // ??? (a)
|
|
805
|
-
const charClass = CommIn.unPackInt8U();
|
|
806
802
|
const findCosmetics = this.intents.includes(this.Intents.COSMETIC_DATA);
|
|
807
803
|
const playerData = {
|
|
808
804
|
id_: id_,
|
|
809
|
-
uniqueId_:
|
|
810
|
-
name_:
|
|
811
|
-
safename_:
|
|
812
|
-
charClass_:
|
|
805
|
+
uniqueId_: CommIn.unPackString(),
|
|
806
|
+
name_: CommIn.unPackString(),
|
|
807
|
+
safename_: CommIn.unPackString(),
|
|
808
|
+
charClass_: CommIn.unPackInt8U(),
|
|
813
809
|
team_: CommIn.unPackInt8U(),
|
|
814
|
-
primaryWeaponItem_: findItemById(CommIn.unPackInt16U()),
|
|
810
|
+
primaryWeaponItem_: findCosmetics ? findItemById(CommIn.unPackInt16U()) : CommIn.unPackInt16U(),
|
|
815
811
|
secondaryWeaponItem_: findCosmetics ? findItemById(CommIn.unPackInt16U()) : CommIn.unPackInt16U(),
|
|
816
812
|
shellColor_: CommIn.unPackInt8U(),
|
|
817
813
|
hatItem_: findCosmetics ? findItemById(CommIn.unPackInt16U()) : CommIn.unPackInt16U(),
|
|
818
814
|
stampItem_: findCosmetics ? findItemById(CommIn.unPackInt16U()) : CommIn.unPackInt16U(),
|
|
819
|
-
|
|
820
|
-
|
|
815
|
+
_unused: CommIn.unPackInt8(),
|
|
816
|
+
_unused2: CommIn.unPackInt8(),
|
|
821
817
|
grenadeItem_: findCosmetics ? findItemById(CommIn.unPackInt16U()) : CommIn.unPackInt16U(),
|
|
822
818
|
meleeItem_: findCosmetics ? findItemById(CommIn.unPackInt16U()) : CommIn.unPackInt16U(),
|
|
823
819
|
x_: CommIn.unPackFloat(),
|
|
@@ -829,6 +825,7 @@ export class Bot {
|
|
|
829
825
|
yaw_: CommIn.unPackRadU(),
|
|
830
826
|
pitch_: CommIn.unPackRad(),
|
|
831
827
|
score_: CommIn.unPackInt32U(),
|
|
828
|
+
// the following are all stats
|
|
832
829
|
kills_: CommIn.unPackInt16U(),
|
|
833
830
|
deaths_: CommIn.unPackInt16U(),
|
|
834
831
|
streak_: CommIn.unPackInt16U(),
|
|
@@ -836,6 +833,7 @@ export class Bot {
|
|
|
836
833
|
totalDeaths_: CommIn.unPackInt32U(),
|
|
837
834
|
bestGameStreak_: CommIn.unPackInt16U(),
|
|
838
835
|
bestOverallStreak_: CommIn.unPackInt16U(),
|
|
836
|
+
// end stats
|
|
839
837
|
shield_: CommIn.unPackInt8U(),
|
|
840
838
|
hp_: CommIn.unPackInt8U(),
|
|
841
839
|
playing_: CommIn.unPackInt8U(),
|
|
@@ -1376,8 +1374,7 @@ export class Bot {
|
|
|
1376
1374
|
|
|
1377
1375
|
const findCosmetics = this.intents.includes(this.Intents.COSMETIC_DATA);
|
|
1378
1376
|
|
|
1379
|
-
const primaryWeaponItem = findItemById(primaryWeaponIdx);
|
|
1380
|
-
|
|
1377
|
+
const primaryWeaponItem = findCosmetics ? findItemById(primaryWeaponIdx) : primaryWeaponIdx;
|
|
1381
1378
|
const secondaryWeaponItem = findCosmetics ? findItemById(secondaryWeaponIdx) : secondaryWeaponIdx;
|
|
1382
1379
|
const hatItem = findCosmetics ? findItemById(hatIdx) : hatIdx;
|
|
1383
1380
|
const stampItem = findCosmetics ? findItemById(stampIdx) : stampIdx;
|
package/src/constants/guns.js
CHANGED
|
@@ -38,7 +38,9 @@ const Eggk47 = class _Eggk47 extends Gun {
|
|
|
38
38
|
this.shortReloadTime = 160;
|
|
39
39
|
|
|
40
40
|
this.weaponName = 'EggK-47';
|
|
41
|
+
this.internalName = 'Eggk47';
|
|
41
42
|
this.standardMeshName = 'eggk47';
|
|
43
|
+
|
|
42
44
|
this.rof = 3;
|
|
43
45
|
this.recoil = 7;
|
|
44
46
|
this.automatic = true;
|
|
@@ -67,8 +69,10 @@ const DozenGauge = class _DozenGauge extends Gun {
|
|
|
67
69
|
this.longReloadTime = 155;
|
|
68
70
|
this.shortReloadTime = 155;
|
|
69
71
|
|
|
70
|
-
this.weaponName = '
|
|
72
|
+
this.weaponName = 'Scrambler';
|
|
73
|
+
this.internalName = 'Dozen Gauge';
|
|
71
74
|
this.standardMeshName = 'dozenGauge';
|
|
75
|
+
|
|
72
76
|
this.rof = 8;
|
|
73
77
|
this.recoil = 10;
|
|
74
78
|
this.automatic = false;
|
|
@@ -121,8 +125,10 @@ const CSG1 = class _CSG1 extends Gun {
|
|
|
121
125
|
this.shortReloadTime = 165;
|
|
122
126
|
this.highPrecision = true;
|
|
123
127
|
|
|
124
|
-
this.weaponName = '
|
|
128
|
+
this.weaponName = 'Free Ranger';
|
|
129
|
+
this.internalName = 'CSG-1';
|
|
125
130
|
this.standardMeshName = 'csg1';
|
|
131
|
+
|
|
126
132
|
this.rof = 13;
|
|
127
133
|
this.recoil = 13;
|
|
128
134
|
this.automatic = false;
|
|
@@ -159,7 +165,9 @@ const Cluck9mm = class _Cluck9mm extends Gun {
|
|
|
159
165
|
this.shortReloadTime = 160;
|
|
160
166
|
|
|
161
167
|
this.weaponName = 'Cluck 9mm';
|
|
168
|
+
this.internalName = 'Cluck 9mm';
|
|
162
169
|
this.standardMeshName = 'cluck9mm';
|
|
170
|
+
|
|
163
171
|
this.rof = 4;
|
|
164
172
|
this.recoil = 6;
|
|
165
173
|
this.automatic = false;
|
|
@@ -199,7 +207,9 @@ const RPEGG = class _RPEGG extends Gun {
|
|
|
199
207
|
this.shortReloadTime = 170;
|
|
200
208
|
|
|
201
209
|
this.weaponName = 'RPEGG';
|
|
210
|
+
this.internalName = 'Eggsploder';
|
|
202
211
|
this.standardMeshName = 'rpegg';
|
|
212
|
+
|
|
203
213
|
this.rof = 40;
|
|
204
214
|
this.recoil = 60;
|
|
205
215
|
this.automatic = false;
|
|
@@ -236,7 +246,9 @@ const SMG = class _SMG extends Gun {
|
|
|
236
246
|
this.shortReloadTime = 190;
|
|
237
247
|
|
|
238
248
|
this.weaponName = 'Whipper';
|
|
249
|
+
this.internalName = 'SMEGG';
|
|
239
250
|
this.standardMeshName = 'smg';
|
|
251
|
+
|
|
240
252
|
this.rof = 10;
|
|
241
253
|
this.recoil = 7;
|
|
242
254
|
this.automatic = true;
|
|
@@ -276,7 +288,9 @@ const M24 = class _M24 extends Gun {
|
|
|
276
288
|
this.shortReloadTime = 144;
|
|
277
289
|
|
|
278
290
|
this.weaponName = 'Crackshot';
|
|
291
|
+
this.internalName = 'M2DZ';
|
|
279
292
|
this.standardMeshName = 'm24';
|
|
293
|
+
|
|
280
294
|
this.rof = 60;
|
|
281
295
|
this.recoil = 40;
|
|
282
296
|
this.automatic = false;
|
|
@@ -316,7 +330,9 @@ const AUG = class _AUG extends Gun {
|
|
|
316
330
|
this.shortReloadTime = 160;
|
|
317
331
|
|
|
318
332
|
this.weaponName = 'Tri-Hard';
|
|
333
|
+
this.internalName = 'AUG';
|
|
319
334
|
this.standardMeshName = 'aug';
|
|
335
|
+
|
|
320
336
|
this.rof = 15;
|
|
321
337
|
this.recoil = 18;
|
|
322
338
|
this.automatic = false;
|
package/src/constants/index.js
CHANGED
|
@@ -82,6 +82,16 @@ export const ShellStreaks = {
|
|
|
82
82
|
MiniEgg: 32
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
+
export const SocialMedias = {
|
|
86
|
+
0: 'Facebook',
|
|
87
|
+
1: 'Instagram',
|
|
88
|
+
2: 'Tiktok',
|
|
89
|
+
3: 'Discord',
|
|
90
|
+
4: 'Youtube',
|
|
91
|
+
5: 'Twitter',
|
|
92
|
+
6: 'Twitch'
|
|
93
|
+
}
|
|
94
|
+
|
|
85
95
|
export const SocialRewards = {
|
|
86
96
|
Discord: 'rew_1200',
|
|
87
97
|
Tiktok: 'rew_1208',
|
|
@@ -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
|
})
|
|
@@ -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
|
-
|
|
32
|
+
id_: string;
|
|
33
33
|
uniqueId_: string;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
-
|
|
84
|
+
raw: PlayerData;
|
|
62
85
|
name: string;
|
|
63
86
|
uniqueId: string;
|
|
64
87
|
playing: boolean;
|
|
65
|
-
|
|
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
|
-
|
|
101
|
+
streak: number;
|
|
78
102
|
hp: number;
|
|
79
103
|
hpShield: number;
|
|
80
104
|
streakRewards: number[];
|
|
@@ -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;
|