Compare commits
64 Commits
8b3749d3de
...
master
Author | SHA1 | Date | |
---|---|---|---|
b99827a84b | |||
62b1d6edfd | |||
78d8153f8e | |||
461775a92f | |||
70ec4d9463 | |||
1d3ce073f6 | |||
9bacf4f97f | |||
9b4042af40 | |||
e6aca2e998 | |||
df2d550eb6 | |||
c320b31ac3 | |||
f0d4017711 | |||
2ca91f574f | |||
7de44a3c2f | |||
afa44d0ea4 | |||
83ba1af0cc | |||
fad1c1a7c4 | |||
ab6635d00e | |||
116daf3781 | |||
1af46c5d6f | |||
f52af72140 | |||
12d9165162 | |||
5febd7ed3b | |||
8dff0b71d6 | |||
f7fa595d71 | |||
6e1b576bcf | |||
6c6f8b0b70 | |||
90fef7e53a | |||
92ad2da7b7 | |||
a3bdb2ccd1 | |||
677f23ea8d | |||
29d88170ab | |||
74aae19a82 | |||
5d6063917b | |||
22ddbbde5d | |||
683daff911 | |||
b40c4d07e8 | |||
4be46174b3 | |||
d35d6cad42 | |||
3be118120f | |||
d1f1d9b4bd | |||
f32ae59522 | |||
536eebed56 | |||
3c891b3522 | |||
64045b0198 | |||
7466c20e11 | |||
99c5d23c11 | |||
374f14ea65 | |||
000e69a418 | |||
f34a37a3fb | |||
abdcc8d682 | |||
070a48f298 | |||
50117674e1 | |||
01ea52d4d7 | |||
81717ac746 | |||
8733556ac2 | |||
e2d45cb490 | |||
5a3fa148fe | |||
8d1df7fe1d | |||
9ab9ca9639 | |||
6aefaa64db | |||
c72ab0cd3c | |||
124a2036ae | |||
be73034d0d |
10
.editorconfig
Normal file
10
.editorconfig
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# All files
|
||||||
|
[*]
|
||||||
|
end_of_line = lf
|
||||||
|
insert_final_newline = true
|
||||||
|
indent_style = tab
|
||||||
|
indent_size = 2
|
||||||
|
|
||||||
|
# Markup files
|
||||||
|
[*.{json,yml}]
|
||||||
|
indent_style = space
|
215
.gitattributes
vendored
Normal file
215
.gitattributes
vendored
Normal file
@ -0,0 +1,215 @@
|
|||||||
|
## GITATTRIBUTES FOR WEB PROJECTS
|
||||||
|
#
|
||||||
|
# These settings are for any web project.
|
||||||
|
#
|
||||||
|
# Details per file setting:
|
||||||
|
# text These files should be normalized (i.e. convert CRLF to LF).
|
||||||
|
# binary These files are binary and should be left untouched.
|
||||||
|
#
|
||||||
|
# Note that binary is a macro for -text -diff.
|
||||||
|
######################################################################
|
||||||
|
|
||||||
|
# Auto detect
|
||||||
|
## Handle line endings automatically for files detected as
|
||||||
|
## text and leave all files detected as binary untouched.
|
||||||
|
## This will handle all files NOT defined below.
|
||||||
|
* text=auto
|
||||||
|
|
||||||
|
# Source code
|
||||||
|
*.bash text eol=lf
|
||||||
|
*.bat text eol=crlf
|
||||||
|
*.cmd text eol=crlf
|
||||||
|
*.coffee text
|
||||||
|
*.css text diff=css
|
||||||
|
*.htm text diff=html
|
||||||
|
*.html text diff=html
|
||||||
|
*.inc text
|
||||||
|
*.ini text
|
||||||
|
*.js text
|
||||||
|
*.json text
|
||||||
|
*.jsx text
|
||||||
|
*.less text
|
||||||
|
*.ls text
|
||||||
|
*.map text -diff
|
||||||
|
*.od text
|
||||||
|
*.onlydata text
|
||||||
|
*.php text diff=php
|
||||||
|
*.pl text
|
||||||
|
*.ps1 text eol=crlf
|
||||||
|
*.py text diff=python
|
||||||
|
*.rb text diff=ruby
|
||||||
|
*.sass text
|
||||||
|
*.scm text
|
||||||
|
*.scss text diff=css
|
||||||
|
*.sh text eol=lf
|
||||||
|
.husky/* text eol=lf
|
||||||
|
*.sql text
|
||||||
|
*.styl text
|
||||||
|
*.tag text
|
||||||
|
*.ts text
|
||||||
|
*.tsx text
|
||||||
|
*.xml text
|
||||||
|
*.xhtml text diff=html
|
||||||
|
|
||||||
|
# Docker
|
||||||
|
Dockerfile text
|
||||||
|
|
||||||
|
# Documentation
|
||||||
|
*.ipynb text eol=lf
|
||||||
|
*.markdown text diff=markdown
|
||||||
|
*.md text diff=markdown
|
||||||
|
*.mdwn text diff=markdown
|
||||||
|
*.mdown text diff=markdown
|
||||||
|
*.mkd text diff=markdown
|
||||||
|
*.mkdn text diff=markdown
|
||||||
|
*.mdtxt text
|
||||||
|
*.mdtext text
|
||||||
|
*.txt text
|
||||||
|
AUTHORS text
|
||||||
|
CHANGELOG text
|
||||||
|
CHANGES text
|
||||||
|
CONTRIBUTING text
|
||||||
|
COPYING text
|
||||||
|
copyright text
|
||||||
|
*COPYRIGHT* text
|
||||||
|
INSTALL text
|
||||||
|
license text
|
||||||
|
LICENSE text
|
||||||
|
NEWS text
|
||||||
|
readme text
|
||||||
|
*README* text
|
||||||
|
TODO text
|
||||||
|
|
||||||
|
# Templates
|
||||||
|
*.dot text
|
||||||
|
*.ejs text
|
||||||
|
*.erb text
|
||||||
|
*.haml text
|
||||||
|
*.handlebars text
|
||||||
|
*.hbs text
|
||||||
|
*.hbt text
|
||||||
|
*.jade text
|
||||||
|
*.latte text
|
||||||
|
*.mustache text
|
||||||
|
*.njk text
|
||||||
|
*.phtml text
|
||||||
|
*.svelte text
|
||||||
|
*.tmpl text
|
||||||
|
*.tpl text
|
||||||
|
*.twig text
|
||||||
|
*.vue text
|
||||||
|
|
||||||
|
# Configs
|
||||||
|
*.cnf text
|
||||||
|
*.conf text
|
||||||
|
*.config text
|
||||||
|
.editorconfig text
|
||||||
|
.env text
|
||||||
|
.gitattributes text
|
||||||
|
.gitconfig text
|
||||||
|
.htaccess text
|
||||||
|
*.lock text -diff
|
||||||
|
package.json text eol=lf
|
||||||
|
package-lock.json text eol=lf -diff
|
||||||
|
pnpm-lock.yaml text eol=lf -diff
|
||||||
|
.prettierrc text
|
||||||
|
yarn.lock text -diff
|
||||||
|
*.toml text
|
||||||
|
*.yaml text
|
||||||
|
*.yml text
|
||||||
|
browserslist text
|
||||||
|
Makefile text
|
||||||
|
makefile text
|
||||||
|
# Fixes syntax highlighting on GitHub to allow comments
|
||||||
|
tsconfig.json linguist-language=JSON-with-Comments
|
||||||
|
|
||||||
|
# Heroku
|
||||||
|
Procfile text
|
||||||
|
|
||||||
|
# Graphics
|
||||||
|
*.ai binary
|
||||||
|
*.bmp binary
|
||||||
|
*.eps binary
|
||||||
|
*.gif binary
|
||||||
|
*.gifv binary
|
||||||
|
*.ico binary
|
||||||
|
*.jng binary
|
||||||
|
*.jp2 binary
|
||||||
|
*.jpg binary
|
||||||
|
*.jpeg binary
|
||||||
|
*.jpx binary
|
||||||
|
*.jxr binary
|
||||||
|
*.pdf binary
|
||||||
|
*.png binary
|
||||||
|
*.psb binary
|
||||||
|
*.psd binary
|
||||||
|
# SVG treated as an asset (binary) by default.
|
||||||
|
*.svg text
|
||||||
|
# If you want to treat it as binary,
|
||||||
|
# use the following line instead.
|
||||||
|
# *.svg binary
|
||||||
|
*.svgz binary
|
||||||
|
*.tif binary
|
||||||
|
*.tiff binary
|
||||||
|
*.wbmp binary
|
||||||
|
*.webp binary
|
||||||
|
|
||||||
|
# Audio
|
||||||
|
*.kar binary
|
||||||
|
*.m4a binary
|
||||||
|
*.mid binary
|
||||||
|
*.midi binary
|
||||||
|
*.mp3 binary
|
||||||
|
*.ogg binary
|
||||||
|
*.ra binary
|
||||||
|
|
||||||
|
# Video
|
||||||
|
*.3gpp binary
|
||||||
|
*.3gp binary
|
||||||
|
*.as binary
|
||||||
|
*.asf binary
|
||||||
|
*.asx binary
|
||||||
|
*.avi binary
|
||||||
|
*.fla binary
|
||||||
|
*.flv binary
|
||||||
|
*.m4v binary
|
||||||
|
*.mng binary
|
||||||
|
*.mov binary
|
||||||
|
*.mp4 binary
|
||||||
|
*.mpeg binary
|
||||||
|
*.mpg binary
|
||||||
|
*.ogv binary
|
||||||
|
*.swc binary
|
||||||
|
*.swf binary
|
||||||
|
*.webm binary
|
||||||
|
|
||||||
|
# Archives
|
||||||
|
*.7z binary
|
||||||
|
*.gz binary
|
||||||
|
*.jar binary
|
||||||
|
*.rar binary
|
||||||
|
*.tar binary
|
||||||
|
*.zip binary
|
||||||
|
|
||||||
|
# Fonts
|
||||||
|
*.ttf binary
|
||||||
|
*.eot binary
|
||||||
|
*.otf binary
|
||||||
|
*.woff binary
|
||||||
|
*.woff2 binary
|
||||||
|
|
||||||
|
# Executables
|
||||||
|
*.exe binary
|
||||||
|
*.pyc binary
|
||||||
|
# Prevents massive diffs caused by vendored, minified files
|
||||||
|
**/.yarn/releases/** binary
|
||||||
|
**/.yarn/plugins/** binary
|
||||||
|
|
||||||
|
# RC files (like .babelrc or .eslintrc)
|
||||||
|
*.*rc text
|
||||||
|
|
||||||
|
# Ignore files (like .npmignore or .gitignore)
|
||||||
|
*.*ignore text
|
||||||
|
|
||||||
|
# Prevents massive diffs from built files
|
||||||
|
dist/* binary
|
137
.gitignore
vendored
Normal file
137
.gitignore
vendored
Normal file
@ -0,0 +1,137 @@
|
|||||||
|
# Logs
|
||||||
|
logs
|
||||||
|
*.log
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
lerna-debug.log*
|
||||||
|
.pnpm-debug.log*
|
||||||
|
|
||||||
|
# Diagnostic reports (https://nodejs.org/api/report.html)
|
||||||
|
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
||||||
|
|
||||||
|
# Runtime data
|
||||||
|
pids
|
||||||
|
*.pid
|
||||||
|
*.seed
|
||||||
|
*.pid.lock
|
||||||
|
|
||||||
|
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||||
|
lib-cov
|
||||||
|
|
||||||
|
# Coverage directory used by tools like istanbul
|
||||||
|
coverage
|
||||||
|
*.lcov
|
||||||
|
|
||||||
|
# nyc test coverage
|
||||||
|
.nyc_output
|
||||||
|
|
||||||
|
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
||||||
|
.grunt
|
||||||
|
|
||||||
|
# Bower dependency directory (https://bower.io/)
|
||||||
|
bower_components
|
||||||
|
|
||||||
|
# node-waf configuration
|
||||||
|
.lock-wscript
|
||||||
|
|
||||||
|
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
||||||
|
build/Release
|
||||||
|
|
||||||
|
# Dependency directories
|
||||||
|
node_modules/
|
||||||
|
jspm_packages/
|
||||||
|
|
||||||
|
# Snowpack dependency directory (https://snowpack.dev/)
|
||||||
|
web_modules/
|
||||||
|
|
||||||
|
# TypeScript cache
|
||||||
|
*.tsbuildinfo
|
||||||
|
|
||||||
|
# Optional npm cache directory
|
||||||
|
.npm
|
||||||
|
|
||||||
|
# Optional eslint cache
|
||||||
|
.eslintcache
|
||||||
|
|
||||||
|
# Optional stylelint cache
|
||||||
|
.stylelintcache
|
||||||
|
|
||||||
|
# Microbundle cache
|
||||||
|
.rpt2_cache/
|
||||||
|
.rts2_cache_cjs/
|
||||||
|
.rts2_cache_es/
|
||||||
|
.rts2_cache_umd/
|
||||||
|
|
||||||
|
# Optional REPL history
|
||||||
|
.node_repl_history
|
||||||
|
|
||||||
|
# Output of 'npm pack'
|
||||||
|
*.tgz
|
||||||
|
|
||||||
|
# Yarn Integrity file
|
||||||
|
.yarn-integrity
|
||||||
|
|
||||||
|
# dotenv environment variable files
|
||||||
|
.env
|
||||||
|
.env.development.local
|
||||||
|
.env.test.local
|
||||||
|
.env.production.local
|
||||||
|
.env.local
|
||||||
|
|
||||||
|
# parcel-bundler cache (https://parceljs.org/)
|
||||||
|
.cache
|
||||||
|
.parcel-cache
|
||||||
|
|
||||||
|
# Next.js build output
|
||||||
|
.next
|
||||||
|
out
|
||||||
|
|
||||||
|
# Nuxt.js build / generate output
|
||||||
|
.nuxt
|
||||||
|
dist
|
||||||
|
|
||||||
|
# Gatsby files
|
||||||
|
.cache/
|
||||||
|
# Comment in the public line in if your project uses Gatsby and not Next.js
|
||||||
|
# https://nextjs.org/blog/next-9-1#public-directory-support
|
||||||
|
# public
|
||||||
|
|
||||||
|
# vuepress build output
|
||||||
|
.vuepress/dist
|
||||||
|
|
||||||
|
# vuepress v2.x temp and cache directory
|
||||||
|
.temp
|
||||||
|
.cache
|
||||||
|
|
||||||
|
# Docusaurus cache and generated files
|
||||||
|
.docusaurus
|
||||||
|
|
||||||
|
# Serverless directories
|
||||||
|
.serverless/
|
||||||
|
|
||||||
|
# FuseBox cache
|
||||||
|
.fusebox/
|
||||||
|
|
||||||
|
# DynamoDB Local files
|
||||||
|
.dynamodb/
|
||||||
|
|
||||||
|
# TernJS port file
|
||||||
|
.tern-port
|
||||||
|
|
||||||
|
# Stores VSCode versions used for testing VSCode extensions
|
||||||
|
.vscode-test
|
||||||
|
|
||||||
|
# yarn v2
|
||||||
|
.yarn/cache
|
||||||
|
.yarn/unplugged
|
||||||
|
.yarn/build-state.yml
|
||||||
|
.yarn/install-state.gz
|
||||||
|
.pnp.*
|
||||||
|
|
||||||
|
# Netscript Type Definitions. These are pulled from the game
|
||||||
|
NetscriptDefinitions.d.ts
|
||||||
|
|
||||||
|
# Location of the files mirrored from the game
|
||||||
|
|
||||||
|
mirror/
|
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -1,3 +0,0 @@
|
|||||||
[submodule "typescript-template"]
|
|
||||||
path = typescript-template
|
|
||||||
url = https://github.com/bitburner-official/typescript-template
|
|
5
.idea/.gitignore
generated
vendored
Normal file
5
.idea/.gitignore
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
|
# Editor-based HTTP Client requests
|
||||||
|
/httpRequests/
|
12
.idea/Bitburner-Scripts.iml
generated
Normal file
12
.idea/Bitburner-Scripts.iml
generated
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="WEB_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager">
|
||||||
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
</module>
|
5
.idea/codeStyles/codeStyleConfig.xml
generated
Normal file
5
.idea/codeStyles/codeStyleConfig.xml
generated
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<component name="ProjectCodeStyleConfiguration">
|
||||||
|
<state>
|
||||||
|
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
|
||||||
|
</state>
|
||||||
|
</component>
|
6
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
6
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<component name="InspectionProjectProfileManager">
|
||||||
|
<profile version="1.0">
|
||||||
|
<option name="myName" value="Project Default" />
|
||||||
|
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
</profile>
|
||||||
|
</component>
|
8
.idea/modules.xml
generated
Normal file
8
.idea/modules.xml
generated
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/.idea/Bitburner-Scripts.iml" filepath="$PROJECT_DIR$/.idea/Bitburner-Scripts.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
21
LICENSE
Normal file
21
LICENSE
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2023 Nils Ramstoeck & Isaac Shoebottom
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
23
README.md
Normal file
23
README.md
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# My Bitburner Scripts
|
||||||
|
|
||||||
|
My remote editor config is based on [this template](https://github.com/NilsRamstoeck/bb-external-editor/)
|
||||||
|
|
||||||
|
## How to use
|
||||||
|
1. run `npm install` in your console to install all dependencies
|
||||||
|
2. run `npm start` in your console to start the RemoteAPI server
|
||||||
|
3. open Bitburner and navigate to the settings
|
||||||
|
4. open the tab labeled 'Remote API' and enter the port '12525'
|
||||||
|
5. press connect
|
||||||
|
|
||||||
|
Now any changes made to scripts inside the server folders will automatically be uploaded to Bitburner.
|
||||||
|
|
||||||
|
## Using React
|
||||||
|
|
||||||
|
The React and ReactDOM instance from the game can simply be imported as ESModules
|
||||||
|
|
||||||
|
```js
|
||||||
|
import React from 'react' //and
|
||||||
|
import ReactDOM from 'react-dom'
|
||||||
|
```
|
||||||
|
|
||||||
|
For more in-depth details have a look at the [plugin](https://github.com/NilsRamstoeck/esbuild-bitburner-plugin) powering this template!
|
30
build.mjs
Normal file
30
build.mjs
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
import { context } from 'esbuild';
|
||||||
|
import { BitburnerPlugin } from 'esbuild-bitburner-plugin';
|
||||||
|
|
||||||
|
const createContext = async () => await context({
|
||||||
|
entryPoints: [
|
||||||
|
'servers/**/*.js',
|
||||||
|
'servers/**/*.jsx',
|
||||||
|
'servers/**/*.ts',
|
||||||
|
'servers/**/*.tsx',
|
||||||
|
],
|
||||||
|
outbase: "./servers",
|
||||||
|
outdir: "./dist",
|
||||||
|
plugins: [
|
||||||
|
BitburnerPlugin({
|
||||||
|
port: 12525,
|
||||||
|
types: 'NetscriptDefinitions.d.ts',
|
||||||
|
// mirror: { //uncomment to enable file mirroring
|
||||||
|
// 'mirror/own': ['home'],
|
||||||
|
// 'mirror/other': ['n00dles']
|
||||||
|
// }
|
||||||
|
})
|
||||||
|
],
|
||||||
|
bundle: true,
|
||||||
|
format: 'esm',
|
||||||
|
platform: 'browser',
|
||||||
|
logLevel: 'info'
|
||||||
|
});
|
||||||
|
|
||||||
|
let ctx = await createContext();
|
||||||
|
ctx.watch();
|
5
global.d.ts
vendored
Normal file
5
global.d.ts
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import {NS as _NS} from 'NetscriptDefinitions';
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
type NS = _NS;
|
||||||
|
}
|
@ -1,13 +0,0 @@
|
|||||||
/** @param {NS} ns */
|
|
||||||
export async function main(ns) {
|
|
||||||
let level = ns.getHackingLevel()
|
|
||||||
|
|
||||||
while (level < 999) {
|
|
||||||
let newLevel = ns.getHackingLevel()
|
|
||||||
if (newLevel !== level) {
|
|
||||||
ns.run("run.js")
|
|
||||||
}
|
|
||||||
level = newLevel
|
|
||||||
await ns.sleep(10 * 1000) // 10 seconds
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,4 +0,0 @@
|
|||||||
/** @param {NS} ns */
|
|
||||||
export async function main(ns) {
|
|
||||||
ns.run("recursive-run.js", 1, "home", "hack-args.js")
|
|
||||||
}
|
|
@ -1,15 +0,0 @@
|
|||||||
/** @param {NS} ns */
|
|
||||||
export async function main(ns) {
|
|
||||||
let hostname = ns.args[0]
|
|
||||||
let cost = ns.args[1]
|
|
||||||
let moneyThresh = ns.getServerMaxMoney(hostname) * 0.75;
|
|
||||||
let securityThresh = ns.getServerMinSecurityLevel(hostname) + 5;
|
|
||||||
|
|
||||||
let numThreads = ns.getServerMaxRam(hostname) / cost
|
|
||||||
numThreads = Math.floor(numThreads)
|
|
||||||
|
|
||||||
if (numThreads < 1 || numThreads == Infinity) {
|
|
||||||
numThreads = 1
|
|
||||||
}
|
|
||||||
ns.spawn("hack.js", numThreads, hostname, moneyThresh, securityThresh)
|
|
||||||
}
|
|
@ -1,15 +0,0 @@
|
|||||||
/** @param {NS} ns */
|
|
||||||
export async function main(ns) {
|
|
||||||
var target = ns.args[0]
|
|
||||||
var moneyThresh = ns.args[1]
|
|
||||||
var securityThresh = ns.args[2]
|
|
||||||
while (true) {
|
|
||||||
if (ns.getServerSecurityLevel(target) > securityThresh) {
|
|
||||||
await ns.weaken(target);
|
|
||||||
} else if (ns.getServerMoneyAvailable(target) < moneyThresh) {
|
|
||||||
await ns.grow(target);
|
|
||||||
} else {
|
|
||||||
await ns.hack(target);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,33 +0,0 @@
|
|||||||
/** @param {NS} ns */
|
|
||||||
export async function main(ns) {
|
|
||||||
let parent
|
|
||||||
if (ns.args[0] == undefined) {
|
|
||||||
parent = "home"
|
|
||||||
} else {
|
|
||||||
parent = ns.args[0]
|
|
||||||
}
|
|
||||||
|
|
||||||
let files = [
|
|
||||||
"hack-args.js",
|
|
||||||
"hack.js",
|
|
||||||
"root.js",
|
|
||||||
"recursive-copy.js",
|
|
||||||
"recursive-kill.js",
|
|
||||||
"recursive-run.js"
|
|
||||||
]
|
|
||||||
let script = "recursive-copy.js"
|
|
||||||
let servers = ns.scan()
|
|
||||||
|
|
||||||
for (const server of servers) {
|
|
||||||
if (server == parent) {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if (server == "home") {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
//ns.tprint("Copied to: :", server)
|
|
||||||
ns.scp(files, server, "home")
|
|
||||||
|
|
||||||
ns.exec(script, server, 1, ns.getHostname()) // script, dest, thread count, arg1
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,26 +0,0 @@
|
|||||||
/** @param {NS} ns */
|
|
||||||
export async function main(ns) {
|
|
||||||
let parent
|
|
||||||
if (ns.args[0] == undefined) {
|
|
||||||
parent = "home"
|
|
||||||
} else {
|
|
||||||
parent = ns.args[0]
|
|
||||||
}
|
|
||||||
let script = "recursive-kill.js"
|
|
||||||
|
|
||||||
let servers = ns.scan()
|
|
||||||
|
|
||||||
for (const server of servers) {
|
|
||||||
if (server == parent) {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if (!ns.hasRootAccess(server)) {
|
|
||||||
ns.exec("root.js", ns.getHostname(), 1, server)
|
|
||||||
}
|
|
||||||
|
|
||||||
//ns.tprint("Killed all scripts on: ", server)
|
|
||||||
ns.killall(server, true)
|
|
||||||
|
|
||||||
ns.exec(script, server, 1, ns.getHostname())
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,30 +0,0 @@
|
|||||||
/** @param {NS} ns */
|
|
||||||
export async function main(ns) {
|
|
||||||
let parent = ns.args[0]
|
|
||||||
let script = ns.args[1]
|
|
||||||
let selfScript = "recursive-run.js"
|
|
||||||
let servers = ns.scan()
|
|
||||||
//ns.tprint("INFO Scan of ", ns.getHostname(), ": ", servers)
|
|
||||||
|
|
||||||
for (const server of servers) {
|
|
||||||
if (server === parent) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
ns.exec(selfScript, server, 1, ns.getHostname(), script)
|
|
||||||
await ns.sleep(50)
|
|
||||||
|
|
||||||
let procs = ns.ps(server)
|
|
||||||
if (procs.length > 0) {
|
|
||||||
//ns.tprint("INFO Ram in use on ", server, ": ", ns.getServerUsedRam(server))
|
|
||||||
let ram = ns.getServerMaxRam(server) - ns.getServerUsedRam(server)
|
|
||||||
//ns.tprint("INFO Available ram on ", server, ": ", ram)
|
|
||||||
//ns.tprint("INFO Filename of running script: ", procs[0].filename)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ns.getServerRequiredHackingLevel(server) < ns.getHackingLevel()) {
|
|
||||||
// after thread args, first arg is the server it us running on, and then the cost of the hack script
|
|
||||||
ns.tprint("RUN Started hacking server: ", server)
|
|
||||||
ns.exec(script, server, 1, server, ns.getScriptRam("hack.js", server))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,9 +0,0 @@
|
|||||||
/** @param {NS} ns */
|
|
||||||
export async function main(ns) {
|
|
||||||
let server = ns.args[0]
|
|
||||||
if (ns.getServerNumPortsRequired(server) <= 2) {
|
|
||||||
ns.brutessh(server)
|
|
||||||
ns.ftpcrack(server)
|
|
||||||
ns.nuke(server)
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,39 +0,0 @@
|
|||||||
/** @param {NS} ns */
|
|
||||||
export async function main(ns) {
|
|
||||||
ns.run("recursive-kill.js")
|
|
||||||
await ns.sleep(1000)
|
|
||||||
ns.run("recursive-copy.js")
|
|
||||||
await ns.sleep(1000)
|
|
||||||
//home is first arg for root, hack-args is the script to run
|
|
||||||
ns.run("recursive-run.js", 1, "root-server", "hack-args.js")
|
|
||||||
|
|
||||||
//problem is that the scanning takes place on the same sever instead of the server that is the parent
|
|
||||||
//need last child of each node to spawn the process on parent, as spawning on on children always needs extra ram
|
|
||||||
//
|
|
||||||
//root scans nodes, saves to list
|
|
||||||
//the last execution of the exec on the last child passes in a flag to spawn on parent
|
|
||||||
//wait for the parent to finish using sleep (maybe find better way to syncronize)
|
|
||||||
//start hack-args function on parent
|
|
||||||
//
|
|
||||||
//each child becomes the "root" and repeats
|
|
||||||
|
|
||||||
// SCRATCH ALLAT
|
|
||||||
// its pretty much unsolveable, either way you go up or down the node tree, you end up with the problem
|
|
||||||
// not knowing if a server will have enough ram to run the hack args script, because the end node
|
|
||||||
// becomes circular. the only way to solve the problem would be to be able to have enough ram to call
|
|
||||||
// spawn after the for loop after recursive-run is called for all children in the for loop.
|
|
||||||
|
|
||||||
// so for now just will have to run a manual command for each sever with less than 8gb of ram
|
|
||||||
// a more elegant but more set in stone solution might be to just collect every unique hostname
|
|
||||||
// (print to console, but don't include parent, and exclude duplicates)
|
|
||||||
// and then just run an exec on each one in a for loop
|
|
||||||
|
|
||||||
//hack to get n00dles working, since it has low ram
|
|
||||||
await ns.sleep(1000)
|
|
||||||
ns.exec("hack-args.js", "n00dles", 1, "n00dles", 2.20)
|
|
||||||
|
|
||||||
// start auto upgrade if not running
|
|
||||||
if (!ns.isRunning("auto-upgrade.js")) {
|
|
||||||
ns.run("auto-upgrade.js")
|
|
||||||
}
|
|
||||||
}
|
|
747
package-lock.json
generated
Normal file
747
package-lock.json
generated
Normal file
@ -0,0 +1,747 @@
|
|||||||
|
{
|
||||||
|
"name": "bb-external-editor",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"lockfileVersion": 3,
|
||||||
|
"requires": true,
|
||||||
|
"packages": {
|
||||||
|
"": {
|
||||||
|
"name": "bb-external-editor",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@types/react": "^18.2.25",
|
||||||
|
"@types/react-dom": "^18.2.10",
|
||||||
|
"esbuild": "^0.19.4",
|
||||||
|
"esbuild-bitburner-plugin": "^1.1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/android-arm": {
|
||||||
|
"version": "0.19.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.5.tgz",
|
||||||
|
"integrity": "sha512-bhvbzWFF3CwMs5tbjf3ObfGqbl/17ict2/uwOSfr3wmxDE6VdS2GqY/FuzIPe0q0bdhj65zQsvqfArI9MY6+AA==",
|
||||||
|
"cpu": [
|
||||||
|
"arm"
|
||||||
|
],
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"android"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/android-arm64": {
|
||||||
|
"version": "0.19.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.5.tgz",
|
||||||
|
"integrity": "sha512-5d1OkoJxnYQfmC+Zd8NBFjkhyCNYwM4n9ODrycTFY6Jk1IGiZ+tjVJDDSwDt77nK+tfpGP4T50iMtVi4dEGzhQ==",
|
||||||
|
"cpu": [
|
||||||
|
"arm64"
|
||||||
|
],
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"android"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/android-x64": {
|
||||||
|
"version": "0.19.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.5.tgz",
|
||||||
|
"integrity": "sha512-9t+28jHGL7uBdkBjL90QFxe7DVA+KGqWlHCF8ChTKyaKO//VLuoBricQCgwhOjA1/qOczsw843Fy4cbs4H3DVA==",
|
||||||
|
"cpu": [
|
||||||
|
"x64"
|
||||||
|
],
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"android"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/darwin-arm64": {
|
||||||
|
"version": "0.19.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.5.tgz",
|
||||||
|
"integrity": "sha512-mvXGcKqqIqyKoxq26qEDPHJuBYUA5KizJncKOAf9eJQez+L9O+KfvNFu6nl7SCZ/gFb2QPaRqqmG0doSWlgkqw==",
|
||||||
|
"cpu": [
|
||||||
|
"arm64"
|
||||||
|
],
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"darwin"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/darwin-x64": {
|
||||||
|
"version": "0.19.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.5.tgz",
|
||||||
|
"integrity": "sha512-Ly8cn6fGLNet19s0X4unjcniX24I0RqjPv+kurpXabZYSXGM4Pwpmf85WHJN3lAgB8GSth7s5A0r856S+4DyiA==",
|
||||||
|
"cpu": [
|
||||||
|
"x64"
|
||||||
|
],
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"darwin"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/freebsd-arm64": {
|
||||||
|
"version": "0.19.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.5.tgz",
|
||||||
|
"integrity": "sha512-GGDNnPWTmWE+DMchq1W8Sd0mUkL+APvJg3b11klSGUDvRXh70JqLAO56tubmq1s2cgpVCSKYywEiKBfju8JztQ==",
|
||||||
|
"cpu": [
|
||||||
|
"arm64"
|
||||||
|
],
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"freebsd"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/freebsd-x64": {
|
||||||
|
"version": "0.19.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.5.tgz",
|
||||||
|
"integrity": "sha512-1CCwDHnSSoA0HNwdfoNY0jLfJpd7ygaLAp5EHFos3VWJCRX9DMwWODf96s9TSse39Br7oOTLryRVmBoFwXbuuQ==",
|
||||||
|
"cpu": [
|
||||||
|
"x64"
|
||||||
|
],
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"freebsd"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/linux-arm": {
|
||||||
|
"version": "0.19.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.5.tgz",
|
||||||
|
"integrity": "sha512-lrWXLY/vJBzCPC51QN0HM71uWgIEpGSjSZZADQhq7DKhPcI6NH1IdzjfHkDQws2oNpJKpR13kv7/pFHBbDQDwQ==",
|
||||||
|
"cpu": [
|
||||||
|
"arm"
|
||||||
|
],
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/linux-arm64": {
|
||||||
|
"version": "0.19.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.5.tgz",
|
||||||
|
"integrity": "sha512-o3vYippBmSrjjQUCEEiTZ2l+4yC0pVJD/Dl57WfPwwlvFkrxoSO7rmBZFii6kQB3Wrn/6GwJUPLU5t52eq2meA==",
|
||||||
|
"cpu": [
|
||||||
|
"arm64"
|
||||||
|
],
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/linux-ia32": {
|
||||||
|
"version": "0.19.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.5.tgz",
|
||||||
|
"integrity": "sha512-MkjHXS03AXAkNp1KKkhSKPOCYztRtK+KXDNkBa6P78F8Bw0ynknCSClO/ztGszILZtyO/lVKpa7MolbBZ6oJtQ==",
|
||||||
|
"cpu": [
|
||||||
|
"ia32"
|
||||||
|
],
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/linux-loong64": {
|
||||||
|
"version": "0.19.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.5.tgz",
|
||||||
|
"integrity": "sha512-42GwZMm5oYOD/JHqHska3Jg0r+XFb/fdZRX+WjADm3nLWLcIsN27YKtqxzQmGNJgu0AyXg4HtcSK9HuOk3v1Dw==",
|
||||||
|
"cpu": [
|
||||||
|
"loong64"
|
||||||
|
],
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/linux-mips64el": {
|
||||||
|
"version": "0.19.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.5.tgz",
|
||||||
|
"integrity": "sha512-kcjndCSMitUuPJobWCnwQ9lLjiLZUR3QLQmlgaBfMX23UEa7ZOrtufnRds+6WZtIS9HdTXqND4yH8NLoVVIkcg==",
|
||||||
|
"cpu": [
|
||||||
|
"mips64el"
|
||||||
|
],
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/linux-ppc64": {
|
||||||
|
"version": "0.19.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.5.tgz",
|
||||||
|
"integrity": "sha512-yJAxJfHVm0ZbsiljbtFFP1BQKLc8kUF6+17tjQ78QjqjAQDnhULWiTA6u0FCDmYT1oOKS9PzZ2z0aBI+Mcyj7Q==",
|
||||||
|
"cpu": [
|
||||||
|
"ppc64"
|
||||||
|
],
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/linux-riscv64": {
|
||||||
|
"version": "0.19.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.5.tgz",
|
||||||
|
"integrity": "sha512-5u8cIR/t3gaD6ad3wNt1MNRstAZO+aNyBxu2We8X31bA8XUNyamTVQwLDA1SLoPCUehNCymhBhK3Qim1433Zag==",
|
||||||
|
"cpu": [
|
||||||
|
"riscv64"
|
||||||
|
],
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/linux-s390x": {
|
||||||
|
"version": "0.19.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.5.tgz",
|
||||||
|
"integrity": "sha512-Z6JrMyEw/EmZBD/OFEFpb+gao9xJ59ATsoTNlj39jVBbXqoZm4Xntu6wVmGPB/OATi1uk/DB+yeDPv2E8PqZGw==",
|
||||||
|
"cpu": [
|
||||||
|
"s390x"
|
||||||
|
],
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/linux-x64": {
|
||||||
|
"version": "0.19.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.5.tgz",
|
||||||
|
"integrity": "sha512-psagl+2RlK1z8zWZOmVdImisMtrUxvwereIdyJTmtmHahJTKb64pAcqoPlx6CewPdvGvUKe2Jw+0Z/0qhSbG1A==",
|
||||||
|
"cpu": [
|
||||||
|
"x64"
|
||||||
|
],
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/netbsd-x64": {
|
||||||
|
"version": "0.19.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.5.tgz",
|
||||||
|
"integrity": "sha512-kL2l+xScnAy/E/3119OggX8SrWyBEcqAh8aOY1gr4gPvw76la2GlD4Ymf832UCVbmuWeTf2adkZDK+h0Z/fB4g==",
|
||||||
|
"cpu": [
|
||||||
|
"x64"
|
||||||
|
],
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"netbsd"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/openbsd-x64": {
|
||||||
|
"version": "0.19.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.5.tgz",
|
||||||
|
"integrity": "sha512-sPOfhtzFufQfTBgRnE1DIJjzsXukKSvZxloZbkJDG383q0awVAq600pc1nfqBcl0ice/WN9p4qLc39WhBShRTA==",
|
||||||
|
"cpu": [
|
||||||
|
"x64"
|
||||||
|
],
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"openbsd"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/sunos-x64": {
|
||||||
|
"version": "0.19.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.5.tgz",
|
||||||
|
"integrity": "sha512-dGZkBXaafuKLpDSjKcB0ax0FL36YXCvJNnztjKV+6CO82tTYVDSH2lifitJ29jxRMoUhgkg9a+VA/B03WK5lcg==",
|
||||||
|
"cpu": [
|
||||||
|
"x64"
|
||||||
|
],
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"sunos"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/win32-arm64": {
|
||||||
|
"version": "0.19.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.5.tgz",
|
||||||
|
"integrity": "sha512-dWVjD9y03ilhdRQ6Xig1NWNgfLtf2o/STKTS+eZuF90fI2BhbwD6WlaiCGKptlqXlURVB5AUOxUj09LuwKGDTg==",
|
||||||
|
"cpu": [
|
||||||
|
"arm64"
|
||||||
|
],
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"win32"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/win32-ia32": {
|
||||||
|
"version": "0.19.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.5.tgz",
|
||||||
|
"integrity": "sha512-4liggWIA4oDgUxqpZwrDhmEfAH4d0iljanDOK7AnVU89T6CzHon/ony8C5LeOdfgx60x5cnQJFZwEydVlYx4iw==",
|
||||||
|
"cpu": [
|
||||||
|
"ia32"
|
||||||
|
],
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"win32"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/win32-x64": {
|
||||||
|
"version": "0.19.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.5.tgz",
|
||||||
|
"integrity": "sha512-czTrygUsB/jlM8qEW5MD8bgYU2Xg14lo6kBDXW6HdxKjh8M5PzETGiSHaz9MtbXBYDloHNUAUW2tMiKW4KM9Mw==",
|
||||||
|
"cpu": [
|
||||||
|
"x64"
|
||||||
|
],
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"win32"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@types/prop-types": {
|
||||||
|
"version": "15.7.9",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.9.tgz",
|
||||||
|
"integrity": "sha512-n1yyPsugYNSmHgxDFjicaI2+gCNjsBck8UX9kuofAKlc0h1bL+20oSF72KeNaW2DUlesbEVCFgyV2dPGTiY42g=="
|
||||||
|
},
|
||||||
|
"node_modules/@types/react": {
|
||||||
|
"version": "18.2.34",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.34.tgz",
|
||||||
|
"integrity": "sha512-U6eW/alrRk37FU/MS2RYMjx0Va2JGIVXELTODaTIYgvWGCV4Y4TfTUzG8DdmpDNIT0Xpj/R7GfyHOJJrDttcvg==",
|
||||||
|
"dependencies": {
|
||||||
|
"@types/prop-types": "*",
|
||||||
|
"@types/scheduler": "*",
|
||||||
|
"csstype": "^3.0.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@types/react-dom": {
|
||||||
|
"version": "18.2.14",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.14.tgz",
|
||||||
|
"integrity": "sha512-V835xgdSVmyQmI1KLV2BEIUgqEuinxp9O4G6g3FqO/SqLac049E53aysv0oEFD2kHfejeKU+ZqL2bcFWj9gLAQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"@types/react": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@types/scheduler": {
|
||||||
|
"version": "0.16.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.5.tgz",
|
||||||
|
"integrity": "sha512-s/FPdYRmZR8SjLWGMCuax7r3qCWQw9QKHzXVukAuuIJkXkDRwp+Pu5LMIVFi0Fxbav35WURicYr8u1QsoybnQw=="
|
||||||
|
},
|
||||||
|
"node_modules/anymatch": {
|
||||||
|
"version": "3.1.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz",
|
||||||
|
"integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==",
|
||||||
|
"dependencies": {
|
||||||
|
"normalize-path": "^3.0.0",
|
||||||
|
"picomatch": "^2.0.4"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/binary-extensions": {
|
||||||
|
"version": "2.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz",
|
||||||
|
"integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/braces": {
|
||||||
|
"version": "3.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
|
||||||
|
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
|
||||||
|
"dependencies": {
|
||||||
|
"fill-range": "^7.0.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/bufferutil": {
|
||||||
|
"version": "4.0.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.8.tgz",
|
||||||
|
"integrity": "sha512-4T53u4PdgsXqKaIctwF8ifXlRTTmEPJ8iEPWFdGZvcf7sbwYo6FKFEX9eNNAnzFZ7EzJAQ3CJeOtCRA4rDp7Pw==",
|
||||||
|
"hasInstallScript": true,
|
||||||
|
"dependencies": {
|
||||||
|
"node-gyp-build": "^4.3.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6.14.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/chokidar": {
|
||||||
|
"version": "3.5.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz",
|
||||||
|
"integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==",
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "individual",
|
||||||
|
"url": "https://paulmillr.com/funding/"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"dependencies": {
|
||||||
|
"anymatch": "~3.1.2",
|
||||||
|
"braces": "~3.0.2",
|
||||||
|
"glob-parent": "~5.1.2",
|
||||||
|
"is-binary-path": "~2.1.0",
|
||||||
|
"is-glob": "~4.0.1",
|
||||||
|
"normalize-path": "~3.0.0",
|
||||||
|
"readdirp": "~3.6.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 8.10.0"
|
||||||
|
},
|
||||||
|
"optionalDependencies": {
|
||||||
|
"fsevents": "~2.3.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/csstype": {
|
||||||
|
"version": "3.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz",
|
||||||
|
"integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ=="
|
||||||
|
},
|
||||||
|
"node_modules/d": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz",
|
||||||
|
"integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==",
|
||||||
|
"dependencies": {
|
||||||
|
"es5-ext": "^0.10.50",
|
||||||
|
"type": "^1.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/debug": {
|
||||||
|
"version": "2.6.9",
|
||||||
|
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
|
||||||
|
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
|
||||||
|
"dependencies": {
|
||||||
|
"ms": "2.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/es5-ext": {
|
||||||
|
"version": "0.10.62",
|
||||||
|
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.62.tgz",
|
||||||
|
"integrity": "sha512-BHLqn0klhEpnOKSrzn/Xsz2UIW8j+cGmo9JLzr8BiUapV8hPL9+FliFqjwr9ngW7jWdnxv6eO+/LqyhJVqgrjA==",
|
||||||
|
"hasInstallScript": true,
|
||||||
|
"dependencies": {
|
||||||
|
"es6-iterator": "^2.0.3",
|
||||||
|
"es6-symbol": "^3.1.3",
|
||||||
|
"next-tick": "^1.1.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/es6-iterator": {
|
||||||
|
"version": "2.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz",
|
||||||
|
"integrity": "sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==",
|
||||||
|
"dependencies": {
|
||||||
|
"d": "1",
|
||||||
|
"es5-ext": "^0.10.35",
|
||||||
|
"es6-symbol": "^3.1.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/es6-symbol": {
|
||||||
|
"version": "3.1.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz",
|
||||||
|
"integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==",
|
||||||
|
"dependencies": {
|
||||||
|
"d": "^1.0.1",
|
||||||
|
"ext": "^1.1.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/esbuild": {
|
||||||
|
"version": "0.19.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.5.tgz",
|
||||||
|
"integrity": "sha512-bUxalY7b1g8vNhQKdB24QDmHeY4V4tw/s6Ak5z+jJX9laP5MoQseTOMemAr0gxssjNcH0MCViG8ONI2kksvfFQ==",
|
||||||
|
"hasInstallScript": true,
|
||||||
|
"bin": {
|
||||||
|
"esbuild": "bin/esbuild"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
},
|
||||||
|
"optionalDependencies": {
|
||||||
|
"@esbuild/android-arm": "0.19.5",
|
||||||
|
"@esbuild/android-arm64": "0.19.5",
|
||||||
|
"@esbuild/android-x64": "0.19.5",
|
||||||
|
"@esbuild/darwin-arm64": "0.19.5",
|
||||||
|
"@esbuild/darwin-x64": "0.19.5",
|
||||||
|
"@esbuild/freebsd-arm64": "0.19.5",
|
||||||
|
"@esbuild/freebsd-x64": "0.19.5",
|
||||||
|
"@esbuild/linux-arm": "0.19.5",
|
||||||
|
"@esbuild/linux-arm64": "0.19.5",
|
||||||
|
"@esbuild/linux-ia32": "0.19.5",
|
||||||
|
"@esbuild/linux-loong64": "0.19.5",
|
||||||
|
"@esbuild/linux-mips64el": "0.19.5",
|
||||||
|
"@esbuild/linux-ppc64": "0.19.5",
|
||||||
|
"@esbuild/linux-riscv64": "0.19.5",
|
||||||
|
"@esbuild/linux-s390x": "0.19.5",
|
||||||
|
"@esbuild/linux-x64": "0.19.5",
|
||||||
|
"@esbuild/netbsd-x64": "0.19.5",
|
||||||
|
"@esbuild/openbsd-x64": "0.19.5",
|
||||||
|
"@esbuild/sunos-x64": "0.19.5",
|
||||||
|
"@esbuild/win32-arm64": "0.19.5",
|
||||||
|
"@esbuild/win32-ia32": "0.19.5",
|
||||||
|
"@esbuild/win32-x64": "0.19.5"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/esbuild-bitburner-plugin": {
|
||||||
|
"version": "1.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/esbuild-bitburner-plugin/-/esbuild-bitburner-plugin-1.1.0.tgz",
|
||||||
|
"integrity": "sha512-4hcBGNbWQnZK97h3fsAzHxotJdTYkmdpWosXqRKsminBplmS5+x69LxEO8beVUmqpCErbEsyaU2dUOsCOms/BA==",
|
||||||
|
"dependencies": {
|
||||||
|
"chokidar": "^3.5.3",
|
||||||
|
"websocket": "^1.0.34"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/ext": {
|
||||||
|
"version": "1.7.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz",
|
||||||
|
"integrity": "sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==",
|
||||||
|
"dependencies": {
|
||||||
|
"type": "^2.7.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/ext/node_modules/type": {
|
||||||
|
"version": "2.7.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/type/-/type-2.7.2.tgz",
|
||||||
|
"integrity": "sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw=="
|
||||||
|
},
|
||||||
|
"node_modules/fill-range": {
|
||||||
|
"version": "7.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
|
||||||
|
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"to-regex-range": "^5.0.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/fsevents": {
|
||||||
|
"version": "2.3.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
|
||||||
|
"integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
|
||||||
|
"hasInstallScript": true,
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"darwin"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/glob-parent": {
|
||||||
|
"version": "5.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
|
||||||
|
"integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
|
||||||
|
"dependencies": {
|
||||||
|
"is-glob": "^4.0.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/is-binary-path": {
|
||||||
|
"version": "2.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz",
|
||||||
|
"integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==",
|
||||||
|
"dependencies": {
|
||||||
|
"binary-extensions": "^2.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/is-extglob": {
|
||||||
|
"version": "2.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
|
||||||
|
"integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/is-glob": {
|
||||||
|
"version": "4.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
|
||||||
|
"integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
|
||||||
|
"dependencies": {
|
||||||
|
"is-extglob": "^2.1.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/is-number": {
|
||||||
|
"version": "7.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
|
||||||
|
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.12.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/is-typedarray": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA=="
|
||||||
|
},
|
||||||
|
"node_modules/ms": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
|
||||||
|
},
|
||||||
|
"node_modules/next-tick": {
|
||||||
|
"version": "1.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz",
|
||||||
|
"integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ=="
|
||||||
|
},
|
||||||
|
"node_modules/node-gyp-build": {
|
||||||
|
"version": "4.6.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.1.tgz",
|
||||||
|
"integrity": "sha512-24vnklJmyRS8ViBNI8KbtK/r/DmXQMRiOMXTNz2nrTnAYUwjmEEbnnpB/+kt+yWRv73bPsSPRFddrcIbAxSiMQ==",
|
||||||
|
"bin": {
|
||||||
|
"node-gyp-build": "bin.js",
|
||||||
|
"node-gyp-build-optional": "optional.js",
|
||||||
|
"node-gyp-build-test": "build-test.js"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/normalize-path": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
|
||||||
|
"integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/picomatch": {
|
||||||
|
"version": "2.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
|
||||||
|
"integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8.6"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/jonschlinkert"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/readdirp": {
|
||||||
|
"version": "3.6.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz",
|
||||||
|
"integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==",
|
||||||
|
"dependencies": {
|
||||||
|
"picomatch": "^2.2.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/to-regex-range": {
|
||||||
|
"version": "5.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
|
||||||
|
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"is-number": "^7.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/type": {
|
||||||
|
"version": "1.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz",
|
||||||
|
"integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg=="
|
||||||
|
},
|
||||||
|
"node_modules/typedarray-to-buffer": {
|
||||||
|
"version": "3.1.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz",
|
||||||
|
"integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==",
|
||||||
|
"dependencies": {
|
||||||
|
"is-typedarray": "^1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/utf-8-validate": {
|
||||||
|
"version": "5.0.10",
|
||||||
|
"resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.10.tgz",
|
||||||
|
"integrity": "sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==",
|
||||||
|
"hasInstallScript": true,
|
||||||
|
"dependencies": {
|
||||||
|
"node-gyp-build": "^4.3.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6.14.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/websocket": {
|
||||||
|
"version": "1.0.34",
|
||||||
|
"resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.34.tgz",
|
||||||
|
"integrity": "sha512-PRDso2sGwF6kM75QykIesBijKSVceR6jL2G8NGYyq2XrItNC2P5/qL5XeR056GhA+Ly7JMFvJb9I312mJfmqnQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"bufferutil": "^4.0.1",
|
||||||
|
"debug": "^2.2.0",
|
||||||
|
"es5-ext": "^0.10.50",
|
||||||
|
"typedarray-to-buffer": "^3.1.5",
|
||||||
|
"utf-8-validate": "^5.0.2",
|
||||||
|
"yaeti": "^0.0.6"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=4.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/yaeti": {
|
||||||
|
"version": "0.0.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz",
|
||||||
|
"integrity": "sha512-MvQa//+KcZCUkBTIC9blM+CU9J2GzuTytsOUwf2lidtvkx/6gnEp1QvJv34t9vdjhFmha/mUiNDbN0D0mJWdug==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10.32"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
25
package.json
Normal file
25
package.json
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
"name": "bb-external-editor",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "template for external editors for the game bitburner",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"start": "node ./build.mjs"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/NilsRamstoeck/bb-external-editor.git"
|
||||||
|
},
|
||||||
|
"author": "Nils Ramstöck",
|
||||||
|
"license": "MIT",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/NilsRamstoeck/bb-external-editor/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/NilsRamstoeck/bb-external-editor#readme",
|
||||||
|
"dependencies": {
|
||||||
|
"@types/react": "^18.2.25",
|
||||||
|
"@types/react-dom": "^18.2.10",
|
||||||
|
"esbuild": "^0.19.4",
|
||||||
|
"esbuild-bitburner-plugin": "^1.1.0"
|
||||||
|
}
|
||||||
|
}
|
5
servers/home/autoexec.ts
Normal file
5
servers/home/autoexec.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
export async function main(ns: NS) {
|
||||||
|
ns.run("hackallservers.js")
|
||||||
|
ns.run("watcher.js")
|
||||||
|
ns.run("hacknet.js")
|
||||||
|
}
|
14
servers/home/hack.ts
Normal file
14
servers/home/hack.ts
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
export async function main(ns: NS) {
|
||||||
|
const server: string = <string> ns.args[0]
|
||||||
|
while (true) {
|
||||||
|
// Guide https://darktechnomancer.github.io/#glossary-of-terms
|
||||||
|
|
||||||
|
if (ns.getServerSecurityLevel(server) > 5) {
|
||||||
|
await ns.weaken(server)
|
||||||
|
} else if (ns.getServerMoneyAvailable(server) < ns.getServerMaxMoney(server) * 0.95) {
|
||||||
|
await ns.grow(server)
|
||||||
|
} else {
|
||||||
|
await ns.hack(server)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
15
servers/home/hackallservers.ts
Normal file
15
servers/home/hackallservers.ts
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import { executeScriptOnServerFromAnother, recursiveScan } from "./utils"
|
||||||
|
|
||||||
|
export async function main(ns: NS) {
|
||||||
|
let servers: string[] = recursiveScan(ns)
|
||||||
|
|
||||||
|
for (const server of servers) {
|
||||||
|
// Guard clause for story servers, but hacking xp is nice. Can probably be enabled when XP is easy to get
|
||||||
|
// if (ns.getServerMaxMoney(server) === 0) { continue }
|
||||||
|
|
||||||
|
let numThreads = ns.getServerMaxRam(server) / ns.getScriptRam("hack.js")
|
||||||
|
numThreads = Math.floor(numThreads)
|
||||||
|
numThreads = Math.max(numThreads, 1) // Make sure we have at least 1 thread
|
||||||
|
executeScriptOnServerFromAnother(ns, server, "hack.js", numThreads, [server])
|
||||||
|
}
|
||||||
|
}
|
103
servers/home/hacknet.ts
Normal file
103
servers/home/hacknet.ts
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
/*
|
||||||
|
* TODO:
|
||||||
|
* The current solution is not optimal, as it's preferable to buy new nodes, even if upgrading is cheaper.
|
||||||
|
* TODO:
|
||||||
|
* It may be helpful to calculate the money per second of each node on average, (total mps / total nodes) and compare
|
||||||
|
* it to the time it would take to purchase the next cheapest upgrade, and if the average mps is greater than the
|
||||||
|
* negative mps of the upgrade cost, then buy a new node.
|
||||||
|
* TODO:
|
||||||
|
* Potential Ideas:
|
||||||
|
* Find a way to calculate how much mps an individual upgrade would give, and compare it to the average mps of the node.
|
||||||
|
* ns.hacknet.getNodeStats(0).production
|
||||||
|
* If the upgrade mps is greater than the average mps, then buy the upgrade.
|
||||||
|
* If the upgrade mps is less than the average mps, then buy a new node.
|
||||||
|
*/
|
||||||
|
|
||||||
|
enum UpgradeType {
|
||||||
|
level = "level", ram = "ram", core = "code",
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function main(ns: NS) {
|
||||||
|
let timeout: number = <number> ns.args[0]
|
||||||
|
|
||||||
|
let nodes = ns.hacknet.numNodes()
|
||||||
|
// If there are no nodes, buyUpgrade one
|
||||||
|
if (nodes === 0) {
|
||||||
|
ns.hacknet.purchaseNode()
|
||||||
|
nodes = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
let costs: { type: UpgradeType, cost: number }[] = []
|
||||||
|
while (true) {
|
||||||
|
costs = []
|
||||||
|
// Go through each node and get the cheapest upgrade
|
||||||
|
for (let i = 0; i < nodes; i++) {
|
||||||
|
costs.push(getCheapestCost(ns, i))
|
||||||
|
}
|
||||||
|
// Get the cheapest upgrade object
|
||||||
|
let cheapest = costs.reduce((prev, curr) => prev.cost < curr.cost ? prev : curr)
|
||||||
|
|
||||||
|
// Nodes have a lot more value, so only need node price to be 1/10th the cost of the cheapest upgrade
|
||||||
|
if (ns.hacknet.getPurchaseNodeCost() / 10 < cheapest.cost) {
|
||||||
|
await buyNode(ns, ns.hacknet.getPurchaseNodeCost(), timeout)
|
||||||
|
} else {
|
||||||
|
await buyUpgrade(ns, cheapest.type, cheapest.cost, costs.indexOf(cheapest), timeout)
|
||||||
|
}
|
||||||
|
// Make sure that the number of nodes is up-to-date
|
||||||
|
nodes = ns.hacknet.numNodes()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wait until the player has enough money to buyUpgrade something
|
||||||
|
* @param ns Global NS object
|
||||||
|
* @param money Amount of money to wait for
|
||||||
|
* @param timeout=-1 Number of seconds to wait before timing out.
|
||||||
|
* @throws Error if the timeout is reached
|
||||||
|
* @note This function will wait forever by default
|
||||||
|
*/
|
||||||
|
async function waitUntilMoney(ns: NS, money: number, timeout: number = -1) {
|
||||||
|
while (ns.getServerMoneyAvailable("home") < money) {
|
||||||
|
await ns.sleep(1000)
|
||||||
|
if (timeout == 0) {
|
||||||
|
throw new Error("Timed out waiting for money")
|
||||||
|
} else if (timeout > -1) {
|
||||||
|
timeout--
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function buyUpgrade(ns: NS, type: UpgradeType, cost: number, node: number, timeout: number) {
|
||||||
|
await waitUntilMoney(ns, cost, timeout)
|
||||||
|
switch (type) {
|
||||||
|
case UpgradeType.level:
|
||||||
|
ns.hacknet.upgradeLevel(node)
|
||||||
|
break
|
||||||
|
case UpgradeType.ram:
|
||||||
|
ns.hacknet.upgradeRam(node)
|
||||||
|
break
|
||||||
|
case UpgradeType.core:
|
||||||
|
ns.hacknet.upgradeCore(node)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function buyNode(ns: NS, cost: number, timeout: number) {
|
||||||
|
await waitUntilMoney(ns, cost, timeout)
|
||||||
|
ns.hacknet.purchaseNode()
|
||||||
|
}
|
||||||
|
|
||||||
|
function getCheapestCost(ns: NS, node: number) {
|
||||||
|
let levelCost = ns.hacknet.getLevelUpgradeCost(node)
|
||||||
|
let ramCost = ns.hacknet.getRamUpgradeCost(node)
|
||||||
|
let coreCost = ns.hacknet.getCoreUpgradeCost(node)
|
||||||
|
let cheapest = Math.min(levelCost, ramCost, coreCost)
|
||||||
|
switch (cheapest) {
|
||||||
|
case levelCost:
|
||||||
|
return { type: UpgradeType.level, cost: levelCost }
|
||||||
|
case ramCost:
|
||||||
|
return { type: UpgradeType.ram, cost: ramCost }
|
||||||
|
case coreCost:
|
||||||
|
return { type: UpgradeType.core, cost: coreCost }
|
||||||
|
}
|
||||||
|
}
|
8
servers/home/killall.ts
Normal file
8
servers/home/killall.ts
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
import { recursiveScan } from "./utils"
|
||||||
|
|
||||||
|
export async function main(ns: NS) {
|
||||||
|
let servers: string[] = recursiveScan(ns)
|
||||||
|
for (const server of servers) {
|
||||||
|
ns.killall(server)
|
||||||
|
}
|
||||||
|
}
|
32
servers/home/programs.ts
Normal file
32
servers/home/programs.ts
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
import { recursiveHackingRequired, recursiveScan, removeFilesOnAllServers } from "./utils"
|
||||||
|
|
||||||
|
export async function main(ns: NS) {
|
||||||
|
switch (ns.args[0]) {
|
||||||
|
case "getServers":
|
||||||
|
getServers(ns)
|
||||||
|
break
|
||||||
|
case "getHackingLevels":
|
||||||
|
getHackingLevels(ns)
|
||||||
|
break
|
||||||
|
case "removeFiles":
|
||||||
|
removeFilesOnAllServersFromArgs(ns)
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
ns.tprint("Invalid program name")
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getServers(ns: NS) {
|
||||||
|
ns.tprint(recursiveScan(ns))
|
||||||
|
}
|
||||||
|
|
||||||
|
function getHackingLevels(ns: NS) {
|
||||||
|
ns.tprint(recursiveHackingRequired(ns))
|
||||||
|
}
|
||||||
|
|
||||||
|
function removeFilesOnAllServersFromArgs(ns: NS) {
|
||||||
|
let args = ns.args.slice(1)
|
||||||
|
let files = args.map((file) => file.toString())
|
||||||
|
removeFilesOnAllServers(ns, files)
|
||||||
|
}
|
183
servers/home/utils.ts
Normal file
183
servers/home/utils.ts
Normal file
@ -0,0 +1,183 @@
|
|||||||
|
// noinspection JSUnusedGlobalSymbols
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Recursively scans all servers connected to the current server, excluding home
|
||||||
|
* @param ns global NS object
|
||||||
|
* @returns A list of all servers connected to the current server
|
||||||
|
*/
|
||||||
|
export function recursiveScan(ns: NS) {
|
||||||
|
// Starting case
|
||||||
|
let servers = ns.scan("home")
|
||||||
|
// Add all servers to the list
|
||||||
|
let allServers: string[] = []
|
||||||
|
while (servers.length > 0) {
|
||||||
|
let server = servers.pop()
|
||||||
|
if (server) {
|
||||||
|
let newServers = ns.scan(server)
|
||||||
|
for (const newServer of newServers) {
|
||||||
|
if (!allServers.includes(newServer)) {
|
||||||
|
allServers.push(newServer)
|
||||||
|
servers.push(newServer)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Remove the home server from the list
|
||||||
|
return allServers.filter(server => server !== "home").sort()
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Recursively scans all servers connected to the current server for the set of all levels that hackable servers require
|
||||||
|
* @param ns
|
||||||
|
* @returns A set of every hacking level required to hack a new server
|
||||||
|
*/
|
||||||
|
export function recursiveHackingRequired(ns: NS) {
|
||||||
|
let servers = recursiveScan(ns)
|
||||||
|
let levels: number[] = []
|
||||||
|
for (let server of servers) {
|
||||||
|
levels.push(ns.getServerRequiredHackingLevel(server))
|
||||||
|
}
|
||||||
|
// Sort and remove duplicates, need custom sort because built-in sort only works alphabetically 💀
|
||||||
|
return [...new Set(levels)].sort((a, b) => a - b)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes files passed in from all servers
|
||||||
|
* @param ns Global NS object
|
||||||
|
* @param files The files to remove
|
||||||
|
* @returns void
|
||||||
|
* @example Removes all files from the folder "no-ports" from all servers.
|
||||||
|
* removeFilesOnAllServers(ns, ns.ls("home", "no-ports"));
|
||||||
|
* @note ns.ls() returns the full path of every file, so if the file is not in the same place in every server,
|
||||||
|
* you will need to modify each file path to match the server you are removing it from.
|
||||||
|
*/
|
||||||
|
export function removeFilesOnAllServers(ns: NS, files: string[]) {
|
||||||
|
let hosts = recursiveScan(ns)
|
||||||
|
for (const host of hosts) {
|
||||||
|
for (const file of files) {
|
||||||
|
ns.rm(file, host)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tries to gain root access to a server
|
||||||
|
* @param ns Global NS object
|
||||||
|
* @param server The server to gain root access to
|
||||||
|
* @returns The number of programs used to gain root access
|
||||||
|
*/
|
||||||
|
export function rootServer(ns: NS, server: string) {
|
||||||
|
let counter = 0
|
||||||
|
if (ns.fileExists("BruteSSH.exe", "home")) {
|
||||||
|
ns.brutessh(server)
|
||||||
|
counter++
|
||||||
|
}
|
||||||
|
if (ns.fileExists("FTPCrack.exe", "home")) {
|
||||||
|
ns.ftpcrack(server)
|
||||||
|
counter++
|
||||||
|
}
|
||||||
|
if (ns.fileExists("relaySMTP.exe", "home")) {
|
||||||
|
ns.relaysmtp(server)
|
||||||
|
counter++
|
||||||
|
}
|
||||||
|
if (ns.fileExists("HTTPWorm.exe", "home")) {
|
||||||
|
ns.httpworm(server)
|
||||||
|
counter++
|
||||||
|
}
|
||||||
|
if (ns.fileExists("SQLInject.exe", "home")) {
|
||||||
|
ns.sqlinject(server)
|
||||||
|
counter++
|
||||||
|
}
|
||||||
|
if (counter >= ns.getServerNumPortsRequired(server)) {
|
||||||
|
ns.nuke(server)
|
||||||
|
}
|
||||||
|
return counter
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Performs a function on a server if the player is capable of doing so, otherwise returns false
|
||||||
|
* @param ns Global NS object
|
||||||
|
* @param server The server to perform the function on
|
||||||
|
* @param func The function to perform
|
||||||
|
* @param args The arguments to pass to the function
|
||||||
|
* @returns The result of the function if it is performed or true if the function does not return anything, otherwise false
|
||||||
|
*/
|
||||||
|
export function performFunctionIfCapable(ns: NS, server: string, func: CallableFunction, args: any[]) {
|
||||||
|
ns.print(`Performing function on ${server}`)
|
||||||
|
if (ns.getHackingLevel() < ns.getServerRequiredHackingLevel(server)) {
|
||||||
|
ns.print(`Not enough hacking level to hack ${server}`)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (ns.getServer(server).openPortCount <= ns.getServerNumPortsRequired(server)) {
|
||||||
|
ns.print(`Not enough ports, trying to root ${server}`)
|
||||||
|
if (rootServer(ns, server) < ns.getServerNumPortsRequired(server)) {
|
||||||
|
ns.print(`Failed to root ${server}`)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let result = func(...args)
|
||||||
|
if (result === undefined) {
|
||||||
|
return true
|
||||||
|
} else {
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Executes a script on a server from another server
|
||||||
|
* @param ns Global NS object
|
||||||
|
* @param server The server to execute the script on
|
||||||
|
* @param script The file path of the script to execute
|
||||||
|
* @param threads The number of threads to use
|
||||||
|
* @param args The arguments to pass to the script
|
||||||
|
*/
|
||||||
|
export function executeScriptOnServerFromAnother(ns: NS, server: string, script: string, threads: number = 1, args: any[]) {
|
||||||
|
ns.scp(script, server)
|
||||||
|
performFunctionIfCapable(ns, server, ns.exec, [script, server, threads, ...args])
|
||||||
|
ns.atExit(() => {
|
||||||
|
// Remove the script from the server when the program exits
|
||||||
|
// ns.rm(script, server)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calculates the money per second the player is making
|
||||||
|
* @param ns Global NS object
|
||||||
|
* @param time=5 The number of seconds to calculate the MPS over
|
||||||
|
*/
|
||||||
|
export async function calculateMPS(ns: NS, time: number = 5) {
|
||||||
|
let start = ns.getServerMoneyAvailable("home")
|
||||||
|
let data: number[] = []
|
||||||
|
for (let i = 0; i < time; i++) {
|
||||||
|
await ns.sleep(1000)
|
||||||
|
data.push(ns.getServerMoneyAvailable("home") - start)
|
||||||
|
}
|
||||||
|
return data.reduce((a, b) => a + b, 0) / time
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Type that represents a program and whether it exists on the home server
|
||||||
|
*/
|
||||||
|
export type ProgramState = {
|
||||||
|
program: string
|
||||||
|
exists: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if any of the programs passed in now exist on the home server, and updates the exists property of the program
|
||||||
|
* @param ns Global NS object
|
||||||
|
* @param programs The programs to check
|
||||||
|
* @returns true if any of the programs now exist, otherwise false
|
||||||
|
*/
|
||||||
|
export function checkForNewPrograms(ns: NS, programs: ProgramState[]) {
|
||||||
|
let result = false
|
||||||
|
for (const program of programs) {
|
||||||
|
if (program.exists == false) {
|
||||||
|
program.exists = ns.fileExists(program.program)
|
||||||
|
if (program.exists) {
|
||||||
|
result = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result
|
||||||
|
}
|
42
servers/home/watcher.ts
Normal file
42
servers/home/watcher.ts
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
import { checkForNewPrograms, ProgramState, recursiveHackingRequired } from "./utils"
|
||||||
|
|
||||||
|
export async function main(ns: NS) {
|
||||||
|
let levels = recursiveHackingRequired(ns)
|
||||||
|
let hackingLevel = ns.getHackingLevel()
|
||||||
|
|
||||||
|
let state: ProgramState[] = [
|
||||||
|
{ program: "BruteSSH.exe", exists: false },
|
||||||
|
{ program: "FTPCrack.exe", exists: false },
|
||||||
|
{ program: "relaySMTP.exe", exists: false },
|
||||||
|
{ program: "HTTPWorm.exe", exists: false },
|
||||||
|
{ program: "SQLInject.exe", exists: false },
|
||||||
|
]
|
||||||
|
// Update state with existing programs
|
||||||
|
checkForNewPrograms(ns, state)
|
||||||
|
|
||||||
|
// Remove levels that are already hacked
|
||||||
|
levels = levels.filter(level => level > hackingLevel)
|
||||||
|
|
||||||
|
do {
|
||||||
|
let restart = false
|
||||||
|
if (Math.min(...levels) <= hackingLevel) {
|
||||||
|
ns.tprint(`Hacking level increased to/past ${Math.min(...levels)}, is now ${hackingLevel}`)
|
||||||
|
ns.tprint(`Remaining levels to hack: ${levels}`)
|
||||||
|
// remove the level from the list, so we don't try to hack it again
|
||||||
|
levels = levels.filter(level => level > hackingLevel)
|
||||||
|
restart = true
|
||||||
|
}
|
||||||
|
if (checkForNewPrograms(ns, state)) {
|
||||||
|
ns.tprint(`New programs found: ${state.filter(program => program.exists).map(program => program.program)}`)
|
||||||
|
restart = true
|
||||||
|
}
|
||||||
|
if (restart) {
|
||||||
|
ns.run("killall.js")
|
||||||
|
await ns.sleep(1000) // 1 second
|
||||||
|
ns.run("hackallservers.js")
|
||||||
|
}
|
||||||
|
hackingLevel = ns.getHackingLevel()
|
||||||
|
// Wait 1 second before checking again
|
||||||
|
await ns.sleep(1000)
|
||||||
|
} while (hackingLevel <= Math.max(...levels))
|
||||||
|
}
|
26
tsconfig.json
Normal file
26
tsconfig.json
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "esnext",
|
||||||
|
"useDefineForClassFields": true,
|
||||||
|
"module": "ESNext",
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"lib": [
|
||||||
|
"esnext",
|
||||||
|
"dom",
|
||||||
|
"dom.iterable"
|
||||||
|
],
|
||||||
|
"allowJs": true,
|
||||||
|
"baseUrl": "./",
|
||||||
|
"jsx": "react",
|
||||||
|
"paths": {
|
||||||
|
"@/*": [
|
||||||
|
"src/*"
|
||||||
|
],
|
||||||
|
"NetscriptDefinitions" : ["NetscriptDefinitions.d.ts"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"include": [
|
||||||
|
"servers/**/*", "global.d.ts", "mirror/**/*"
|
||||||
|
]
|
||||||
|
}
|
Submodule typescript-template deleted from 4136ab7107
Reference in New Issue
Block a user