Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

salien-script-js

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

salien-script-js - npm Package Compare versions

Comparing version 0.0.15 to 0.0.16

2

package.json
{
"name": "salien-script-js",
"version": "0.0.15",
"version": "0.0.16",
"description": "A easy to install, run and update Node.js script for the Steam salien mini-game.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -205,5 +205,6 @@ /**

const max = 180;
const defaultAllowedFailures = 10;
let nextHeal = Math.floor(new Date().getTime() / 1000) + Math.floor(Math.random() * (max - min + 1) + min);
let allowedBossFails = 10;
let allowedBossFails = defaultAllowedFailures;

@@ -226,3 +227,3 @@ // eslint-disable-next-line no-constant-condition

// eslint-disable-next-line no-underscore-dangle
if (Number(report.___headers.get('x-eresult')[0]) !== 1) {
if (Number(report.___headers.get('x-eresult')) !== 1 && Number(report.___headers.get('x-eresult')) !== 93) {
allowedBossFails -= 1;

@@ -235,2 +236,5 @@

// if we didn't get an error, reset the allowed failure count
allowedBossFails = defaultAllowedFailures;
if (!report.boss_status) {

@@ -244,9 +248,20 @@ this.logger('@@ Boss -- Waiting...');

// TODO: support logging of boss_status and players
// https://github.com/SteamDatabase/SalienCheat/blob/master/cheat.php#L203
if (report.boss_status.boss_players) {
console.log(''); // eslint-disable-line no-console
// TODO: format player name better so it doesn't screw up our neat output
report.boss_status.boss_players.forEach(player => {
let scoreCard = ` ${`${player.name}`.padEnd(30)}`;
scoreCard += ` - HP: ${chalk.yellow(`${player.hp}`.padStart(6))} / ${`${player.max_hp}`.padStart(6)}`;
scoreCard += ` - XP Gained: ${chalk.yellow(`${Number(player.xp_earned).toLocaleString()}`.padStart(12))}`;
this.logger(scoreCard);
});
console.log(''); // eslint-disable-line no-console
}
if (report.game_over) {
this.logger('@@ Boss -- The battle is over!');
return;
throw new SalienScriptRestart('Boss battle is over!');
}

@@ -262,5 +277,5 @@

// TODO: this message could be far prettier
let bossStatusMsg = `@@ Boss -- HP: ${Number(report.boss_status.boss_hp)}`;
bossStatusMsg += `/${Number(report.boss_status.boss_max_hp)}`;
let bossStatusMsg = `@@ Boss -- HP: ${Number(report.boss_status.boss_hp).toLocaleString()}`;
bossStatusMsg += ` / ${Number(report.boss_status.boss_max_hp).toLocaleString()}`;
bossStatusMsg += ` (${getPercentage(report.boss_status.boss_hp / report.boss_status.boss_max_hp)}%)`;
bossStatusMsg += ` - Lasers: ${report.num_laser_uses}`;

@@ -276,3 +291,9 @@ bossStatusMsg += ` - Team Heals: ${report.num_team_heals}`;

async doGameLoop() {
let leaveAttempts = 0;
while (this.currentPlanetAndZone.id !== this.steamThinksPlanet) {
if (leaveAttempts > 3) {
throw new SalienScriptRestart('Unable to leave planet...');
}
this.steamThinksPlanet = await this.leaveCurrentGame(this.currentPlanetAndZone.id);

@@ -285,2 +306,4 @@

}
leaveAttempts += 1;
}

@@ -287,0 +310,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc