steamutils 1.4.17 → 1.4.19
Sign up to get free protection for your applications and to get access to all the features.
- package/SteamClient.js +2646 -2630
- package/package.json +1 -1
- package/test_steamclient.js +49 -49
package/package.json
CHANGED
package/test_steamclient.js
CHANGED
@@ -1,49 +1,49 @@
|
|
1
|
-
import SteamUser from "./index.js";
|
2
|
-
import axios from "axios";
|
3
|
-
import * as cherrio from "cheerio";
|
4
|
-
import SteamClient from "./SteamClient.js";
|
5
|
-
import { sleep } from "./utils.js";
|
6
|
-
import SteamID from "steamid";
|
7
|
-
|
8
|
-
(async function () {
|
9
|
-
// const loginResult = await SteamUser.communityLogin({
|
10
|
-
// username: "abc",
|
11
|
-
// password: "xyz",
|
12
|
-
// })
|
13
|
-
// console.log(loginResult.cookie);
|
14
|
-
// const user = new SteamUser(loginResult.cookie)
|
15
|
-
|
16
|
-
const cookie = "";
|
17
|
-
const steamClient = new SteamClient({
|
18
|
-
cookie,
|
19
|
-
isAutoPlay: true,
|
20
|
-
isPartyRegister: false,
|
21
|
-
});
|
22
|
-
let redeemFreeReward = false;
|
23
|
-
steamClient.onEvent("csgoOnline", async function (data) {
|
24
|
-
const personalStore = data.personalStore;
|
25
|
-
if (!personalStore) return;
|
26
|
-
const example = {
|
27
|
-
items: [38468732624, 38468732625, 38468732626, 38468732627],
|
28
|
-
generation_time: 1719374753000,
|
29
|
-
redeemable_balance: 2,
|
30
|
-
};
|
31
|
-
|
32
|
-
console.log(personalStore.items);
|
33
|
-
console.log(personalStore.redeemable_balance);
|
34
|
-
if (!redeemFreeReward) {
|
35
|
-
redeemFreeReward = true;
|
36
|
-
|
37
|
-
let itemid = 38468732624;
|
38
|
-
// itemid = SteamID.fromIndividualAccountID(itemid).getSteamID64();
|
39
|
-
await steamClient.redeemFreeReward([itemid]);
|
40
|
-
await sleep(5000);
|
41
|
-
steamClient.offAutoGamePlay();
|
42
|
-
await sleep(1000);
|
43
|
-
steamClient.autoGamePlay();
|
44
|
-
} else {
|
45
|
-
process.exit(1);
|
46
|
-
}
|
47
|
-
});
|
48
|
-
steamClient.init();
|
49
|
-
})();
|
1
|
+
import SteamUser from "./index.js";
|
2
|
+
import axios from "axios";
|
3
|
+
import * as cherrio from "cheerio";
|
4
|
+
import SteamClient from "./SteamClient.js";
|
5
|
+
import { sleep } from "./utils.js";
|
6
|
+
import SteamID from "steamid";
|
7
|
+
|
8
|
+
(async function () {
|
9
|
+
// const loginResult = await SteamUser.communityLogin({
|
10
|
+
// username: "abc",
|
11
|
+
// password: "xyz",
|
12
|
+
// })
|
13
|
+
// console.log(loginResult.cookie);
|
14
|
+
// const user = new SteamUser(loginResult.cookie)
|
15
|
+
|
16
|
+
const cookie = "";
|
17
|
+
const steamClient = new SteamClient({
|
18
|
+
cookie,
|
19
|
+
isAutoPlay: true,
|
20
|
+
isPartyRegister: false,
|
21
|
+
});
|
22
|
+
let redeemFreeReward = false;
|
23
|
+
steamClient.onEvent("csgoOnline", async function (data) {
|
24
|
+
const personalStore = data.personalStore;
|
25
|
+
if (!personalStore) return;
|
26
|
+
const example = {
|
27
|
+
items: [38468732624, 38468732625, 38468732626, 38468732627],
|
28
|
+
generation_time: 1719374753000,
|
29
|
+
redeemable_balance: 2,
|
30
|
+
};
|
31
|
+
|
32
|
+
console.log(personalStore.items);
|
33
|
+
console.log(personalStore.redeemable_balance);
|
34
|
+
if (!redeemFreeReward) {
|
35
|
+
redeemFreeReward = true;
|
36
|
+
|
37
|
+
let itemid = 38468732624;
|
38
|
+
// itemid = SteamID.fromIndividualAccountID(itemid).getSteamID64();
|
39
|
+
await steamClient.redeemFreeReward([itemid]);
|
40
|
+
await sleep(5000);
|
41
|
+
steamClient.offAutoGamePlay();
|
42
|
+
await sleep(1000);
|
43
|
+
steamClient.autoGamePlay();
|
44
|
+
} else {
|
45
|
+
process.exit(1);
|
46
|
+
}
|
47
|
+
});
|
48
|
+
steamClient.init();
|
49
|
+
})();
|