steamutils 1.2.34 → 1.2.36
Sign up to get free protection for your applications and to get access to all the features.
- package/SteamClient.js +6 -3
- package/index.js +17 -1
- package/package.json +1 -1
package/SteamClient.js
CHANGED
@@ -1423,6 +1423,9 @@ function SteamClient({
|
|
1423
1423
|
// steamClient.setPersona(SteamUser.EPersonaState.Online)
|
1424
1424
|
await sendHello()
|
1425
1425
|
|
1426
|
+
const isLongGame = true
|
1427
|
+
const maxRound = isLongGame ? 16 : 9
|
1428
|
+
|
1426
1429
|
if (apps.some(a => (a.game_id || a) == 730)) {
|
1427
1430
|
doSetInterval(function () {
|
1428
1431
|
const maps = [
|
@@ -1463,15 +1466,15 @@ function SteamClient({
|
|
1463
1466
|
]
|
1464
1467
|
|
1465
1468
|
if (richPresence.myScore === undefined) {
|
1466
|
-
richPresence.myScore = _.random(0,
|
1469
|
+
richPresence.myScore = _.random(0, maxRound)
|
1467
1470
|
}
|
1468
1471
|
if (richPresence.theirScore === undefined) {
|
1469
|
-
richPresence.theirScore = _.random(0,
|
1472
|
+
richPresence.theirScore = _.random(0, maxRound)
|
1470
1473
|
}
|
1471
1474
|
if (richPresence.map === undefined) {
|
1472
1475
|
richPresence.map = maps[Math.floor(Math.random() * maps.length)]
|
1473
1476
|
}
|
1474
|
-
if (richPresence.myScore ===
|
1477
|
+
if (richPresence.myScore === maxRound || richPresence.theirScore === maxRound) {
|
1475
1478
|
richPresence.myScore = 0
|
1476
1479
|
richPresence.theirScore = 0
|
1477
1480
|
richPresence.map = maps[Math.floor(Math.random() * maps.length)]
|
package/index.js
CHANGED
@@ -5993,7 +5993,7 @@ class SteamUser {
|
|
5993
5993
|
market_headertip_container_warning_el.find('ul.market_restrictions > li').each(function () {
|
5994
5994
|
const el = $(this);
|
5995
5995
|
el.find('a').remove()
|
5996
|
-
market_restrictions.push(el.text()
|
5996
|
+
market_restrictions.push(el.text().replaceAll(/\t/g,' ').replaceAll(/\s+/g,' ').trim())
|
5997
5997
|
})
|
5998
5998
|
return {
|
5999
5999
|
market_warning_header,
|
@@ -6003,6 +6003,22 @@ class SteamUser {
|
|
6003
6003
|
return {}
|
6004
6004
|
}
|
6005
6005
|
}
|
6006
|
+
|
6007
|
+
async getAmountSpentOnSteam() {
|
6008
|
+
const response = (await this._httpRequest({
|
6009
|
+
url: `https://help.steampowered.com/en/`,
|
6010
|
+
}))?.data
|
6011
|
+
if (!response) {
|
6012
|
+
return null
|
6013
|
+
}
|
6014
|
+
const $ = cheerio.load(response)
|
6015
|
+
const text = $('.help_event_limiteduser .help_event_limiteduser_spend').text()
|
6016
|
+
if (text?.startsWith("Amount Spent on Steam")) {
|
6017
|
+
return text
|
6018
|
+
} else {
|
6019
|
+
return null
|
6020
|
+
}
|
6021
|
+
}
|
6006
6022
|
}
|
6007
6023
|
|
6008
6024
|
export default SteamUser
|