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

Need help generating correct startup script

Started by SigmaChi07, 01 April 2013 - 06:23 PM
SigmaChi07 #1
Posted 01 April 2013 - 08:23 PM
Hello,

I am really new to programming language but have been recently messing around with it. After creating, revising, testing, failing, revising, researching, re-testing, revising, re-testing and finally failing to generate a simple freaking startup script I have turned to the experts.

So, what I am trying to do is just have my turtles turn on automatically when I login/install chunk loader to do the same after server reset.

I researched the os.run API from the wiki and currently have this small script just to run my program but honestly I am not even sure if the last part of the code or any of it actually works for what I need it to do.


> edit Startup
> os.run({}, "rom/programs/Command")

Ctrl > Save
Ctrl > Exit

> reboot
Goodbye

Default turtle text (startup program failed)

There was nothing else on the wiki about if I needed to put an "end" at the bottom or whatnot, but like I said. I just want the darn things to turn on so I don't have to go manually type in the program to 64 mining turtles for my mining barge. :(/>

Any help would be much appreciated.
superaxander #2
Posted 01 April 2013 - 08:55 PM
You first need to clear the screen and you might wanna use shell.run
Lyqyd #3
Posted 01 April 2013 - 08:58 PM
Use "startup", not "Startup".
Sora Firestorm #4
Posted 01 April 2013 - 09:00 PM
And just to be sure, there IS a program called "Command" in /rom/programs/, right? If not, make sure your command points to a valid program.
Engineer #5
Posted 01 April 2013 - 09:36 PM
Note that the programs you save, go to the folder '/'. So combined with the above: shell.run('yourpathtoprogram')

saved in the startup file.
SigmaChi07 #6
Posted 02 April 2013 - 06:50 AM
Use "startup", not "Startup".
Note that the programs you save, go to the folder '/'. So combined with the above: shell.run('yourpathtoprogram')

saved in the startup file.


Thank you all for replying. These were the two replies I found most helpful in my quest! The original code was mostly fine, but I needed to recreate the file as "startup" not "Startup" and secondly I needed to delete the "rom/programs" part of the code because it did not recognize that as a correct directory path.

Thank you all again it was very much appreciated!

Regards,

Sig