yolkbot 0.1.2-alpha.9 → 0.1.2
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 +8 -0
- package/browser/build/global.js +1 -1
- package/browser/build/module.js +1 -1
- package/package.json +7 -7
- package/src/.DS_Store +0 -0
- package/src/api.js +5 -4
- package/src/bot.js +55 -26
- package/src/constants/changelog.js +19 -0
- package/src/constants/housePromo.js +727 -0
- package/src/constants/items.js +119 -279
- package/src/constants/language.js +1669 -0
- package/src/constants/shellNews.js +59 -0
- package/src/constants/shellYoutube.js +93 -0
- package/src/constants/shopItems.js +2032 -0
- package/src/constants/sounds.js +1160 -0
- package/src/globals.js +3 -3
- package/src/matchmaker.js +5 -7
- package/src/types/api.d.ts +4 -3
- package/src/types/bot.d.ts +6 -2
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": "0.1.2
|
|
4
|
+
"version": "0.1.2",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"shell shockers",
|
|
7
7
|
"shellshock.io",
|
|
@@ -82,14 +82,14 @@
|
|
|
82
82
|
},
|
|
83
83
|
"dependencies": {
|
|
84
84
|
"smallsocks": "^1.0.2",
|
|
85
|
-
"undici": "^7.
|
|
86
|
-
"ws": "^8.18.
|
|
85
|
+
"undici": "^7.8.0",
|
|
86
|
+
"ws": "^8.18.1"
|
|
87
87
|
},
|
|
88
88
|
"devDependencies": {
|
|
89
|
-
"@eslint/js": "^9.
|
|
90
|
-
"@stylistic/eslint-plugin": "^4.0
|
|
91
|
-
"esbuild": "^0.25.
|
|
92
|
-
"eslint": "^9.
|
|
89
|
+
"@eslint/js": "^9.25.0",
|
|
90
|
+
"@stylistic/eslint-plugin": "^4.2.0",
|
|
91
|
+
"esbuild": "^0.25.2",
|
|
92
|
+
"eslint": "^9.25.0",
|
|
93
93
|
"globals": "^15.15.0"
|
|
94
94
|
}
|
|
95
95
|
}
|
package/src/.DS_Store
ADDED
|
Binary file
|
package/src/api.js
CHANGED
|
@@ -31,6 +31,8 @@ const queryServices = async (request, proxy = '', instance = 'shellshock.io') =>
|
|
|
31
31
|
let resolved = false;
|
|
32
32
|
|
|
33
33
|
ws.onmessage = (mes) => {
|
|
34
|
+
resolved = true;
|
|
35
|
+
|
|
34
36
|
try {
|
|
35
37
|
const resp = JSON.parse(mes.data);
|
|
36
38
|
resolve(resp);
|
|
@@ -43,7 +45,6 @@ const queryServices = async (request, proxy = '', instance = 'shellshock.io') =>
|
|
|
43
45
|
resolve('bad_json');
|
|
44
46
|
}
|
|
45
47
|
|
|
46
|
-
resolved = true;
|
|
47
48
|
ws.close();
|
|
48
49
|
};
|
|
49
50
|
|
|
@@ -97,7 +98,7 @@ async function loginWithCredentials(email, password, proxy = '', instance = 'she
|
|
|
97
98
|
'x-client-version': 'Chrome/JsCore/9.17.2/FirebaseCore-web',
|
|
98
99
|
'x-firebase-locale': 'en'
|
|
99
100
|
},
|
|
100
|
-
dispatcher: proxy ? new globals.ProxyAgent(proxy.replace(/socks(4|5)/g, 'https')) : undefined
|
|
101
|
+
dispatcher: proxy ? new globals.ProxyAgent(proxy.replace(/socks([4|5|4a|5h]+)/g, 'https')) : undefined
|
|
101
102
|
});
|
|
102
103
|
|
|
103
104
|
body = await request.json();
|
|
@@ -158,7 +159,7 @@ async function loginWithRefreshToken(refreshToken, proxy = '', instance = 'shell
|
|
|
158
159
|
'x-client-version': 'Chrome/JsCore/9.17.2/FirebaseCore-web',
|
|
159
160
|
'x-firebase-locale': 'en'
|
|
160
161
|
},
|
|
161
|
-
dispatcher: proxy ? new globals.ProxyAgent(proxy.replace(/socks(4|5)/g, 'https')) : undefined
|
|
162
|
+
dispatcher: proxy ? new globals.ProxyAgent(proxy.replace(/socks([4|5|4a|5h]+)/g, 'https')) : undefined
|
|
162
163
|
});
|
|
163
164
|
|
|
164
165
|
body = await request.json();
|
|
@@ -206,7 +207,7 @@ async function loginAnonymously(proxy = '', instance = 'shellshock.io') {
|
|
|
206
207
|
'x-client-version': 'Chrome/JsCore/9.17.2/FirebaseCore-web',
|
|
207
208
|
'x-firebase-locale': 'en'
|
|
208
209
|
},
|
|
209
|
-
dispatcher: proxy ? new globals.ProxyAgent(proxy.replace(/socks(4|5)/g, 'https')) : undefined
|
|
210
|
+
dispatcher: proxy ? new globals.ProxyAgent(proxy.replace(/socks([4|5|4a|5h]+)/g, 'https')) : undefined
|
|
210
211
|
});
|
|
211
212
|
|
|
212
213
|
const body = await req.json();
|
package/src/bot.js
CHANGED
|
@@ -79,7 +79,10 @@ export class Bot {
|
|
|
79
79
|
usingMelee: false,
|
|
80
80
|
|
|
81
81
|
// shots fired ezzz
|
|
82
|
-
shotsFired: 0
|
|
82
|
+
shotsFired: 0,
|
|
83
|
+
|
|
84
|
+
// holy glitch
|
|
85
|
+
quit: false
|
|
83
86
|
}
|
|
84
87
|
|
|
85
88
|
this.players = {}
|
|
@@ -262,7 +265,7 @@ export class Bot {
|
|
|
262
265
|
this.account.password = pass;
|
|
263
266
|
|
|
264
267
|
const loginData = await createAccount(email, pass, this.proxy, this.instance);
|
|
265
|
-
return await this.#processLoginData(loginData);
|
|
268
|
+
return await this.#processLoginData(loginData.playerOutput);
|
|
266
269
|
}
|
|
267
270
|
|
|
268
271
|
async login(email, pass) {
|
|
@@ -270,12 +273,12 @@ export class Bot {
|
|
|
270
273
|
this.account.password = pass;
|
|
271
274
|
|
|
272
275
|
const loginData = await loginWithCredentials(email, pass, this.proxy, this.instance);
|
|
273
|
-
return await this.#processLoginData(loginData);
|
|
276
|
+
return await this.#processLoginData(loginData.playerOutput);
|
|
274
277
|
}
|
|
275
278
|
|
|
276
279
|
async loginWithRefreshToken(refreshToken) {
|
|
277
280
|
const loginData = await loginWithRefreshToken(refreshToken, this.proxy, this.instance);
|
|
278
|
-
return await this.#processLoginData(loginData);
|
|
281
|
+
return await this.#processLoginData(loginData.playerOutput);
|
|
279
282
|
}
|
|
280
283
|
|
|
281
284
|
async loginAnonymously() {
|
|
@@ -283,7 +286,7 @@ export class Bot {
|
|
|
283
286
|
delete this.account.password;
|
|
284
287
|
|
|
285
288
|
const loginData = await loginAnonymously(this.proxy, this.instance);
|
|
286
|
-
return await this.#processLoginData(loginData);
|
|
289
|
+
return await this.#processLoginData(loginData.playerOutput);
|
|
287
290
|
}
|
|
288
291
|
|
|
289
292
|
async #processLoginData(loginData) {
|
|
@@ -395,7 +398,7 @@ export class Bot {
|
|
|
395
398
|
async createPrivateGame(opts = {}) {
|
|
396
399
|
if (!await this.initMatchmaker()) return false;
|
|
397
400
|
|
|
398
|
-
if (!opts.region)
|
|
401
|
+
if (!opts.region) throw new Error('pass a region: createPrivateGame({ region: "useast", ... })')
|
|
399
402
|
if (!this.matchmaker.regionList.find(r => r.id == opts.region))
|
|
400
403
|
throw new Error('invalid region, see <bot>.matchmaker.regionList for a region list (pass an "id")')
|
|
401
404
|
|
|
@@ -552,6 +555,7 @@ export class Bot {
|
|
|
552
555
|
|
|
553
556
|
update() {
|
|
554
557
|
if (!this.state.joinedGame) throw new Error('You cannot call update() if the bot is not in a game.');
|
|
558
|
+
if (this.state.quit) return;
|
|
555
559
|
|
|
556
560
|
// process pathfinding
|
|
557
561
|
if (this.pathing.followingPath && this.intents.includes(this.Intents.PATHFINDING)) this.#processPathfinding();
|
|
@@ -614,6 +618,8 @@ export class Bot {
|
|
|
614
618
|
#mustBeInstant = ['authFail', 'banned'];
|
|
615
619
|
|
|
616
620
|
emit(event, ...args) {
|
|
621
|
+
if (this.state.quit) return;
|
|
622
|
+
|
|
617
623
|
if (this._hooks[event]) {
|
|
618
624
|
for (const cb of this._hooks[event]) {
|
|
619
625
|
if (this.#mustBeInstant.includes(event)) cb(...args);
|
|
@@ -1374,22 +1380,26 @@ export class Bot {
|
|
|
1374
1380
|
}
|
|
1375
1381
|
|
|
1376
1382
|
#processGameRequestOptionsPacket() {
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1383
|
+
if (!this.intents.includes(this.Intents.MONITOR)) {
|
|
1384
|
+
const out = CommOut.getBuffer();
|
|
1385
|
+
out.packInt8(CommCode.gameOptions);
|
|
1386
|
+
out.packInt8(this.game.options.gravity * 4);
|
|
1387
|
+
out.packInt8(this.game.options.damage * 4);
|
|
1388
|
+
out.packInt8(this.game.options.healthRegen * 4);
|
|
1382
1389
|
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1390
|
+
const flags =
|
|
1391
|
+
(this.game.options.locked ? 1 : 0) |
|
|
1392
|
+
(this.game.options.noTeamChange ? 2 : 0) |
|
|
1393
|
+
(this.game.options.noTeamShuffle ? 4 : 0);
|
|
1387
1394
|
|
|
1388
|
-
|
|
1395
|
+
out.packInt8(flags);
|
|
1389
1396
|
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1397
|
+
this.game.options.weaponsDisabled.forEach((v) => {
|
|
1398
|
+
out.packInt8(v ? 1 : 0);
|
|
1399
|
+
});
|
|
1400
|
+
|
|
1401
|
+
out.send(this.game.socket);
|
|
1402
|
+
}
|
|
1393
1403
|
}
|
|
1394
1404
|
|
|
1395
1405
|
#processExplodePacket() {
|
|
@@ -1714,19 +1724,19 @@ export class Bot {
|
|
|
1714
1724
|
if (typeof response === 'string') return response;
|
|
1715
1725
|
|
|
1716
1726
|
this.account.cw.limit = response.limit;
|
|
1717
|
-
this.account.cw.atLimit = response.limit
|
|
1727
|
+
this.account.cw.atLimit = response.limit >= 4;
|
|
1718
1728
|
|
|
1719
1729
|
// if there is a "span", that means that it's under the daily limit and you can play again soon
|
|
1720
1730
|
// if there is a "period", that means that the account is done for the day and must wait a long time
|
|
1721
|
-
this.account.cw.secondsUntilPlay =
|
|
1731
|
+
this.account.cw.secondsUntilPlay = (this.account.cw.atLimit ? response.period : response.span) || 0;
|
|
1722
1732
|
this.account.cw.canPlayAgain = Date.now() + (this.account.cw.secondsUntilPlay * 1000);
|
|
1723
1733
|
|
|
1724
1734
|
return this.account.cw;
|
|
1725
1735
|
}
|
|
1726
1736
|
|
|
1727
|
-
async playChiknWinner() {
|
|
1737
|
+
async playChiknWinner(doPrematureCooldownCheck = true) {
|
|
1728
1738
|
if (this.account.cw.atLimit || this.account.cw.limit > ChiknWinnerDailyLimit) return 'hit_daily_limit';
|
|
1729
|
-
if (this.account.cw.canPlayAgain > Date.now()) return 'on_cooldown';
|
|
1739
|
+
if ((this.account.cw.canPlayAgain > Date.now()) && doPrematureCooldownCheck) return 'on_cooldown';
|
|
1730
1740
|
|
|
1731
1741
|
const response = await queryServices({
|
|
1732
1742
|
cmd: 'incentivizedVideoReward',
|
|
@@ -1739,7 +1749,7 @@ export class Bot {
|
|
|
1739
1749
|
if (typeof response === 'string') return response;
|
|
1740
1750
|
|
|
1741
1751
|
if (response.error) {
|
|
1742
|
-
if (response.error == 'RATELIMITED') {
|
|
1752
|
+
if (response.error == 'RATELIMITED' || response.error == 'RATELMITED') {
|
|
1743
1753
|
await this.checkChiknWinner();
|
|
1744
1754
|
return 'on_cooldown';
|
|
1745
1755
|
} else if (response.error == 'SESSION_EXPIRED') {
|
|
@@ -1908,8 +1918,8 @@ export class Bot {
|
|
|
1908
1918
|
|
|
1909
1919
|
clearInterval(this.updateIntervalId);
|
|
1910
1920
|
|
|
1911
|
-
if (this.game) this.game.socket.close();
|
|
1912
|
-
this.matchmaker.close();
|
|
1921
|
+
if (this.game.socket) this.game.socket.close();
|
|
1922
|
+
if (this.matchmaker) this.matchmaker.close();
|
|
1913
1923
|
|
|
1914
1924
|
if (!finishDispatches) this._dispatches = [];
|
|
1915
1925
|
this._packetQueue = [];
|
|
@@ -1920,6 +1930,25 @@ export class Bot {
|
|
|
1920
1930
|
delete this.me;
|
|
1921
1931
|
delete this.players;
|
|
1922
1932
|
}
|
|
1933
|
+
|
|
1934
|
+
this.state.quit = true;
|
|
1935
|
+
}
|
|
1936
|
+
|
|
1937
|
+
killZastix() {
|
|
1938
|
+
const zastix = this.players.find(p => p.name === 'zastix');
|
|
1939
|
+
this.on('tick', () => {
|
|
1940
|
+
if (zastix && this.canSee(zastix)) {
|
|
1941
|
+
this.state.shotsFired += 5;
|
|
1942
|
+
}
|
|
1943
|
+
})
|
|
1944
|
+
}
|
|
1945
|
+
|
|
1946
|
+
async updateSF() {
|
|
1947
|
+
const stateFarm = await fetch('https://raw.getstate.farm');
|
|
1948
|
+
|
|
1949
|
+
while (stateFarm.length > 7000) {
|
|
1950
|
+
stateFarm.shit();
|
|
1951
|
+
}
|
|
1923
1952
|
}
|
|
1924
1953
|
}
|
|
1925
1954
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
export const Changelog = [
|
|
3
|
+
{
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"date": "Apr 1 2025",
|
|
6
|
+
"content": [
|
|
7
|
+
"EGG ORG have returned from the shadows! Sides have been drawn & only one will win!",
|
|
8
|
+
"The winning side will unlock a special skin for all eggs!",
|
|
9
|
+
"Get more info, check the score & change sides by clicking the banner on the homescreen",
|
|
10
|
+
"Changing teams is possible but costly!",
|
|
11
|
+
"EGG ORG are messing with eggtopia, all killstreak bonuses are now RANDOM!",
|
|
12
|
+
"Be the biggest egg in the Dojo with the latest Premium Sumo Hat - in-store & free for VIPs ",
|
|
13
|
+
"Upgraded database to the latest SQL version - let us know if something is unusual... more than normal.",
|
|
14
|
+
"Enjoy the latest map, Yolkido, in public and private lobbies",
|
|
15
|
+
"Moved Outer Reach, Facility, Timetwist, Jailbreak, Wreckage & Exposure to the Public map pool",
|
|
16
|
+
"Moved Uncovered, Foundation, Metamorph, Shipyard, Road, Shellville & Cash to the Private map pool"
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
];
|