Added a banner

This commit is contained in:
Zakary Timson 2022-04-26 11:24:17 -04:00
parent 3df5f1857c
commit d9d9997e04
2 changed files with 68 additions and 0 deletions

View File

@ -71,6 +71,25 @@ run this periodically as your hack level increases & you unlock more exploits:
## Scripts
### [banner.js](./scripts/banner.js)
**RAM:** 1.60 GB
Aesthetic & serves no real purpose. Prints a banner to the terminal & can repeat after game restarts.
```
[home ~/]> run scripts/banner.js --help
Running script with 1 thread(s), pid 1 and args: ["--help"].
/scripts/banner.js:
Display an ASCII banner.
Usage: run banner.js [OPTIONS]
run banner.js --help
Options:
-r, --reboot Automatically display after game reboots
-h, --help Display this help message
```
### [botnet-manager.js (WIP)](./scripts/botnet-manager.js)
**RAM:** 7.15 GB

49
scripts/banner.js Normal file
View File

@ -0,0 +1,49 @@
import {ArgParser} from "/scripts/lib/arg-parser";
/**
* Display an ASCII banner, optionally automatically after reboots.
*
* @param {NS} ns - BitBurner API
*/
export async function main(ns) {
// Setup
ns.disableLog('ALL');
const argParser = new ArgParser('banner.js', 'Display an ASCII banner.', [
{name: 'reboot', desc: 'Automatically display after game reboots', flags: ['-r', '--reboot'], default: false}
]);
const args = argParser.parse(ns.args);
// Help
if(args['help'] || args['_error'].length)
return ns.tprint(argParser.help(args['help'] ? null : args['_error'][0], args['_command']));
ns.tprint(`
&&&&&&&& O &&&&&&&&
&&& & && CDDDD &&&&&&&&&&
&&&& &&& && &&& &&&&&&&&&&&&&
&&&&& && && & .&&&. &&&&&&&&&&&&&&
&&&&&&&&&& && && &&&&& &&&&&&&&&&&&&&&
&&&&&&&& && & &&&&& &&&&&&&&&&&&&&&&
&&&&&&&&&& &&& &&&&& &&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&& *&&&* *&&&&&&&&&&&&&&&
&&&&&&&&&&&&& &&&&&&&&& *&&&&&&* .&&
&&&&&&&&&&& &&& & & &&& &&* .&&&
&&&&&&&&&& & & ,,,,,* .&&&&
&&&&& & & &&&&&&&&&&&&&&&&
&& &&&& & & & &&&&&&&&&&&&&&
&& &&&&&&& & & & &&&&&* &&&&&
&& &&&&&&&& & & &&&&&&&* &&&*
&& &&&&&&&&&&& & & &&&& &*
&& &&&&&&&&& & & && &&
&&& &&&&&& & & && &&
&&& &&&& & & && &&
&&&& &&& & & && &&
&&&&&&& \\&/ && &&
&&&&&& V &* &*
`);
// Prevent from exiting so the banner will automatically display on startup.
if(args['reboot']) while(true) { await ns.sleep(1000 * 60); }
}