Commit Graph

447 Commits

Author SHA1 Message Date
catloversg 37d9284d33 MISC: Remove deprecated tail-related APIs (#2143) 2025-05-19 20:10:15 -07:00
G4mingJon4s 2b8c008be1 NETSCRIPT: Moved formatting functions to their own interface (#1635) 2025-05-14 09:13:35 -07:00
catloversg b53180ff1e MISC: Remove APIs that were deprecated a long time ago (#2088) 2025-05-10 22:10:48 -07:00
catloversg 31e6e4d74b MISC: Enforce stricter param check on ns.getBitNodeMultipliers and ns.hacknet.spendHashes (#2085) 2025-04-14 16:20:36 -07:00
Naga 0aaa28054a NETSCRIPT: Add functionality and support to fully allow Players to use IP addresses in place of hostnames (#1990) 2025-04-10 18:41:37 -07:00
Shy d28a06e764 API: dynamic imports with ns.dynamicImport() (#2036) 2025-04-09 18:49:01 -07:00
catloversg 41c497161f UI: Make BN-hint popups harder to be dismissed accidentally (#2021) 2025-03-22 23:59:38 -07:00
Naga b0165d5c2c NETSCRIPT: Store the value of Player.money in the returned object's moneyAvailable property when ns.getServer is called with "home" (#2024) 2025-03-12 18:17:57 -07:00
catloversg 4ef597bd37 BUGFIX: Some calculations return NaN due to Player.playtimeSinceLastAug being 0 in edge cases (#1985) 2025-03-01 09:06:58 -08:00
catloversg d6ee16cdb3 API: Move tail-related APIs to another namespace (#1935)
* API: Move tail-related APIs to another namespace

* Add missing RAM cost config

* Remove setTailFontSize from NS namespace
2025-02-01 21:43:56 -08:00
catloversg 2965f51879 API: Add a way to get the list of all factions (#1457) 2025-01-28 10:40:11 -08:00
G4mingJon4s ffae0045a4 CODINGCONTRACT: Add support for other answer formats (#1892) 2025-01-26 09:35:04 -08:00
catloversg b161142796 API: Add ns.renderTail (#1815) 2025-01-25 09:14:45 -08:00
catloversg 9bf408221c CODEBASE: Merge TypeAssertion files (#1922) 2025-01-24 11:06:39 -08:00
Yichi Zhang e6a1c344d3 NETSCRIPT: Log script kill immediately and identify the killing script. (#1907) 2025-01-12 21:07:01 -08:00
catloversg 8c19165323 BUGFIX: Grow log shows invalid values in edge cases (#1872) 2025-01-08 18:48:45 -08:00
catloversg 1cb2a83b4f UI: Share RAM to boost reputation gain (#1862) 2025-01-07 22:35:29 -08:00
G4mingJon4s c622291eff NETSCRIPT: Added changing tail font size through scripts (#1852) 2025-01-04 16:51:13 -08:00
nanogyth 85fa15c5a5 BUGFIX: update weaken results to correctly reflect change when close to minSecurity (#1887) 2024-12-29 18:08:55 -08:00
Jon Hartnett 99aeecbd0e BUGFIX: Fix ramOverride check (#1787)
ramOverride currently prevents you from actually using exactly all of a server's memory due to a bug in the ram check. Simply replace ">=" with ">" to allow the new ram to equal the max ram.

Test script:
```js
/** @param {NS} ns */
export async function main(ns) {
  ns.tprint(ns.ramOverride(8));
}
```
Expected output (on fresh save):
```js
8
```
Output before this commit:
```js
1.6
```
2024-11-20 12:47:55 -08:00
catloversg 75cf9c88b5 CODEBASE: Fix lint errors 3 (#1758)
This is a really big refactor because it actually *fixes* a lot of the lint errors instead of disabling them.
2024-11-14 08:18:57 -08:00
catloversg 72a63b15cb API: Return active SF levels in getOwnedSourceFiles and ResetInfo.ownedSF (#1761)
* DOCUMENTATION: Clarify getOwnedSourceFiles when player overrides active levels of SFs
* Return Player.activeSourceFiles instead of Player.sourceFiles
* Get rid of zeroes in the map
2024-11-10 22:56:57 -08:00
catloversg 650cf51acb DOCUMENTATION: Add more information for deprecated nFormat API (#1762) 2024-11-10 16:27:35 -08:00
catloversg f6502dd490 CODEBASE: Fix lint errors 1 (#1732) 2024-11-03 22:35:14 -08:00
David Walker 424ae160ba NETSCRIPT: Fix dynamicRamUsage returned by getRunningScript() (#1704)
Fixes #1700
2024-10-20 00:52:57 -07:00
G4mingJon4s 651b17739c NETSCRIPT: Add ns.self() as a free info function (#1636)
* added utility info

* moved info to running script

* fix for RAM cost

* description changes

Co-authored-by: David Walker <d0sboots@gmail.com>

* fixed wrong formatting

* Added parent to ignored fields

---------

Co-authored-by: David Walker <d0sboots@gmail.com>
2024-09-07 17:34:24 -07:00
catloversg 94eef8ecde BUGFIX: Fix inconsistencies of error handling in promise-based API (#1377) 2024-08-17 14:23:08 -07:00
David Walker 34db6e8b26 NETSCRIPT: Rework disableLog for efficiency (#1589)
The current implementation was naive; disableLog("ALL") was storing a
key for every function, and iterating over a different object to do it
(when iterating over objects is quite slow).

The common cases of Bitburner (and especially batching, where efficiency
matters most) are either never disabling anything, or disabling "ALL".
This optimizes for these two cases, at the expense of slightly more
complicated code to deal with the less-common edge cases.
2024-08-16 19:10:20 -07:00
catloversg e5a63b4116 MISC: Fix typos in NetscriptDefinitions.d.ts (#1546) 2024-08-04 13:09:50 -07:00
catloversg 1b9676c68e MISC: Clarify deprecation warning of ns.getTimeSinceLastAug() (#1535) 2024-08-04 00:01:34 -07:00
catloversg 783120c886 FEATURE: BitNode options (#1411) 2024-07-14 14:30:30 -07:00
David Walker 9c9a69f2e2 NETSCRIPT: Add ramOverride() function (#1346)
This adds a way to dynamically change the static RAM limit of a script,
which is also its current RAM usage. This makes it possible for scripts
to dynamically change their memory footprint, opening up new strategies
beyond current ram-dodging.

Calling functions still permanently increases the *dynamic* memory
limit; RAM-dodging is still the optimal strategy for avoiding RAM costs,
in that sense.

This also adds dynamicRamUsage to the info returned by
`getRunningScript`, to allow introspection on the currently needed ram.
2024-06-28 18:42:20 -07:00
David Walker 1c20a24079 MISC: Make spawn able to have 0 delay (#1333)
This eliminates a hole where spawn was unrelaible, because other scripts
could jump in and steal the RAM. It's not an API break, because 0 used
to be an invalid value.
2024-06-28 18:41:41 -07:00
catloversg fd8eae5cf5 MISC: Cancel spawned scripts in Bitverse (#1429) 2024-06-24 22:20:08 -07:00
catloversg 70383d9085 MISC: Change error message when spawning on an invalid server (#1370) 2024-06-07 13:23:04 -07:00
Michael Ficocelli ed59f325ef IPVGO: Ensure full name of method is recorded in the possibleLogs list, to be matched later (#1207) 2024-04-09 18:24:57 -07:00
catloversg fc8958af83 MISC: Remove jquery (#1167)
Changes wget, which was the only thing using it.
2024-03-20 14:20:29 -07:00
FoGsesipod 25ac8432fc BUGFIX: spawn() log reads "seconds" instead of "milliseconds" (#1158) 2024-03-11 15:25:02 -07:00
Snarling d61e12fdd1 API: Minor followup changes for #1059 (#1135) 2024-03-05 19:42:55 -05:00
Shy 4aaf845fca API: make ns.atExit add the callback to an array instead of setting it (#1059) 2024-03-05 19:22:45 -05:00
Snarling 4f4c6fe7e5 Move heart.break out of Extra.ts (#1133) 2024-03-04 18:36:14 -05:00
LJ a5f5c81912 API: Add karma to ns.getPlayer() & document ns.heart.break() (#1131) 2024-03-04 09:35:54 -05:00
Snarling 373ced2efe GO: Various changes before 2.6.0 (#1120) 2024-02-26 08:05:10 -05:00
LJ 1577467fe1 BUGFIX: Prevent renaming servers to hacknet. (#1112)
* Add hacknet check to renaming
* Handle manual server purchases
* Handle automated server purchases
* Remove unnecessary parenthesis

fixes #1111
2024-02-20 18:22:24 -08:00
LJ 27a8abbdec PORTS: Support all serializable data. (#1089)
A significant portion of players who use ports are passing objects through them. Currently they are required to handle that themselves via JSON serialization. This PR adds better support for passing objects; which is more convenient, extensive, and optimized (probably, more on this one later).

This adds zero overhead to existing (or when passing any primitive types) port usage, and also isn't a breaking change. The questions to debate here are:

Should objects be supported in the first place?
If so, how exactly do we want to serialize objects?
Based on an extensive discussion in Discord, the overwhelming majority answered "yes" to question one. As for question two, that has been much more hotly contested.

Ultimately, `structuredClone` was used, despite less-than-stellar performance, because other options were worse either in safety, speed, error-handling, or multiple of the above.
2024-02-17 19:15:17 -08:00
Caldwell 8c8af38a3a MISC: refactor weaken effect calculation (#1076)
so far we calculate the effect of weaken in three +1 places
ns.weaken
ns.weakenAnalyze
terminal weaken

and server.weaken where the bn mult is applied

i extracted the logic into a new netscript helper function getWeakenEffect
this gives us one place if we want to change the formula

a side effect i added the server.cpuCores to the terminal weaken to future proof it if the npc server core pr (#963) is merged
2024-02-16 17:18:16 -08:00
Caldwell 4d551915b3 MISC: move server constants into their own constant (#1075) 2024-02-10 04:13:42 -05:00
LJ fd5b0f8241 MISC: Use structuredClone() for deep cloning (#1077) 2024-02-10 04:10:19 -05:00
LJ 157ff8ea88 PORTS: Add ns.nextPortWrite() as a safer option (#1036) 2024-01-15 06:10:39 -05:00
Shockwave 7017f3c2f8 API: Fix serverExists() return true for not revealed servers (#1013) 2024-01-07 11:40:07 -05:00