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

Run once, not again?

Started by jtdavis99, 29 February 2012 - 09:16 PM
jtdavis99 #1
Posted 29 February 2012 - 10:16 PM
I want to create a sort of OS, where I have a setup system that you run manually, and then edits the startup. So far, I have the code for registering, and I need to have it in the same code so I can call upon the variables easily. Is it possible to do something like
if run(1) then
edit("startup", XXXX)
Liraal #2
Posted 29 February 2012 - 10:19 PM
if you want to quickly replace the startup do like this:

function startupReplace(filepath)
if fs.exists("startup") then fs.delete("startup") end
fs.copy(filepath, "startup")
return true
end