mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-20 13:15:48 +01:00
New .ns scripts start with a main function.
This commit is contained in:
parent
a8bb345c88
commit
b35e25e5dc
@ -241,6 +241,7 @@ export let CONSTANTS: IMap<any> = {
|
||||
an augmentation.
|
||||
* getCharacterInformation now additionally returns exp
|
||||
* pid resets back to 1 when installing or destroying a BitNode.
|
||||
* New '.ns' scripts start with a main function.
|
||||
|
||||
Misc.
|
||||
* Fixed an issue where SF3 was listed as infinitly repeatable and SF12 as
|
||||
|
@ -1760,7 +1760,14 @@ let Terminal = {
|
||||
const filepath = Terminal.getFilepath(filename);
|
||||
const script = Terminal.getScript(filename);
|
||||
if (script == null) {
|
||||
Engine.loadScriptEditorContent(filepath);
|
||||
let code = ""
|
||||
if(filename.endsWith(".ns")) {
|
||||
code = `export async function main(ns) {
|
||||
|
||||
}`;
|
||||
}
|
||||
console.log('default code');
|
||||
Engine.loadScriptEditorContent(filepath, code);
|
||||
} else {
|
||||
Engine.loadScriptEditorContent(filepath, script.code);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user