Skip to content

Conversation

@Foowy
Copy link

@Foowy Foowy commented Jul 12, 2025

Changes for sleeve.js training issue provided by Storan ( #475 )
Changes for helpers.js and stanek.js tailing issue provided by ashugar ( #462 )

Changes for helpers.js and stanek.js tailing issue provided by ashugar
Copy link
Owner

@alainbryden alainbryden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution!

processId ??= ns.pid

/* no-tail option used in corresponding script */
if (close){
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missed adding this new optional "close" parameter to the function definition

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, the comment doesn't really make sense to me, perhaps you can explain

const trainingReserveFile = '/Temp/sleeves-training-reserve.txt';
const works = ['security', 'field', 'hacking']; // When doing faction work, we prioritize physical work since sleeves tend towards having those stats be highest
const trainStats = ['str', 'def', 'dex', 'agi'];
const trainStats = ['strength', 'defense', 'dexterity', 'agility'];
Copy link
Owner

@alainbryden alainbryden Jul 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@catloversg - you were the one to change this from long-form to 3-character codes back in your PR #467 here:
e3f9227#diff-4ca659d70c6b95a5c56e834df709c9166bd8c5d5d8f5c0940936c5ab59d4cac3R35
But now these folks are saying it needs to go back. Is this so?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'm seeing what's wrong here.

The sleeve stat name is named using the long form, e.g.:
ns.sleeve.getSleeve(1).skills['strength']

But when we go to the gym, the stat needs to be shortened to 3 characters:
ns.sleeve.setToGymWorkout(..., ..., 'str')

With the game currently accepting "strength" as the stat to train, everything is consistent, so I was using the same enum values both to get the stats, and to name the stat to train.

In 3.0, I won't be able to do that anymore, but it seems I can simply pass the first 3 characters of the trainStats enum value to the gym workout function and get away with it,

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. Gym APIs use the short form, while other APIs use the long form. Using slice(0, 3) like you do is fine. It's not ideal, but I don't think we will change these values again in the near future.

@alainbryden
Copy link
Owner

I appreciate your contribution to light a fire under my ass, really!

In this case, I'm going to have to reject and submit separate fixes, because each needs a bit of tweaking:

  • Re: Changes for sleeve.js training issue provided by Storan ( sleeve.js training error #475 ) - your change is actually just reverting a change that catloversg made a few months ago in preparation of a backwards-incompatible change to bitburner 3.0. The real fix needs to be a compromise between what each of you is trying to accomplish.
  • Re: Changes for helpers.js and stanek.js tailing issue provided by ashugar ( stanek.js: deprecated tail call update (refactor option included) #462 ) - you missed a bit of ashugar's proposed code - the code as given wouldn't work right (close parameter isn't defined)

Again, appreciate the contributions, always, but in this case I'll be closing and fixing both these issues a bit differently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants