Commit Graph

551 Commits

Author SHA1 Message Date
G4mingJon4s
d01ba91654
SINGULARITY: Added aug and node identifiers (timestamps of last resets) (#472) 2023-04-12 13:13:42 -04:00
Snarling
f761eed377
NETSCRIPT: Type correctness for getServer (#476) 2023-04-11 15:12:55 -04:00
omuretsu
f74002cce0 Fix and rebuild doc 2023-04-07 07:49:11 -04:00
quacksouls
4ade263ae8
DOC: typo fixes in sleeves API (#467)
A bunch of typographical fixes in the documentation of the Sleeve API.
2023-04-07 07:45:14 -04:00
T.J. Eckman
677686fa20
SINGULARITY: getCompanyPositionInfo (#460) 2023-04-04 12:00:54 -04:00
T.J. Eckman
df334ea6de
SINGULARITY: Added getCompanyPositions (#459)
Also workForCompany will throw an error if provided a bad company name, instead of returning false
2023-04-01 21:30:46 -04:00
omuretsu
798da75d83 renameServer changes
* Update doc error, regenerate docs
* Update a bad error message in renamePurchasedServer@serverPurchases.ts
* restore true/false return (removed in #450 due to miscommunication)
2023-03-28 16:10:24 -04:00
Zelow79
eb8bcd00e3
NETSCRIPT: reduce RAM cost for renamePurchasedServer to 0 (#450) 2023-03-28 16:01:09 -04:00
David Walker
2b54c6c9b9
NETSCRIPT: Add ramOverride as a RunOption (#441)
Allows overriding the static ram calculation. Dynamic ram limit still applies.
2023-03-22 10:09:12 -04:00
David Walker
98f7f473b4
NETSCRIPT: Add "temporary" as a RunOption to run/exec/spawn (#432) 2023-03-21 18:54:49 -04:00
Mughur
be5bba8ad6
small fixes (#429) 2023-03-18 03:34:28 +02:00
Mughur
1f98eecb57
CORP: rework (#428)
* corp overhaul: Corp production quality now depends on materials

* corp overhaul: Product price can be set separately for each city

* corp overhaul: export uses relatives

* corp overhaul: ignore energy in quality

* corp overhaul: getProduct() is city dependant

* corp overhaul: bulkbuy available from start

* corp overhaul: add multibuy for leveled upgrads

* corp overhaul: changes to UI

* corp overhaul: base quality 1, reqmat changes

* corp overhaul: puchased material quality is 1

* corp overhaul: get rid of the text box from ta2

* corp overhaul: sold shares limitations

* corp overhaul: coffee -> tea, training -> intern

* corp overhaul: smartsupply has multiple options

* corp overhaul: restart, literature, investore, ui

* corp overhaul: nerf advertising

* corp overhaul: bunch of stuff
2023-03-18 03:12:43 +02:00
omuretsu
057aeaea83 Doc update
* Added notes about whether ns API layers contain spoilers.
* Add some more info to checkFactionInvitation doc
2023-03-08 01:39:05 -05:00
omuretsu
c2cd5845b2 Refactor ls 2023-03-07 08:04:08 -05:00
Snarling
e74dfe9b79
NETSCRIPTSLEEVE: Add cyclesWorked to ns.sleeve.getTask return (#409) 2023-03-07 05:30:15 -05:00
omuretsu
75481aa195 Fix growthAnalyzeSecurity doc
Also a format fix from a previous sloppy commit
2023-02-28 09:57:02 -05:00
T.J. Eckman
33f0150d25
BUGFIX: Memory Leak in NetscriptPorts (#399)
Co-authored-by: Snarling <84951833+Snarling@users.noreply.github.com>
2023-02-27 19:54:04 -05:00
quacksouls
18eeb7c4e1
Fix doc typo for ns.stock.getPosition (#390) 2023-02-24 22:27:55 -05:00
Snarling
d3f9554a6e
2.2.2 Release (#378) 2023-02-21 09:44:18 -05:00
omuretsu
6b8ae1b351 Change high% display to mult form
Also includes some documentation updates from a previous PR (sleeve.setToIdle)
2023-02-19 15:24:27 -05:00
Mughur
2bd5741b22
Merge pull request #371 from d0sboots/hacking
NETSCRIPT: Add `additionalMsec` to BasicHGWOptions
2023-02-19 07:42:11 +02:00
Zelow79
028199aa7d
SLEEVE: Add sleeve.setToIdle function (#374) 2023-02-19 00:13:23 -05:00
omuretsu
bd4fe19fde Fix percent display at large values 2023-02-18 08:03:16 -05:00
David Walker
53755dd573 NETSCRIPT: Add additionalMsec to BasicHGWOptions
This option adds additional time to the sleep in hack/grow/weaken before
the command takes effect. The critical difference between this and doing
your own sleep is that it creates a single, uninterruptible sleep: This
opens up multiple new avenues of gameplay for batching.

Note that use of this new feature is theoretically always suboptimal,
since extending the sleep time wastes RAM.
2023-02-17 00:01:41 -08:00
David Walker
ed59f4bfe7
NETSCRIPT: Add growThreads to formulas, improve docs for hacking functions (#330) 2023-02-14 17:38:51 -05:00
Snarling
b9a2953fa6
Add totalExperience property to getOffice (#367) 2023-02-14 01:38:22 -05:00
Snarling
08e71c732b
Threads are a positive integer (#366)
* Added new positive integer ns validation helper
* `run`, `exec`, and `spawn` verify threads as a positive integer.
* `run` terminal command also fails if the provided threadcount is not a positive integer.
* Removed some references to .script files in various documentation, and removed some of the NS1 example blocks
2023-02-14 01:32:01 -05:00
Snarling
b0bdf0c7ad
DOC: Improve ns.kill documentation (#365) 2023-02-13 21:50:38 -05:00
Snarling
b4074328ec
UI: Added new locale-aware and configurable number formatting (#354) 2023-02-11 13:18:50 -05:00
T.J. Eckman
a141431e08 CORP: Move Sale after Export in Corp States 2023-01-30 19:15:56 -05:00
Mughur
6369ab434b Doc changes 2023-01-30 20:51:00 +02:00
Mughur
9c365d0da5 small fixes 2023-01-24 23:28:53 +02:00
Zelow79
5f923a348c
NETSCRIPT: Added cyclesWorked to certain sleeve.getTask returns, and added bladeburner.getActionSuccesses (#324) 2023-01-15 23:50:54 -05:00
Mughur
7e183c4e4a Updated ReadTheDocs links 2023-01-06 15:24:10 +02:00
David Walker
4eef9eec03
NETSCRIPT: More ns Proxy changes (#297) 2023-01-05 20:41:24 -05:00
omuretsu
4ab29e9c60 Fix minimum corp employee stat
* minEmployeeDecay is now part of CorpConstants and has a value of 10. This replaces Office.minEne/minMor/minHap
* Also removed some unnecessary files in dist/ext for MathJax
* Rebuilt documentation to remove minHap/minMor/minEne from getOffice, and add minEmployeeDecay to corporation.getConstants
2023-01-03 11:55:50 -05:00
Mughur
1baa615def
MISC: small fixes (#270)
* infiltration gain bug fix
* fix corp division description
* avoid some issues with Infinity at super high NFG levels
Co-authored-by: Daniel Perez Alvarez <danielpza@protonmail.com>
2023-01-02 13:51:59 -05:00
omuretsu
0ec4ef31ab 2.2 2023-01-02 13:20:25 -05:00
zerbosh
7d98c680e5
SLEEVE: added storedCycles to getSleeve() (#279) 2023-01-02 09:45:51 -05:00
Snarling
fb1f95c26e
VARIOUS: Various changes prior to release 2.2 (#271)
See PR #271 description
2022-12-29 20:28:53 -05:00
zerbosh
24ad342203
getCorporation() returns division names (#266) 2022-12-29 04:30:16 -05:00
Mughur
5c80655d62
NETSCRIPT: Added ns.corporation.issueNewShares function (#261) 2022-12-25 03:35:18 -05:00
Mughur
556fe8dd33
NETSCRIPT: Added ns.corporation.getConstants, replacing many other corporation getter functions (#260) 2022-12-25 03:33:13 -05:00
lucebac
5a86be8714
Update doc for ns.scp (#262) 2022-12-21 14:56:08 -05:00
omuretsu
1dec0d00bd Add documentation for ns.pid 2022-12-13 09:09:12 -05:00
quacksouls
6034e1c3fa
DOC: CORP: typo fixes in hire AdVert functions (#237) 2022-12-01 11:41:52 -05:00
Snarling
0fb7200b4b
STOCK: ns.stock.getOrganization added for getting org from stock symbol (#234)
Authored-by: SamuraiNinjaGuy <branmiller+bitburner@gmail.com>
2022-11-28 10:33:28 -05:00
Snarling
837c6bd1c2
CONTRACT: codingcontract.attempt always returns a string (#231)
* ns.codingcontract always returns a string (reward on success, empty on fail), simplifying usage and documentation of function.
* Because of the above, return value still works when used as a boolean, as long as no direct equality comparison to true/false.
* Documentation expanded and examples added.
Co-authored by @quacksouls
2022-11-28 09:15:09 -05:00
Burhanuddin Mustafa Lakdawala
675c2a0456
DOC: Update documentation for limitMaterialProduction and limitProductProduction (#221) 2022-11-26 21:06:47 -05:00
Snarling
e7fc0fbb03
Fix documentation for ns.sleeve (#227) 2022-11-24 08:19:51 -05:00
Snarling
6616f7ba15
DOCS: Update documentation for ns.args (#220) 2022-11-21 12:19:16 -05:00
Snarling
65cd14e33b
DOC: Add ns documentation for possible sleeve tasks (#217)
* Add specific types for sleeve tasks
* Moved LocationName enum to overall enums file
* Add LocationName enum to those provided to player
* remove trailing s on CompanyPosNames enum (now CompanyPosName, in line with LocationName)
* Also regenerated all ns documentation. This leads to an expected error when checking for generated files, because PRs should not normally touch markdown files. Also leads to a lint failure in generated file bitburner.d.ts
* also removed some exporting from NetscriptDefinitions.d.ts for anything that wasn't imported somewhere else.
2022-11-20 12:07:22 -05:00
Snarling
88d51e9a7e
MISC: A bunch of enums stuff. (#212)
* Some game enums moved to utils/enums. Others can eventually be moved there as well.
* findEnumMember function for performing fuzzy matching of player input with enum members, without needing separate fuzzy functions for every enum.
* Also used findEnumMember for safely loading save games (allows case changes in enum values)
* Changed capitalization on some enums.
* BREAKING: removed classGains work formulas function
* Split ClassType enum into UniversityClassType and GymType.
* Added universityGains and gymGains work formulas functions
* Provided the new split enums to the player on ns.enums.
2022-11-20 08:37:11 -05:00
Snarling
c669e473d1
SLEEVE: Fixed inconsistencies in how sleeve work rewards are handled. (#211) 2022-11-10 21:56:46 -05:00
Snarling
b275f88053
NETSCRIPT: Expose more enums for player use (#198)
* Add support for enums at other ns layers
* APIWrapper: simplified wrapping algorithm and modified to just use cloneDeep to copy enums instead of recursively wrapping enums as if they were new API layers
* Improve APIWrapper typing
* Changed some typings at RamCostGenerator to allow for enums at different levels without enums needing a ram cost
* Added enums to ns.corporation, removed getter functions that were being used instead.
* Add FactionWorkType for player use
* Add ClassType and CompanyWorkPos enums
* Change netscriptDefinitions to expect members of these new enums where appropriate.
2022-11-09 13:46:21 -05:00
Snarling
8e0e0eaa88
NETSCRIPT: ns.sleeve.getSleeve added. getPlayer and getSleeve can both be used for formulas. (#200)
* BREAKING CHANGE: Removed getSleeveStats and getSleeveInformation because this info is provided by getSleeve in a more usable form.
* BREAKING CHANGE: Removed tor, inBladeburner, and hasCorporation fields from ns.getPlayer. Functionality still exists via added functions ns.hasTorRouter, ns.corporation.hasCorporation, and ns.bladeburner.inBladeburner.
* Separated ns definitions for Person, Sleeve, and Player interfaces with both Player and Sleeve just extending Person.
Added getSleeve, which provides a Sleeve object similar to getPlayer.
* Renamed the sleeve ns layer's interface as sleeve lowercase because of name conflict. todo: May move all the ns layers interface names to lowercase for consistency
* Added ns.formulas.work.crimeSuccessChance and reworked to allow both sleeve and player calculations.
* Removed internal Person.getIntelligenceBonus function which was just a wrapper for calculateIntelligenceBonus. Any use of the former in formulas creates a conflict where ns-provided Person objects throw an error.
* Renamed helpers.player to helpers.person for netscript person validation. Reduced number of fields validated due to Person being a smaller interface.
* Fixed bug in bladeburner where Player multipliers and int were being used no matter which person was performing the task
* Fixed leak of Player.jobs at ns.getPlayer
* Person / Player / Sleeve classes now implement the netscript equivalent interfaces. Netscript helper for person no longer asserts that it's a real Person class member, only that it's a Person interface. Functions that use netscript persons have been changed to expect just a person interface to prevent needing this incorrect type assertion.
2022-11-09 07:26:26 -05:00
Snarling
9e869bc876
NETSCRIPT: Add ns.formulas.work.companyGains function (#195)
* added ns.formulas.work.companyGains.
* Removed Work/Formulas folder, added Work/Formulas.ts
* CompanyPosition.calculateJobPerformance now takes in a Person instead of taking in a full set of stats, and it takes INT into account.
* formulas.crimeGains takes in a person object.
* Renamed ns Player type to Person.
* added multWorkStats, which multiplies a WorkStats object with a multipliers object.
* Remove unused types in NetscriptDefinitons.d.ts
* reuse formulas code in other parts of game
* getSleeveInformation also returns skills

Co-authored-by: Alexey <alexey.kozhemiakin@gmail.com>
2022-11-06 17:27:04 -05:00
Snarling
7ef2675e2c
Make writePort synchronous (#193) 2022-11-04 07:56:20 -04:00
LJ
9eb5f7ef23
NETSCRIPT: added portHandle.nextWrite() (#187) 2022-11-03 06:17:29 -04:00
Snarling
3ce4dcf612
DOC: Update documentation for workForFaction and workForCompany (#180)
* DOC: `ns.singularity.workForFaction()`: update doc and examples
* Additional Doc Fixes
* Remove unnecessary fluff in singularity.workForFaction examples
* Fix documentation for singularity.workForCompany similar to fixes already applied to workForFaction
* Correct some inaccuracies in workForFaction and workForCompany remarks sections
* Shorten some comment lines that are over 120 characters in NetscriptDefinitions.d.ts, for consistency.

Co-authored-by: Duck McSouls <quacksouls@gmail.com>
2022-11-01 12:24:25 -04:00
LJ
0519b6adf7
De-uglify ns.print examples (#164) 2022-10-28 17:20:01 -04:00
omuretsu
4bf215f241 Fix documentation build error 2022-10-27 07:04:46 -04:00
quacksouls
3f0a7786f8
DOC: cleanup in doc of Netscript functions (#155)
* A bunch of typographical fixes in the documentation of various Netscript functions.  A main fix is standardizing the use of "hostname".
* Cross-reference the documentation of various Netscript functions.  This makes it clear that we are referring to a particular Netscript function.
* Clarify the return values of various Netscript functions.  Clarify the documentation of other functions.
2022-10-25 07:17:53 -04:00
Snarling
5fe89d5599
CORPORATION: Reorganize Industry data (#154) 2022-10-24 21:54:54 -04:00
Snarling
0a3ff56331
WIP: Remove corp employees as objects (#143)
* Removed employees as objects from corporations
* Remove employees from office JSON after loading / convert to new parameters
* Showed down morale/etc gain; added optional position to hireEmployee
* enum support for corp employee positions

Mostly authored-by: Kelenius <kelenius@ya.ru>
2022-10-24 08:44:01 -04:00
hydroflame
317c3c3fc4
Update NetscriptDefinitions.d.ts 2022-10-22 00:27:29 -04:00
hydroflame
7784c2f8b2
Update NetscriptDefinitions.d.ts 2022-10-22 00:23:10 -04:00
Snarling
d74c380e42
WIP: Crimes streamlining. (#138)
* streamline crimes

* Crimes object is now indexed by CrimeType enum instead of an entirely new set of keys that aren't used for anything else. This eliminated a lot of instances of iterating to find the right crime for a given CrimeType.
* Removed unused `None` CrimeType which allowed typing Crimes as a Record<CrimeType, Crime>.
* Added slums tooltip text as a crime property, to allow streamlining slums.
* Refactor slums location - removed repetitive code, rerenders 1/sec to update chances
* Fix bugged descriptive text when sleeve is committing a crime (was "is attempting to DRUGS", now uses correct text e.g. "to deal drugs").
* Remove unused and now unneeded NewCrimeType enum. Values were identical to existing CrimeType values after removing unused None.

* Add CrimeType enum in NetscriptDefinition.d.ts

* Also update broken ToastVariant type. Better support for enums in player scripts.
* Still todo is modifying some NS functions to expect CrimeType as input (rough crime names will continue to work to avoid breaking scripts)

* Expect enum use for crime functions

Affected functions:
* ns.singularity.commitCrime
* ns.singularity.getCrimeChance
* ns.singularity.getCrimeStats
* ns.sleeve.setToCommitCrime
* formulas.work.crimeGains (param type only)

- Affected functions still will fall back to rough names, except formulas.work.crimeGains which already only accepted the enum members.
- Some documentation changes:
  * examples updated to use uppercase expected form.
  * Note on sleeve.setToCommitCrime that it only accepts exact matches removed. It already, and still does, accept any rough crime name (but the enum is expected input).
  * note about needing to use isBusy to schedule crimes remove - crimes autoloop now.
  * Since expected string inputs are documented directly on the type, removed list of crimes from sleeve.setToCommitCrimes
2022-10-21 11:57:37 -04:00
Snarling
1d0d4f8da6
fix grow doc (#136) 2022-10-19 17:25:54 -04:00
Snarling
3af6e7db45
Remove incorrect note about disableLog (#135) 2022-10-19 17:20:31 -04:00
Olivier Gagnon
af1a1ac58d Rename lots of reference from old to new repo 2022-10-20 03:56:59 +11:00
hydroflame
0f46d72a01
Merge pull request #4245 from dbachran/4239-adjust-write-documentation
MISC: Adjust write() documentation, only accepts strings now
2022-10-19 11:46:08 -04:00
hydroflame
51f8d29e7a
Merge pull request #4247 from quacksouls/doc-prompt
DOC: `ns.prompt()`: some cleanup and examples
2022-10-19 11:45:49 -04:00
hydroflame
1b7b4fa466
Merge pull request #4249 from Snarling/typeAssertion
NETSCRIPT: Fix ns.prompt typechecking
2022-10-19 11:44:59 -04:00
Duck McSouls
6f1822bf4d DOC: gang.canRecruitMember(): when this returns true or false
Elaborate on the conditions under which the function would return true or false.  In particular, after a gang is successfully created the function always return true so the player can recruit a number of founding members to their gang.  When the gang is at capacity, the function always return false.  In between, the function returns true or false depending on the amount of respect the player has.
2022-10-16 18:34:34 +11:00
Duck McSouls
ac0e7c9595 DOC: gang.canRecruitMember(): typo fixes
Some typographical fixes.
2022-10-16 17:56:45 +11:00
Duck McSouls
93090691b5 DOC: ns.prompt(): some examples
Add some examples to illustrate the use of the various options.  As per suggestion by @Snarling, simplify the examples on free-form text box and drop-down list.
2022-10-15 11:27:56 +11:00
Duck McSouls
473e6a2674 DOC: ns.prompt(): explain the various options
Elaborate on the effects of `options.type` and `options.choices`.  Break the explanation into bullet points for clearer presentation.  Thanks to @Snarling for pointing out that the default is to create a boolean dialog box.
2022-10-15 11:03:36 +11:00
omuretsu
ad0be471ce fix ns.prompt typechecking
Introduced some new type assertion functions, initial step in larger type safety rework.
2022-10-14 11:00:29 -04:00
Duck McSouls
a368c6904e DOC: ns.prompt(): a typo fix
A simple typographical fix.
2022-10-14 14:50:35 +11:00
Daniel Bachran
5acd5e84a3 #4239 Adjust write() documentation
write() only accepts strings now.
2022-10-13 17:45:40 +02:00
Olivier Gagnon
8ff840edfa getBitnodeM takes 2 arg 2022-10-13 00:51:53 -04:00
Olivier Gagnon
ae5fc168bf Add getMoneySources 2022-10-13 00:10:59 -04:00
hydroflame
93769c7089
Merge pull request #4224 from quacksouls/doc-scan
DOC: `ns.scan()`: typo fixes and add 2 examples
2022-10-12 23:52:34 -04:00
hydroflame
50bc41bf5b
Merge pull request #4231 from borisflagell/TypoRepReq#3811
API: Fix #3811 Update NetscriptDefinitions.d.ts
2022-10-12 23:51:39 -04:00
omuretsu
7a384d53f4 typefix netscriptFunctions (see desc)
* Types for InternalFunction and ExternalFunction have been modified to actually typecheck ns functions against docs.
* Internal functions are required to use unknown for any params on the inner function.
* Return types for internal function inner-function must match the respective external function.
* Added new typecheck assertion function for asserting dynamic object types, to allow unknownifying params that were previously hardcoded objec structures.
* Because type assertion for parameter types and return types is enforced by InternalAPI, removed all duplicate type declarations on NetscriptFunction params and returns.
2022-10-12 08:49:27 -04:00
borisflagell
b2886ba623 Update NetscriptDefinitions.d.ts 2022-10-11 18:45:38 +03:00
Duck McSouls
b03288a700 DOC: ns.scan(): add 2 examples
The first example shows how to use `ns.scan()` without passing an argument.  The second example uses `ns.scan()` by passing the hostname of a target server.  Both examples can be written more succinctly by using the `forEach()` method of array, but for the purposes of illustration the `for` loop should be easier for beginners to read.
2022-10-11 18:48:47 +11:00
Duck McSouls
afe6a837c3 DOC: ns.sleeve.setToCommitCrime(): add 1 example
An example on how to set a sleeve to commit a crime.  The example shows that sleeves are indexed from 0.
2022-10-10 20:49:33 +11:00
Duck McSouls
c728c550f5 DOC: ns.sleeve.setToCommitCrime(): add all crimes a sleeve can commit
Add a list of crimes that a sleeve can commit.  Update the parameter documentation to refer to this list.
2022-10-10 13:18:00 +11:00
Duck McSouls
304b7645b0 DOC: ns.sleeve.setToCommitCrime(): starting index of sleeves
Document the index of the first sleeve.  Sleeves are indexed starting from zero, i.e. 0.  Increment by 1 to get the index of the next sleeve.  And so on.
2022-10-10 12:47:20 +11:00
Duck McSouls
67f5d60116 DOC: ns.scan(): typo fixes
Some typographical fixes in the documentation of the function `ns.scan()`.  The function returns an array, not a string.
2022-10-10 09:55:31 +11:00
Olivier Gagnon
f803355335 fix doc 2022-10-09 18:48:58 -04:00
Olivier Gagnon
7a89c0a1bb regen doc 2022-10-09 18:46:13 -04:00
Olivier Gagnon
f4668b21ca functions to generate dummy contracts 2022-10-09 02:56:11 -04:00
Olivier Gagnon
5d4b72e1d1 Added some purchased server functions 2022-10-09 02:32:13 -04:00
Olivier Gagnon
f6f023eeb4 Fix tons of typos 2022-10-09 01:25:31 -04:00
hydroflame
a5b2512269
Merge pull request #4205 from Snarling/ramTestFix
TESTS: Refined ram calculation tests
2022-10-09 00:23:04 -04:00
hydroflame
b4d6ead5d2
Merge pull request #4206 from quacksouls/doc-exec
DOC: `ns.exec()`: typo fixes and clean presentation
2022-10-09 00:22:54 -04:00
Duck McSouls
351d769122 DOC: no trailing whitespace
Remove some trailing whitespaces in `src/ScriptEditor/NetscriptDefinitions.d.ts` because `npm run format` complains about them.  The trailing whitespaces were introduced in one of my earlier patches.  Sorry about this :-(
2022-10-06 23:29:06 +11:00