This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
remiX's profile picture

[LUA] [Question] editing a program to be the startup of a PC

Started by remiX, 04 October 2012 - 02:39 PM
remiX #1
Posted 04 October 2012 - 04:39 PM
How do I edit the startup of certain computer ID's? Because stopping the server resets the computer and the code on the computer has to be typed in again to begin.
sabian8 #2
Posted 04 October 2012 - 04:41 PM
rename the program to startup
remiX #3
Posted 04 October 2012 - 05:08 PM
rename the program to startup

I forgot to mention I have many codes for many different computers so not all of them can be named startup
MysticT #4
Posted 04 October 2012 - 05:25 PM
rename the program to startup

I forgot to mention I have many codes for many different computers so not all of them can be named startup
Yes they can. Just make the file in the computer root, not in the rom.
remiX #5
Posted 04 October 2012 - 06:31 PM
Hmm, I'm not quite understanding how to do this… which folder must i Put the codes in?
MysticT #6
Posted 04 October 2012 - 06:52 PM
In the world/computer/<computer id> directory. In-game, in the root directory (inside of no folder).
Do:
> edit startup
and then write the code.
remiX #7
Posted 04 October 2012 - 08:34 PM
In the world/computer/<computer id> directory. In-game, in the root directory (inside of no folder).
Do:
> edit startup
and then write the code.

Yes i know about that but is there no way else to make a code the startup of a computer without having to do this? My codes have 60+ lines. To type all that is just a mission.
faubiguy #8
Posted 04 October 2012 - 08:38 PM
Save the file for the code as startup in .minecraft/saves/world_name/computer/ID/ where id is the id of the computer.
sjele #9
Posted 04 October 2012 - 08:43 PM
Remember to have no extensions. Normal text docs have the the extensions .txt. If it has one you need to run the program with the extensions (startup.txt).

If you have one, use google to find out how to remove it
remiX #10
Posted 04 October 2012 - 09:23 PM
Save the file for the code as startup in .minecraft/saves/world_name/computer/ID/ where id is the id of the computer.

Hmm, weird. I did try that before you posted it because I saw someone else do it in a video on youtube - but it didnt work for me. Could it be because its multiplayer server maybe?
Fatal_Exception #11
Posted 04 October 2012 - 11:17 PM
Yes, that only works for singleplayer, because programs are stored on the server.in multiplayer.

If you've already written your programs and they're already on the computers, you can just rename the files.

move <oldfile> <newfile>
at the command line.
remiX #12
Posted 05 October 2012 - 12:18 AM
Is it not possible to edit startup on the computer and make it run the file I need it to?
MysticT #13
Posted 05 October 2012 - 12:19 AM
Is it not possible to edit startup on the computer and make it run the file I need it to?
Yes it is. Use:

shell.run("<program name>")

But again, you can just rename the file and it would work.
remiX #14
Posted 05 October 2012 - 01:47 AM
Is it not possible to edit startup on the computer and make it run the file I need it to?
Yes it is. Use:

shell.run("<program name>")

Thank you! Thats what i needed :(/>/>