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

[Question] [Lua] Trying to make a program that runs a program

Started by twiclo, 10 September 2012 - 03:13 AM
twiclo #1
Posted 10 September 2012 - 05:13 AM
So what i want is for my turtle to run the "mine" program i wrote. Here's what i typed:

(sorry idk how to do that cool thing people always put code in)
os.run({}, "mine")

and the error i get its:
"mine:1: attempt to index ? (a nil value)
I'm totally lost please help.


Or if you could think of some easier way to make this loop:

shell.run("go", "down", "100")
shell.run("excavate", "15")
shell.run("go", "up", "100")
os.sleep(300)

I'm thinking that this:

shell.run("go", "down", "100")
shell.run("excavate", "15")
shell.run("go", "up", "100")
os.sleep(300)
os.run({}, "mine")

would run mine over and over again.
Oh btw that sleep for 300 seconds is so it has time to have what's inside pumped out.
hego555 #2
Posted 10 September 2012 - 06:38 AM
I dont think your supposed to do os.run

try


shell.run("<Program>")
twiclo #3
Posted 10 September 2012 - 06:26 PM
Thanks that works.