From 190c7c02212ca8ef77a730595f484fc6bedf251d Mon Sep 17 00:00:00 2001 From: Lupus590 Date: Thu, 14 Apr 2022 00:53:28 +0100 Subject: [PATCH 01/11] document how to use startup files --- doc/guides/startup_files.md | 53 +++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 doc/guides/startup_files.md diff --git a/doc/guides/startup_files.md b/doc/guides/startup_files.md new file mode 100644 index 000000000..6f5b12f89 --- /dev/null +++ b/doc/guides/startup_files.md @@ -0,0 +1,53 @@ +--- +module: [kind=guide] startup_files +--- + +# Running code when a computer boots + +:::note Use case +You might be aware that CC computers restart when the chunk they are in reloads, one of the uses of startup files provides a way to have the CC computer to run arbitray code after it finished turning on. Currently this is the closest that CC has to persitance built in. +::: + +CC computers will look for a file or folder with a special name when it finishes loading. Also, CC has a fixed order that it looks for these files and uses them. + +## The magic names +All startup *files* have to be at the root of their drive, this drive is commonly the computer's internal storeage, but can also be a disk too. +``` +startup +startup.lua +``` +`startup` may be a file or a folder, the behavour of it changes depending on which it is but we'll cover that in a bit. `startup.lua` has to be a file. + +:::note Case sensitivity +Startup files names are all lowercase. + +CC inherits the case sensitivity of the real world OS that Minecraft server is running on, so if you are used to Microsoft Windows' case insensitivity (e.g. `startup.lua` and `StartUp.Lua` are considered the same when used as file names) and play on a server (which will likely be running Linux which is case sensitive) then you should keep in mind that programs which work on your machine in singleplayer may not work correctly on the server if you are inconsistent with the case that you use for file names. + +To reiterate, startup files names are all lowercase. CC is looking for `startup` and `startup.lua` not `Startup` or any other caplitalisations. +::: + +## Searching drives for startup files +If `shell.allow_disk_startup` is true (which it is by default), then the CC computer will look for disk drives that have atleast one startup file, it only uses the first disk that fulfils this criteria. Disk drives are searched in the order they are found via `peripheral.getNames()`. It then runs the found startup files as described below. + +If `shell.allow_startup` is true (which it is by default) and no disk startup file was used, then the computer will look for startup files in it's internal storeage. Valid files are ran as described below. + +### Running the startup files +If `startup` is a file then this file and *only* this file is ran, even if a `startup.lua` exists on the same device. + +If `startup` is not a file (either it's a folder or it doesn't exist) then `startup.lua` is ran, assuming it exists. After running `startup.lua` (or not if it didn't exist), the CC computer then runs each file in the `startup` folder one after the other in the order that @{fs.list} returns them. + +:::note Example +Lets say that I have a computer with a startup file on its internal storeage, and is connected to six disk drives. Two of these drives have disks that have startup files, one has an disk with no files, one with files but none of them are startup files, one has a music disk (the kind that you can place in a dukebox), the remaining drive has no disk in it. + +Both of the settings that effect startup are set to allow their respective startup modes. + +I turn on my computer, it looks for disk drives. It so happens that the first one it finds is the empty one, since this drive has no disk it goes to the next drive it found. The second drive that it searches for startup files is the dukebox music disk, this one is also skipped as music disks don't have startup files. Third it finds the disk drive containing the disk without files, it goes to the next drive. Forth is the disk with files but without startup files, it tries the next disk. + +We are down to the two disks both with startup files, the computer finds one of them and searches it for startup files, it find the files and runs them in the order above. When/if these startup files exit without shutting down the computer then the CC computer drops into the interactive prompt. The computer *didn't* look at the last disk drive and *didn't* use the startup files on it's internal storeage. +::: + +:::note Mass configurtion +Unless disabled in the server config, CC computers will look for startup files on disks in attached disk drives. This means that a freshly crafted computer can automatically load a program from that disk startup file. + +Apply this to turtles with a nearby chest containing fuel and you can have a turtle factory that automatically programs the turtles after creating them. +::: From 89899f0ee281d727f6bcaf735da59acc0c0cf2e1 Mon Sep 17 00:00:00 2001 From: Lupus590 Date: Thu, 14 Apr 2022 14:34:27 +0100 Subject: [PATCH 02/11] fix typo --- doc/guides/startup_files.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/guides/startup_files.md b/doc/guides/startup_files.md index 6f5b12f89..ef9423961 100644 --- a/doc/guides/startup_files.md +++ b/doc/guides/startup_files.md @@ -29,7 +29,7 @@ To reiterate, startup files names are all lowercase. CC is looking for `startup` ## Searching drives for startup files If `shell.allow_disk_startup` is true (which it is by default), then the CC computer will look for disk drives that have atleast one startup file, it only uses the first disk that fulfils this criteria. Disk drives are searched in the order they are found via `peripheral.getNames()`. It then runs the found startup files as described below. -If `shell.allow_startup` is true (which it is by default) and no disk startup file was used, then the computer will look for startup files in it's internal storeage. Valid files are ran as described below. +If `shell.allow_startup` is true (which it is by default) and no disk startup file was used, then the computer will look for startup files in it's internal storage. Valid files are ran as described below. ### Running the startup files If `startup` is a file then this file and *only* this file is ran, even if a `startup.lua` exists on the same device. From f3935280d69a0ac8ef6ddbe69d35fdb809fe4181 Mon Sep 17 00:00:00 2001 From: Lupus590 Date: Thu, 14 Apr 2022 15:57:31 +0100 Subject: [PATCH 03/11] fix typos --- doc/guides/startup_files.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/guides/startup_files.md b/doc/guides/startup_files.md index ef9423961..7ca2ab720 100644 --- a/doc/guides/startup_files.md +++ b/doc/guides/startup_files.md @@ -5,7 +5,7 @@ module: [kind=guide] startup_files # Running code when a computer boots :::note Use case -You might be aware that CC computers restart when the chunk they are in reloads, one of the uses of startup files provides a way to have the CC computer to run arbitray code after it finished turning on. Currently this is the closest that CC has to persitance built in. +You might be aware that CC computers restart when the chunk they are in reloads, one of the uses of startup files provides a way to have the CC computer to run arbitrary code after it has finished turning on. Currently this is the closest that CC has to persitance built in. ::: CC computers will look for a file or folder with a special name when it finishes loading. Also, CC has a fixed order that it looks for these files and uses them. From cd6fd8e6ca17a1ef5ea10fca93cc618898cfa050 Mon Sep 17 00:00:00 2001 From: Lupus590 Date: Thu, 14 Apr 2022 16:02:19 +0100 Subject: [PATCH 04/11] fix another typo --- doc/guides/startup_files.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/guides/startup_files.md b/doc/guides/startup_files.md index 7ca2ab720..f96cb5bdb 100644 --- a/doc/guides/startup_files.md +++ b/doc/guides/startup_files.md @@ -27,7 +27,7 @@ To reiterate, startup files names are all lowercase. CC is looking for `startup` ::: ## Searching drives for startup files -If `shell.allow_disk_startup` is true (which it is by default), then the CC computer will look for disk drives that have atleast one startup file, it only uses the first disk that fulfils this criteria. Disk drives are searched in the order they are found via `peripheral.getNames()`. It then runs the found startup files as described below. +If `shell.allow_disk_startup` is true (which it is by default), then the CC computer will look for disk drives that have at least one startup file, it only uses the first disk that fulfils this criteria. Disk drives are searched in the order they are found via `peripheral.getNames()`. It then runs the found startup files as described below. If `shell.allow_startup` is true (which it is by default) and no disk startup file was used, then the computer will look for startup files in it's internal storage. Valid files are ran as described below. From ae48f5dda949079cd33b6523d8bcdc072d239814 Mon Sep 17 00:00:00 2001 From: Lupus590 Date: Fri, 29 Apr 2022 01:24:02 +0100 Subject: [PATCH 05/11] Changes suggested by grammerly there's a few more but these are the ones that I think are good changes --- doc/guides/startup_files.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/doc/guides/startup_files.md b/doc/guides/startup_files.md index f96cb5bdb..a747ff5ac 100644 --- a/doc/guides/startup_files.md +++ b/doc/guides/startup_files.md @@ -5,48 +5,48 @@ module: [kind=guide] startup_files # Running code when a computer boots :::note Use case -You might be aware that CC computers restart when the chunk they are in reloads, one of the uses of startup files provides a way to have the CC computer to run arbitrary code after it has finished turning on. Currently this is the closest that CC has to persitance built in. +You might be aware that CC computers restart when the chunk they are in reloads, one of the uses of startup files provides a way to have the CC computer run arbitrary code after it has finished turning on. Currently, this is the closest that CC has to persistence built-in. ::: -CC computers will look for a file or folder with a special name when it finishes loading. Also, CC has a fixed order that it looks for these files and uses them. +CC computers will look for a file or folder with a special name when it finishes loading. Also, CC has a fixed order in which it looks for these files and uses them. ## The magic names -All startup *files* have to be at the root of their drive, this drive is commonly the computer's internal storeage, but can also be a disk too. +All startup *files* have to be at the root of their drive, this drive is commonly the computer's internal storage, but can be a disk too. ``` startup startup.lua ``` -`startup` may be a file or a folder, the behavour of it changes depending on which it is but we'll cover that in a bit. `startup.lua` has to be a file. +`startup` may be a file or a folder, the behaviour of it changes depending on which it is but we'll cover that in a bit. `startup.lua` has to be a file. :::note Case sensitivity -Startup files names are all lowercase. +Startup file names are all lowercase. -CC inherits the case sensitivity of the real world OS that Minecraft server is running on, so if you are used to Microsoft Windows' case insensitivity (e.g. `startup.lua` and `StartUp.Lua` are considered the same when used as file names) and play on a server (which will likely be running Linux which is case sensitive) then you should keep in mind that programs which work on your machine in singleplayer may not work correctly on the server if you are inconsistent with the case that you use for file names. +CC inherits the case sensitivity of the real world OS that the Minecraft server is running on, so if you are used to Microsoft Windows' case insensitivity (e.g. `startup.lua` and `StartUp.Lua` are considered the same when used as file names) and play on a server (which will likely be running Linux which is case sensitive) then you should keep in mind that programs which work on your machine in singleplayer may not work correctly on the server if you are inconsistent with the case that you use for file names. -To reiterate, startup files names are all lowercase. CC is looking for `startup` and `startup.lua` not `Startup` or any other caplitalisations. +To reiterate, startup file names are all lowercase. CC is looking for `startup` and `startup.lua` not `Startup` or any other capitalisations. ::: ## Searching drives for startup files -If `shell.allow_disk_startup` is true (which it is by default), then the CC computer will look for disk drives that have at least one startup file, it only uses the first disk that fulfils this criteria. Disk drives are searched in the order they are found via `peripheral.getNames()`. It then runs the found startup files as described below. +If `shell.allow_disk_startup` is true (which it is by default), then the CC computer will look for disk drives that have at least one startup file, it only uses the first disk that fulfils these criteria. Disk drives are searched in the order they are found via `peripheral.getNames()`. It then runs the found startup files as described below. -If `shell.allow_startup` is true (which it is by default) and no disk startup file was used, then the computer will look for startup files in it's internal storage. Valid files are ran as described below. +If `shell.allow_startup` is true (which it is by default) and no disk startup file was used, then the computer will look for startup files in its internal storage. Valid files are run as described below. ### Running the startup files -If `startup` is a file then this file and *only* this file is ran, even if a `startup.lua` exists on the same device. +If `startup` is a file then this file and *only* this file is run, even if a `startup.lua` exists on the same device. -If `startup` is not a file (either it's a folder or it doesn't exist) then `startup.lua` is ran, assuming it exists. After running `startup.lua` (or not if it didn't exist), the CC computer then runs each file in the `startup` folder one after the other in the order that @{fs.list} returns them. +If `startup` is not a file (either it's a folder or it doesn't exist) then `startup.lua` is run, assuming it exists. After running `startup.lua` (or not if it didn't exist), the CC computer then runs each file in the `startup` folder one after the other in the order that @{fs.list} returns them. :::note Example -Lets say that I have a computer with a startup file on its internal storeage, and is connected to six disk drives. Two of these drives have disks that have startup files, one has an disk with no files, one with files but none of them are startup files, one has a music disk (the kind that you can place in a dukebox), the remaining drive has no disk in it. +Let's say that I have a computer with a startup file on its internal storage, and is connected to six disk drives. Two of these drives have disks that have startup files, one has a disk with no files, one with files but none of them are startup files, one has a music disk (the kind that you can place in a jukebox), the remaining drive has no disk in it. -Both of the settings that effect startup are set to allow their respective startup modes. +Both of the settings that affect startup are set to allow their respective startup modes. -I turn on my computer, it looks for disk drives. It so happens that the first one it finds is the empty one, since this drive has no disk it goes to the next drive it found. The second drive that it searches for startup files is the dukebox music disk, this one is also skipped as music disks don't have startup files. Third it finds the disk drive containing the disk without files, it goes to the next drive. Forth is the disk with files but without startup files, it tries the next disk. +I turn on my computer, it looks for disk drives. It so happens that the first one it finds is the empty one, since this drive has no disk it goes to the next drive it found. The second drive that it searches for startup files is the jukebox music disk, this one is also skipped as music disks don't have startup files. Third, it finds the disk drive containing the disk without files, it goes to the next drive. Forth is the disk with files but without startup files, it tries the next disk. -We are down to the two disks both with startup files, the computer finds one of them and searches it for startup files, it find the files and runs them in the order above. When/if these startup files exit without shutting down the computer then the CC computer drops into the interactive prompt. The computer *didn't* look at the last disk drive and *didn't* use the startup files on it's internal storeage. +We are down to the two disks both with startup files, the computer finds one of them and searches it for startup files, it finds the files and runs them in the order above. When/if these startup files exit without shutting down the computer then the CC computer drops into the interactive prompt. The computer *didn't* look at the last disk drive and *didn't* use the startup files on its internal storage. ::: -:::note Mass configurtion +:::note Mass configuration Unless disabled in the server config, CC computers will look for startup files on disks in attached disk drives. This means that a freshly crafted computer can automatically load a program from that disk startup file. Apply this to turtles with a nearby chest containing fuel and you can have a turtle factory that automatically programs the turtles after creating them. From 3823202b63144b4c7072e632e3c837fdc45de414 Mon Sep 17 00:00:00 2001 From: Lupus590 Date: Thu, 5 May 2022 17:37:41 +0100 Subject: [PATCH 06/11] turns on instead of boots Co-authored-by: Jonathan Coates --- doc/guides/startup_files.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/guides/startup_files.md b/doc/guides/startup_files.md index a747ff5ac..4710fc4ed 100644 --- a/doc/guides/startup_files.md +++ b/doc/guides/startup_files.md @@ -2,7 +2,7 @@ module: [kind=guide] startup_files --- -# Running code when a computer boots +# Running code when a computer turns on :::note Use case You might be aware that CC computers restart when the chunk they are in reloads, one of the uses of startup files provides a way to have the CC computer run arbitrary code after it has finished turning on. Currently, this is the closest that CC has to persistence built-in. From 19e2afc6a6e311e848532751dfd7a8029d94fc38 Mon Sep 17 00:00:00 2001 From: Lupus590 Date: Thu, 9 Jun 2022 07:45:52 +0100 Subject: [PATCH 07/11] Move case sensitivity to fs api page --- doc/guides/startup_files.md | 9 +-------- src/main/java/dan200/computercraft/core/apis/FSAPI.java | 8 ++++++++ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/doc/guides/startup_files.md b/doc/guides/startup_files.md index 4710fc4ed..c30348bcb 100644 --- a/doc/guides/startup_files.md +++ b/doc/guides/startup_files.md @@ -16,15 +16,8 @@ All startup *files* have to be at the root of their drive, this drive is commonl startup startup.lua ``` -`startup` may be a file or a folder, the behaviour of it changes depending on which it is but we'll cover that in a bit. `startup.lua` has to be a file. +`startup` may be a file or a folder, the behaviour of it changes depending on which it is but we'll cover that in a bit. `startup.lua` has to be a file. Note that these are all lower case, case matters sometimes so keep to the correct one - more info in a note on the @{fs} API page. -:::note Case sensitivity -Startup file names are all lowercase. - -CC inherits the case sensitivity of the real world OS that the Minecraft server is running on, so if you are used to Microsoft Windows' case insensitivity (e.g. `startup.lua` and `StartUp.Lua` are considered the same when used as file names) and play on a server (which will likely be running Linux which is case sensitive) then you should keep in mind that programs which work on your machine in singleplayer may not work correctly on the server if you are inconsistent with the case that you use for file names. - -To reiterate, startup file names are all lowercase. CC is looking for `startup` and `startup.lua` not `Startup` or any other capitalisations. -::: ## Searching drives for startup files If `shell.allow_disk_startup` is true (which it is by default), then the CC computer will look for disk drives that have at least one startup file, it only uses the first disk that fulfils these criteria. Disk drives are searched in the order they are found via `peripheral.getNames()`. It then runs the found startup files as described below. diff --git a/src/main/java/dan200/computercraft/core/apis/FSAPI.java b/src/main/java/dan200/computercraft/core/apis/FSAPI.java index 12d84fb75..92b6d2b93 100644 --- a/src/main/java/dan200/computercraft/core/apis/FSAPI.java +++ b/src/main/java/dan200/computercraft/core/apis/FSAPI.java @@ -61,6 +61,14 @@ import java.util.function.Function; * an incredibly large file) will fail. You can see a mount's capacity with {@link #getCapacity} and the remaining * space with {@link #getFreeSpace}. * + * :::note Case sensitivity + * CC inherits the case sensitivity of the real world OS that the Minecraft server is running on, so if you are used to + * Microsoft Windows' case insensitivity (e.g. `startup.lua` and `StartUp.Lua` are considered the same when used as + * file names) and play on a server (which will likely be running Linux which is case sensitive) then you should keep + * in mind that programs which work on your machine in singleplayer may not work correctly on the server if you are + * inconsistent with the case that you use for file names. + * ::: + * * @cc.module fs */ public class FSAPI implements ILuaAPI From f583df3392ee42b0a3ae3f4ebd978c1d7eaac47c Mon Sep 17 00:00:00 2001 From: Lupus590 Date: Thu, 9 Jun 2022 07:46:20 +0100 Subject: [PATCH 08/11] add missing note header off topic change --- src/main/java/dan200/computercraft/core/apis/FSAPI.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/dan200/computercraft/core/apis/FSAPI.java b/src/main/java/dan200/computercraft/core/apis/FSAPI.java index 92b6d2b93..155e136b6 100644 --- a/src/main/java/dan200/computercraft/core/apis/FSAPI.java +++ b/src/main/java/dan200/computercraft/core/apis/FSAPI.java @@ -44,7 +44,7 @@ import java.util.function.Function; * {@link #copy} and {@link #delete}. * * - * :::note + * :::note Absolute vs relative paths * All functions in the API work on absolute paths, and do not take the @{shell.dir|current directory} into account. * You can use @{shell.resolve} to convert a relative path into an absolute one. * ::: From f835bb7f11308e7048a64909c7102c9144b3cb99 Mon Sep 17 00:00:00 2001 From: Lupus590 Date: Thu, 9 Jun 2022 07:46:52 +0100 Subject: [PATCH 09/11] Move persistence stuff --- doc/guides/startup_files.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/doc/guides/startup_files.md b/doc/guides/startup_files.md index c30348bcb..f7f22f8a0 100644 --- a/doc/guides/startup_files.md +++ b/doc/guides/startup_files.md @@ -5,7 +5,7 @@ module: [kind=guide] startup_files # Running code when a computer turns on :::note Use case -You might be aware that CC computers restart when the chunk they are in reloads, one of the uses of startup files provides a way to have the CC computer run arbitrary code after it has finished turning on. Currently, this is the closest that CC has to persistence built-in. +You might be aware that CC computers restart when the chunk they are in reloads, startup files provides a way to have the CC computer run arbitrary code after it has finished turning on. ::: CC computers will look for a file or folder with a special name when it finishes loading. Also, CC has a fixed order in which it looks for these files and uses them. @@ -44,3 +44,15 @@ Unless disabled in the server config, CC computers will look for startup files o Apply this to turtles with a nearby chest containing fuel and you can have a turtle factory that automatically programs the turtles after creating them. ::: + +:::note Computers don't remember what they were doing when the chunk unloads +You may have heard of the term "persistence", Computercraft computers do not have persistence. Startup files are currently the closest that CC has to persistence. + +If you don't know what persistence is, if CC computers were persistent then they would remember what they were doing when the chunk they are in was unloaded, and resume running the task they were doing when the chunk gets reloaded. + +However, Computercraft doesn't have persistence and thus restart as if they were just turned on. Mentioning turning on, they will remember that they were running and when the chunk reloads they will turn themselves on and start looking for startup files. Clever use of startup files and recording data to disk can somewhat circumvent the lack of built in persistence. + +For most programs (usually running on computers), restarting from the beginning of the program is not an issue. However, turtles commonly have startup complications due to their ability to move. Unless you make sure that the turtle is in a fixed starting position every time (which is not always practical), your turtle programs will need some way to cope with the turtle starting in a different position - perhaps with the @{gps} API. + +Incase it's not clear, Minecraft unloads all chunks (including force loaded chunks with chunk loaders) when the server restarts and when the single player world closes. So you may want startup files even if you are chunk loading your computers. +::: From 67706cfb8368614b552196359988f0be470da817 Mon Sep 17 00:00:00 2001 From: Lupus590 Date: Thu, 9 Jun 2022 08:49:53 +0100 Subject: [PATCH 10/11] reword a bit --- doc/guides/startup_files.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/guides/startup_files.md b/doc/guides/startup_files.md index f7f22f8a0..80bddb155 100644 --- a/doc/guides/startup_files.md +++ b/doc/guides/startup_files.md @@ -16,7 +16,11 @@ All startup *files* have to be at the root of their drive, this drive is commonl startup startup.lua ``` -`startup` may be a file or a folder, the behaviour of it changes depending on which it is but we'll cover that in a bit. `startup.lua` has to be a file. Note that these are all lower case, case matters sometimes so keep to the correct one - more info in a note on the @{fs} API page. +`startup` may be a file or a folder, the behavior of it changes depending on which it is. If it's a file then it is ran, if it's a folder then each file inside it is ran. + +`startup.lua` has to be a file. + +Note that these are all lower case, case matters sometimes so keep to the correct one - more info in a note on the @{fs} API page. ## Searching drives for startup files From e43314dd351ea4349ab3bd96c8da8ea9e0e8b139 Mon Sep 17 00:00:00 2001 From: Lupus590 Date: Thu, 9 Jun 2022 08:54:25 +0100 Subject: [PATCH 11/11] move mass config to top --- doc/guides/startup_files.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/guides/startup_files.md b/doc/guides/startup_files.md index 80bddb155..edb022f21 100644 --- a/doc/guides/startup_files.md +++ b/doc/guides/startup_files.md @@ -5,7 +5,13 @@ module: [kind=guide] startup_files # Running code when a computer turns on :::note Use case -You might be aware that CC computers restart when the chunk they are in reloads, startup files provides a way to have the CC computer run arbitrary code after it has finished turning on. +You might be aware that CC computers restart when the chunk they are in reloads, startup files provides a way to have the CC computer run arbitrary code after it has finished turning on. +::: + +:::note Mass configuration +Unless disabled in the server config, CC computers will look for startup files on disks in attached disk drives. This means that a freshly crafted computer can automatically load a program from that disk startup file. + +Apply this to turtles with a nearby chest containing fuel and you can have a turtle factory that automatically programs the turtles after creating them. ::: CC computers will look for a file or folder with a special name when it finishes loading. Also, CC has a fixed order in which it looks for these files and uses them. @@ -43,12 +49,6 @@ I turn on my computer, it looks for disk drives. It so happens that the first on We are down to the two disks both with startup files, the computer finds one of them and searches it for startup files, it finds the files and runs them in the order above. When/if these startup files exit without shutting down the computer then the CC computer drops into the interactive prompt. The computer *didn't* look at the last disk drive and *didn't* use the startup files on its internal storage. ::: -:::note Mass configuration -Unless disabled in the server config, CC computers will look for startup files on disks in attached disk drives. This means that a freshly crafted computer can automatically load a program from that disk startup file. - -Apply this to turtles with a nearby chest containing fuel and you can have a turtle factory that automatically programs the turtles after creating them. -::: - :::note Computers don't remember what they were doing when the chunk unloads You may have heard of the term "persistence", Computercraft computers do not have persistence. Startup files are currently the closest that CC has to persistence.