ComputerCraft Forums

ComputerCraft => Ask a Pro => Topic started by: googleuser3212 on Jul 12, 2022, 04:21 PM

Title: Running A Program At Startup
Post by: googleuser3212 on Jul 12, 2022, 04:21 PM
Is there any way for me to setup a computer to run a certain program at startup?
Title: Running A Program At Startup
Post by: Erb3 on Jul 12, 2022, 05:10 PM
Hey,

Yes, there is a easy way! Just name your program startup, or startup.lua.
If you don't want to rename the program, you can make a program called startup and in it put:
shell.run("programname.lua")If I remember correctly you can also put the program in a folder called "startup", but i am not sure if that works, or if it is a feature of mildly better shell.

Do note that if you have a mount(floppy disk) that contains a startup file, the computer will prioritize the one on the disk. This can be disabled with the following command:
set shell.allow_disk_startup falseNote: disk startup is by default disabled on command computers (Creative mode item).
If you want to disable normal startup you can run:
set shell.allow_startup false
Also, next time you have a problem try to Google(or other search engine) it (https://letmegooglethat.com/?q=Computercraft+run+on+startup) before posting. You even have "google" in your name 😁.

Hope that helps! 👋