Commit Graph

357 Commits

Author SHA1 Message Date
Snarling
cc2246213f Add more error types 2022-09-27 15:35:39 -04:00
Snarling
824d8db653 simplify/dehardcode failOnHacknetServer 2022-09-27 15:35:39 -04:00
Snarling
7d37736058 unified errors 2022-09-27 15:35:39 -04:00
Snarling
8d0347577d Less hardcoding 2022-09-27 15:34:48 -04:00
Snarling
572c68738f Unify error handling 2022-09-27 15:34:47 -04:00
Snarling
5798c4c7d3 Unify error handling 2022-09-27 15:32:09 -04:00
Olivier Gagnon
2fc17423ff Improve the robustness of the tutorial. 2022-09-27 13:35:51 -04:00
hydroflame
2a43b90ed3
Merge pull request #4039 from ezylot/patch-1
GANG: Added weight to GangMemberTask construction call
2022-09-23 01:15:29 -03:00
Olivier Gagnon
2a0dd6b6f8 Minor improvements to Netscript Port loading and unloading 2022-09-22 23:55:16 -04:00
hydroflame
0044761fd3
Merge pull request #4073 from Hoekstraa/unlimited-ports
API: More ports (previously max 20, now practically unlimited)
2022-09-23 00:51:50 -03:00
phyzical
ca2f1a62a5
add singularity function for exporting game save 2022-09-07 16:11:51 +08:00
Zoë Hoekstra
55df97d3d5
Format 2022-09-01 16:27:31 +02:00
Zoë Hoekstra
ec81fb60c3
Create ports on demand. Increase max to infinity. 2022-09-01 16:13:10 +02:00
Olivier Gagnon
2675fd23ec fix stack trace missing in some errors 2022-08-29 18:14:54 -04:00
Olivier Gagnon
c9a0998cc1 Improve wrong arg user message and add ui.windowSize 2022-08-29 18:07:17 -04:00
Olivier Gagnon
f07a29c73b fix dynamic ram miscalc not triggering 2022-08-29 15:26:34 -04:00
hydroflame
c2796e164a
Merge pull request #4052 from Snarling/ns1wrapper
NETSCRIPT: FIX #4037 ns1 wraps deeper layers correctly.
2022-08-29 11:14:32 -03:00
Snarling
185549e7e4 fix dynamic ram check 2022-08-28 07:44:41 -04:00
Snarling
ef1f376c09 format, lint, remove unused "running" property on ws 2022-08-27 22:32:48 -04:00
Florian Schöffl
0c93764ef8
Added weight to GangMemberTask construction call
Added hackWeight: 100 to GangMember Task construction call to prevent error messages from the constructor checks. 
Since we only compare with roughlyIs() this will have no impact on functionality
2022-08-25 11:08:33 +02:00
Olivier Gagnon
89aa23f4b3 Add dummy function to generate a mock server or player for formulas stuff 2022-08-23 16:01:34 -04:00
Olivier Gagnon
0e569344e7 rm console log 2022-08-23 11:28:40 -04:00
hydroflame
67be694b68
Merge pull request #3978 from Snarling/atExitFix
NETSCRIPT: FIX #2931 atExit now allows synchronous ns functions
2022-08-23 12:27:43 -03:00
Olivier Gagnon
a8bef50ef5 Added a few formulas to calculate work gains 2022-08-17 14:32:52 -04:00
Snarling
32afaae3e2 Improve atExit error message 2022-08-16 20:37:50 -04:00
Snarling
0c358c588e ns.atExit errors more readable, allows ns functions 2022-08-16 20:16:57 -04:00
Snarling
f1f7be6adc Remove unused types 2022-08-10 10:02:41 -04:00
Snarling
28d9c70796 format&lint 2022-08-09 19:04:05 -04:00
Snarling
c6cb4ca033 Type correctness 2022-08-09 19:02:33 -04:00
Snarling
ea7c2c4981 fixing other commits after rebase 2022-08-09 18:25:02 -04:00
Snarling
648b7e84bf Some cleanup 2022-08-09 18:09:26 -04:00
Snarling
931ea730a5 Move entire ns object to top-level 2022-08-09 18:09:26 -04:00
Snarling
589b9df2a7 remove console.logging from roughlyIs 2022-08-09 18:09:26 -04:00
Snarling
01e63b10a1 move ctx.log to NetscriptHelpers 2022-08-09 18:09:26 -04:00
Snarling
208495e269 Initial commit 2022-08-09 18:09:24 -04:00
Snarling
3a2e676c9b Move error functionality to new wrapper 2022-08-09 18:09:24 -04:00
Snarling
09322bd54a lint 2022-08-07 21:56:48 -04:00
Snarling
1af97ec5aa fix running/worker script comparison 2022-08-07 11:40:42 -04:00
Olivier Gagnon
07c7f0641a allbuild commit c8440ef2 2022-07-28 14:35:55 -04:00
Olivier Gagnon
4549b0d467 finish sleeve rework 2022-07-28 02:46:34 -04:00
Olivier Gagnon
3e4f26ac0a allbuild commit e6d14eff 2022-07-26 15:30:12 -04:00
Olivier Gagnon
2d522ea1e6 allbuild commit e9254edf 2022-07-21 15:09:55 -04:00
Olivier Gagnon
693baf26df add sleeve aug price and rep function 2022-07-21 02:42:48 -04:00
Olivier Gagnon
43b8cfec5c fix test suite 2022-07-21 02:13:47 -04:00
Olivier Gagnon
ef42ee7232 few more api break 2022-07-20 17:03:08 -04:00
Olivier Gagnon
894929efdb fix ustring issue 2022-07-20 11:41:02 -04:00
Olivier Gagnon
e0a24cf381 fix args not beign passed to scripts 2022-07-20 11:34:49 -04:00
Olivier Gagnon
49f6fda1e4 remove last colon any for now 2022-07-20 01:48:54 -04:00
Olivier Gagnon
0e74b1a5d6 remove last colon any for now 2022-07-20 01:37:41 -04:00
Olivier Gagnon
4518eabc29 Remove some any and add getAugmentationBasePrice 2022-07-20 01:20:11 -04:00
Olivier Gagnon
ceb9fa1249 fix more any 2022-07-20 01:13:06 -04:00
Olivier Gagnon
70d5390e4d most anys in NetFunc 2022-07-19 19:04:06 -04:00
Olivier Gagnon
c3a10d5d95 fix more anys 2022-07-19 18:25:06 -04:00
Olivier Gagnon
2442402af5 fix more anys 2022-07-19 16:46:03 -04:00
Olivier Gagnon
4bee746576 rm any 2022-07-15 01:51:30 -04:00
Olivier Gagnon
e86a42716c lint 2022-07-11 15:58:23 -04:00
Olivier Gagnon
6a2e5b06ad fix manualHack 2022-05-25 20:19:42 -04:00
Olivier Gagnon
216055b3e0 allbuild commit b60f3da8 2022-05-25 18:38:01 -04:00
Olivier Gagnon
cb7f3b17be fix ns1 scripts 2022-05-25 16:01:28 -04:00
Olivier Gagnon
c1650e332b lint fixes 2022-05-25 15:08:48 -04:00
Olivier Gagnon
972abcbdc8 Wrap all the API 2022-05-24 20:16:39 -04:00
Olivier Gagnon
ae38b11ede made static ram cost typecheck that it's missing no property. 2022-05-24 18:34:00 -04:00
Olivier Gagnon
0da2e74d12 more work on wrapping formulas 2022-05-24 17:51:48 -04:00
Olivier Gagnon
79e7c47b4d Merge branch 'dev' of github.com:danielyxie/bitburner into dev 2022-05-24 16:57:39 -04:00
Olivier Gagnon
ce61f06319 allbuild commit 8159dad5 2022-05-24 16:57:25 -04:00
hydroflame
cb4fd4cf90
Merge pull request #3722 from borisflagell/FIX#2884
API: FIX#2884 Add the missing className property to Sleeve'sAPI
2022-05-24 08:48:35 -04:00
Olivier Gagnon
8159dad5fa allbuild commit de644247 2022-05-24 08:12:49 -04:00
hydroflame
570c6d6b32
Merge pull request #3702 from borisflagell/FIX#3508
BLADEBURNER: FIX #3508 Add GetActionCurrentTime() to Bitburner API
2022-05-23 12:21:27 -04:00
PathToLife
3f1cb27ec1
Add tprintf to RamCostGenerator 2022-05-23 19:57:23 +12:00
borisflagell
8e0af049d9 BLADEBURNER: FIX #3508 Add GetActionCurrentTime() to Bitburner API
Add GetActionCurrentTime() to Bitburner API.
Slightly tweak BItburner.resetAction() to also reset time counters.
2022-05-22 06:40:08 +02:00
Stephen Reindl
35978689f9
Fix #3690 by adding missing function RamCostGenerator 2022-05-21 17:24:20 +02:00
Olivier Gagnon
7eb4494ac1 fix mc 2022-05-20 15:58:33 -04:00
hydroflame
f86eae5276
Merge pull request #3624 from danielyxie/infinite-loop-safety
MISC: Implemented infinite loop safety net.
2022-05-18 15:35:12 -04:00
Olivier Gagnon
fb08139903 Implemented infinite loop safety net. 2022-05-07 17:43:45 -04:00
rderfler
77073836cb Merge remote-tracking branch 'upstream/dev' into dev 2022-05-06 22:44:24 -04:00
Zoë Hoekstra
472c9778df
Add ns.ui.clearTerminal for 0.2 GB 2022-05-06 12:29:21 +02:00
rderfler
7cf21629a7 Address review
Add ns function setToBladeburnerAction
Formatting updates
fix sleeves using player stamina
Correct supporting sleeve causing error
2022-04-30 15:25:36 -04:00
phyzical
711955c112 added logic to allow quitJob to be called from singularity 2022-04-28 19:05:56 +08:00
phyzical
8e1300d69d Merge branch 'dev' into feature/add-infiltration-faction
# Conflicts:
#	src/Netscript/RamCostGenerator.ts
2022-04-20 20:10:05 +08:00
Undeemiss
46a90e6271 Added ns function stanek.acceptGift
Added a new ns function stanek.acceptGift to the game, with a ram
cost of 2gb. The function attempts to join the CotMG and install
the gift, then returns true iff the player is in the CotMG and has
the gift installed.
2022-04-19 12:08:38 -05:00
phyzical
9c23fc89d1 merge base 2022-04-14 21:27:08 +08:00
Olivier Gagnon
9281cbe559 ns func to flume and destroy wd 2022-04-13 17:34:02 -04:00
nickofolas
51e5d38c7b Add grafting API function to get graftable augs 2022-04-13 09:43:27 -05:00
phyzical
6b48ff8f21 merge base 2022-04-13 18:50:42 +08:00
hydroflame
c8c271a334
Merge pull request #3401 from TheMas3212/feat/wrap-singularity
Wrap Singularity API with wrapper
2022-04-12 20:53:55 -04:00
Olivier Gagnon
52e01fc026 fix a few things about getRecentScritps 2022-04-12 14:45:48 -04:00
hydroflame
68abd27d2c
Merge branch 'dev' into add-ns-getRecentScripts 2022-04-12 14:21:18 -04:00
TheMas3212
b2689eaa5a
Wrap Singularity API with wrapper
also refactored the RamCosts IMap as it didnt quite work properly due to
how the wrapper calculates function names
2022-04-12 16:51:10 +10:00
hydroflame
a17b81dff3
Merge pull request #2925 from Ornedan/necro-script-fix
Necro script fix
2022-04-11 21:36:07 -04:00
TheMas3212
f53c90b21c
Change Signature of InternalFunction
Mark properties of Wrapped NetscriptAPI as readonly
2022-04-09 15:15:45 +10:00
TheMas3212
b2e7817a0b
format 2022-04-08 10:02:59 +10:00
TheMas3212
9b53896732
slight change on how wrapping work based on discussion in #development 2022-04-08 09:57:16 +10:00
phyzical
c70f59ac54 merge dev 2022-04-07 16:27:23 +08:00
TheMas3212
f0cfc8700a run formater 2022-04-07 10:23:52 +10:00
TheMas3212
8c58f0676d Improve Typesafety on API Wrapper 2022-04-07 10:23:52 +10:00
TheMas3212
40f74e4a98 add wrapped helpers to ctx
add ramcheck into wrapper
2022-04-07 10:23:52 +10:00
TheMas3212
ea2b444b87 Initial API Wrapper Work
onlying wrapping Stanek api currently as test sample
(Rebased onto upstream/dev)
2022-04-07 10:23:46 +10:00
Heikki Aitakangas
a7d200f7c6 Strip trailing spaces 2022-04-02 23:28:23 +03:00
Heikki Aitakangas
a578763b89 Use a dedicated ScriptDeath type to signal script termination instead of WorkerScript
Problem with throwing WorkerScript is that the termination signal object can pass
through user code, which permits user to modify that object and all parts of the
game state accessible through it.
2022-04-02 23:28:21 +03:00
Heikki Aitakangas
1ed1f78222 Fixed a wrong comment 2022-04-02 23:27:06 +03:00
Stephen Reindl
689059ea83 Fix expected ram calculation for ns.goToLocation() 2022-03-31 12:37:33 +02:00
phyzical
07c6051004 merge dev 2022-03-30 19:00:57 +08:00
Olivier Gagnon
6b25ba5cd8 allbuild commit da27223a 2022-03-29 18:13:08 -04:00
Jesse Clark
fcc121cc21
Fix spelling of grafting functions 2022-03-29 14:34:48 -07:00
Jesse Clark
cde6eca6b5
Set mv ram cost to ScriptReadWriteRamCost
This seems a bit high but avoids an exploit due to setting it lower than `rm`.
2022-03-29 14:27:30 -07:00
Jesse Clark
1d0c5d8fef
Set atExit ram cost to 0 2022-03-29 14:24:38 -07:00
Jesse Clark
4d48b7c621
Update Stanek functions in RamCostGenerator 2022-03-29 14:17:42 -07:00
Olivier Gagnon
680081c548 post-grafting changes 2022-03-29 14:09:17 -04:00
nickofolas
3b32811f5e Grafting API RAM cost & doc update 2022-03-27 15:33:31 -04:00
phyzical
7c5097ee83 added ns functions
* refactored out logic to be reused by api
2022-03-27 15:53:13 +08:00
Olivier Gagnon
fb7c65957d Added dark web functions to ns api 2022-03-20 22:49:46 -04:00
parax
458f02051f Added functions to RamCostGenerator.ts 2022-03-18 23:52:13 -06:00
TheMas3212
68cc5fba6c
Fix bug with missing ramcost for tFormat 2022-03-19 14:21:52 +11:00
Olivier Gagnon
fc963bb583 allbuild commit /usr/bin/git 2022-03-18 16:35:56 -04:00
hydroflame
561219a0ab
Merge branch 'dev' into bugfix/2877-2 2022-03-17 12:05:38 -04:00
phyzical
9949cc9a1e removed ip references 2022-03-17 21:50:23 +08:00
Master-Guy
ef9632bf63 Added 0 cost of asleep() 2022-03-17 13:32:49 +01:00
phyzical
ec927fe1f4 added ram charge for stanek width and height 2022-03-08 17:28:45 +08:00
smolgumball
2add4e9112 Merge branch 'dev' into add-ns-getRecentScripts 2022-01-26 19:07:02 -07:00
Terrana
f2c4109211
Add ns.printf function
Behaviour is consistent with that of tprintf versus tprint and
should be equivalent to ns.print(ns.sprintf(...))
2022-01-21 12:08:47 +00:00
smolgumball
74e2acfa6f Add ns.getRecentScripts() 2022-01-19 00:04:48 -07:00
Olivier Gagnon
05cbc25a8f 1.4 2022-01-18 14:03:24 -05:00
Martin Fournier
07403eaaaa Add ns.ui.getGameInfo() to retrieve game version
Returns { version, commit, platform }
2022-01-16 10:49:01 -05:00
hydroflame
c0f6399a96
Merge pull request #2590 from deathly809/feature/ns_support_rm
Add support for the mv command in NS
2022-01-15 18:26:31 -05:00
hydroflame
03f71bd5f4
Merge pull request #2485 from Ornedan/netscriptdelay-check-stop
Refactor netscriptDelay and script kill interaction
2022-01-15 17:26:23 -05:00
Martin Fournier
9b638b911f Add ns.ui.[getStyles, setStyles, resetStyles]
Adds three Netscript functions to manipulate the user's styles like the
player can with theme.
2022-01-12 18:34:05 -05:00
Jeffrey A. Robinson
bedea0ac73 Add support for the mv command in NS 2022-01-12 09:53:54 -08:00
Heikki Aitakangas
59da79a427 Refactor netscriptDelay and script kill interaction
Store the Promise reject function instead of resolve in WorkerScript, since
it's only used when killing a script that's blocked in delay. And when killing
a script, reject the delay Promise with the WorkerScript as cause.
2022-01-09 02:36:54 +02:00
Olivier Gagnon
7e6976986f rm sf4 penalty 2022-01-05 12:37:49 -05:00
hydroflame
b718fc3ef7
Merge pull request #2343 from MartinFournier/feature/set-theme
Add ns.ui.setTheme() and ns.ui.resetTheme()
2022-01-05 10:17:51 -05:00
theit8514
41adedf1bc Update getOwnedSourceFiles RAM cost
Not a singularity function
2022-01-05 07:12:41 -05:00
Olivier Gagnon
925bed4430 fix scp 2022-01-04 22:25:41 -05:00
Martin Fournier
c9ca1e9d37 Add ns.ui.setTheme() and ns.ui.resetTheme() 2022-01-04 20:33:18 -05:00
Olivier Gagnon
c59a267437 change sf4 2022-01-04 19:09:34 -05:00
Martin Fournier
65d0877edc Add ns.ui.getTheme() api function 2021-12-20 14:37:10 -05:00
Olivier Gagnon
d01d75606a few bugfix 2021-12-08 17:39:01 -05:00
Olivier Gagnon
737276e855 corp api 2021-12-03 23:06:04 -05:00
Olivier Gagnon
5470f9fdc1 wd diff increase 2021-12-03 16:21:35 -05:00
Olivier Gagnon
d4ebc46a19 merge dev 2021-12-03 15:35:45 -05:00
Olivier Gagnon
b941753e1b more fixes 2021-11-26 18:54:06 -05:00
Olivier Gagnon
c05518e162 workerscript log takes a function now, hopefully this will increase performance. 2021-11-26 18:30:58 -05:00
Olivier Gagnon
f0a004e75b Fix a bunch of scripting related stuff. 2021-11-25 11:47:31 -05:00
Bart Koppelmans
79f456b598
Fixed BladeBurner getCityCommunities ram cost
With the renamed function, the ram cost was not taken into account.
2021-11-20 21:12:21 +01:00
Olivier Gagnon
632de50a73 convert BN13 to a more conventional one. 2021-11-18 15:38:19 -05:00
Olivier Gagnon
ef781a0627 plenty of bf 2021-11-15 23:49:33 -05:00
Olivier Gagnon
43a6521403 more work on bn13 2021-11-13 23:45:26 -05:00
Olivier Gagnon
56ddcd9a45 more work on bn13 2021-11-13 22:44:17 -05:00
Olivier Gagnon
6bd6b3061e rename some stuff and close some exploits 2021-11-12 15:42:57 -05:00
Olivier Gagnon
58d652da54 fix something about covenant sleeve purchases 2021-11-05 21:57:41 -04:00
Olivier Gagnon
14150d3e33 work on making the netscript api tighter 2021-11-03 20:19:52 -04:00