Fixes #2233, closes #1069. I don't love this (and the examples are a massive hack!), but it's better than nothing.
1.6 KiB
module: [kind=reference] startup see: guide!startup
Computer startup
When a computer turns on, it searches for files to run as part of the startup process. This page details this process.
For information about creating a basic startup file, see [guide!startup].
-
/rom/autorun: Computers first look in the/rom/autorunfolder, and run every file in that folder. This folder is empty by default, but may be extended by datapacks or other mods. See the example datapack for an example. -
If the
shell.allow_disk_startup[setting][settings] istrue, then connected disk drives are searched for astartupfile,startup.luafile, orstartup/directory. The first disk containing these files will be used for startup.- The
startup(orstartup.lua) file will be run. - All programs under
startup/will be run.
The order disks are iterated over is not defined, and so it is recommended to only have one disk containing startup files connected to a computer.
- The
-
If no startup files are found on a disk, and the
shell.allow_startup[setting][settings] istrue, then the root directory is searched for startup files in the same way (startuporstartup.lua, then all files instartup/).
When listing a files from a directory (either startup/ or rom/autorun), the result of [fs.list] is used
directly. This will always return files in lexicographical order. This means that startup/a.lua will always run before
startup/b.lua.