From 415ae8ee5972018024675af56af8b3938b779678 Mon Sep 17 00:00:00 2001 From: ilkecan Date: Sun, 26 Jun 2022 20:25:47 +0000 Subject: [PATCH 1/2] Remove the hardcoded tutorial script extension Parameterized it according to the chosen NS version. --- .../InteractiveTutorial/InteractiveTutorialRoot.tsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/ui/InteractiveTutorial/InteractiveTutorialRoot.tsx b/src/ui/InteractiveTutorial/InteractiveTutorialRoot.tsx index 93e1af52c..92074ea38 100644 --- a/src/ui/InteractiveTutorial/InteractiveTutorialRoot.tsx +++ b/src/ui/InteractiveTutorial/InteractiveTutorialRoot.tsx @@ -58,11 +58,12 @@ export function InteractiveTutorialRoot(): React.ReactElement { const [language, setLanguage] = useState(Language.None); const classes = useStyles(); - const tutorialScriptName = { - [Language.None]: "n00dles.script", - [Language.NS1]: "n00dles.script", - [Language.NS2]: "n00dles.js", + const tutorialScriptExtension = { + [Language.None]: ".script", + [Language.NS1]: ".script", + [Language.NS2]: ".js", }[language]; + const tutorialScriptName = `n00dles${tutorialScriptExtension}`; const contents: { [number: string]: IContent | undefined } = { [iTutorialSteps.Start as number]: { @@ -377,7 +378,9 @@ export function InteractiveTutorialRoot(): React.ReactElement { {"[home ~/]> nano"} - Scripts must end with the .script extension. Let's make a script now by entering + + Scripts must end with the {tutorialScriptExtension} extension. Let's make a script now by entering{" "} + {`[home ~/]> nano ${tutorialScriptName}`} From 44118c8a728dd92d937f96383d4592b306ce2560 Mon Sep 17 00:00:00 2001 From: ilkecan Date: Tue, 28 Jun 2022 23:48:07 +0000 Subject: [PATCH 2/2] Remove the hardcoded script name --- src/ui/InteractiveTutorial/InteractiveTutorialRoot.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/InteractiveTutorial/InteractiveTutorialRoot.tsx b/src/ui/InteractiveTutorial/InteractiveTutorialRoot.tsx index 92074ea38..6135ea103 100644 --- a/src/ui/InteractiveTutorial/InteractiveTutorialRoot.tsx +++ b/src/ui/InteractiveTutorial/InteractiveTutorialRoot.tsx @@ -460,7 +460,7 @@ export function InteractiveTutorialRoot(): React.ReactElement { <> Your script is now running! It will continuously run in the background and will automatically stop if the - code ever completes (the n00dles.script will never complete because it runs an infinite loop).
+ code ever completes (the {tutorialScriptName} will never complete because it runs an infinite loop).

These scripts can passively earn you income and hacking experience. Your scripts will also earn money and experience while you are offline, although at a slightly slower rate.