Skip to content

NETSCRIPT: Add the 'cat' method to 'ns.singularity' #1999

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 23, 2025

Conversation

NagaOuroboros
Copy link
Contributor

@NagaOuroboros NagaOuroboros commented Mar 6, 2025

Motivation

While .lit files are easy to copy onto the 'home' server, doing so clutters up the root directory, and will only create more clutter as new .lit files get added in the future. As a first step to managing this, I've implemented the functionality of the cat terminal command as a method available on the ns.singularity namespace.

This addition should let players write their own 'remote file viewer' scripts once they've gotten SF4.

Scope

This PR only adds the new method itself, which is simply a 1:1 feature-for-feature implementation of the terminal equivalent. No new behaviors are added.

New API Method

ns.singularity.cat(filename) - Displays the content of a file on the currently connected server

Considerations

  • The RAM cost of the method is currently set at 0.5 before the SF4 multipliers. I would argue for lower, perhaps even 0.1, but I feel 0.5 is a reasonable upper limit. There is no gameplay advantage to this method—it is purely a quality of life addition—so I do not feel it deserves to be any higher, especially as it will often be used in conjunction with ns.singularity.connect.

@NagaOuroboros
Copy link
Contributor Author

Refactor

Changed the implementation to simply hook directly into the terminal command's logic. Also added the missing check for the player owning SF4.

@d0sboots d0sboots merged commit 1539c42 into bitburner-official:dev Mar 23, 2025
5 checks passed
antoinedube pushed a commit to antoinedube/bitburner-source that referenced this pull request Apr 20, 2025
@NagaOuroboros NagaOuroboros deleted the singularity-cat branch May 9, 2025 00:20
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