mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-20 21:25:47 +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.
|
an augmentation.
|
||||||
* getCharacterInformation now additionally returns exp
|
* getCharacterInformation now additionally returns exp
|
||||||
* pid resets back to 1 when installing or destroying a BitNode.
|
* pid resets back to 1 when installing or destroying a BitNode.
|
||||||
|
* New '.ns' scripts start with a main function.
|
||||||
|
|
||||||
Misc.
|
Misc.
|
||||||
* Fixed an issue where SF3 was listed as infinitly repeatable and SF12 as
|
* 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 filepath = Terminal.getFilepath(filename);
|
||||||
const script = Terminal.getScript(filename);
|
const script = Terminal.getScript(filename);
|
||||||
if (script == null) {
|
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 {
|
} else {
|
||||||
Engine.loadScriptEditorContent(filepath, script.code);
|
Engine.loadScriptEditorContent(filepath, script.code);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user