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

How do I edit default programs?

Started by Chaseskywalker, 28 November 2016 - 03:17 AM
Chaseskywalker #1
Posted 28 November 2016 - 04:17 AM
I want to see the coding behind the default computer programs, like worm and adventure and stuff, but I can't look at it by using just the normal edit command. Is there any way that I can do it in-game without going into the game file?
Bomb Bloke #2
Posted 28 November 2016 - 04:47 AM
"edit" can certainly open them, so long as you enter the correct commands.
Eg, if you wanted to edit the "worm" script you might do:

edit /rom/programs/fun/worm

… or:

cd rom
cd programs
cd fun
edit worm

You can't save changes into the rom directory, though. If you want to actually make changes you might make a copy to the root of your computer's drive and work on that instead:

cp /rom/programs/fun/worm worm
edit worm

You can see the rom directory structure here (and also view the source files through your browser, if you wish).
Edited on 28 November 2016 - 03:49 AM
Anavrins #3
Posted 28 November 2016 - 04:48 AM
I'm not sure what you're talking about, you should be able to read them thru the edit program.
Try: edit /rom/programs/fun/worm

Ninja'd
Edited on 28 November 2016 - 03:49 AM
Chaseskywalker #4
Posted 28 November 2016 - 05:36 AM
Oh, ok. Thank you for your quick reply :)/> I was not aware that they weren't just under the rom directory. That makes sense now.
I just wanted to see the code so I could maybe learn a bit more about Lua, so I just wanted to read it. Thanks a lot :)/>