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

[question] Am I right in thinking...

Started by sancarn, 16 August 2012 - 04:53 PM
sancarn #1
Posted 16 August 2012 - 06:53 PM
Am I right in thinking that you cannot edit the help program in game because it is part of the ROM?

if so, is there anything I can do such that help works with my program? If I write a program called help which accepts program names as arguments could I redirect programs to the help program written in the ROM if the word is unknown?
BigSHinyToys #2
Posted 16 August 2012 - 07:15 PM
There is this api but I haven't used it so i cant explain usage.
Spoiler
sancarn #3
Posted 16 August 2012 - 07:56 PM
There is this api but I haven't used it so i cant explain usage.

I see. I shall wiki it… Hmm… The path of help is rom/help/ so maybe fs.copy("<program name>","rom/help/<programname>") would work?

Edit: Nope - Error: lua:43: Access Denied - shame…
Cranium #4
Posted 16 August 2012 - 08:30 PM
Anything within ROM is write protected, so anything you do would have to be done by adding the files manually in you gamesave folders.
Ponder #5
Posted 16 August 2012 - 10:13 PM
You can change the path, from which the API draws its information apparently via help.setPath (<path>). No Idea how those files have look like, though.
BigSHinyToys #6
Posted 16 August 2012 - 10:33 PM
here is an example of a help file they are just text in a file the file is located in rom/help
Spoiler

Functions in the Operating System API:
os.version()
os.getComputerID()
os.getComputerLabel()
os.setComputerLabel()
os.run( environment, programpath, arguments )
os.loadAPI( path )
os.unloadAPI( name )
os.pullEvent( filter* )
os.queueEvent( event, arguments )
os.clock()
os.startTimer( timeout )
os.sleep( timeout )
os.time()
os.setAlarm( time )
os.shutdown()
os.reboot()
*optional
Type "help events" to learn about the event system.

Noodle #7
Posted 16 August 2012 - 11:47 PM
Just make a new help? "Edit help"
Luanub #8
Posted 17 August 2012 - 01:39 AM
lol, make a new help and if you want to edit the api do

os.unloadAPI("help")
os.loadAPI("help")
Its in the ROM(Read Only) Unloading the API will not allow you to edit it. You need to do it from outside the game.