Posted 05 April 2015 - 09:39 AM
Hello I'm new to programing I've bin playing around a bit with mining turtles and also found program online to mine out a quarry. It works quit well when its installed on the turtle you simply run "quarry <row length> <number of rows> <current y>" where you fill the 3 spaces with # of block for each. now I wanted to set it up so a turtle with this program installed could be told to make a quarry remotely. I know part of the red.net commands and I know if I make a floppy with startup file saying to open wireless modem right and copy quarry to /. that covers the first part so then I was trying to figure out how to get it to start the program. I made a another program called "RUN" with this code
<write("type [run] to start:")
answer =read()
if answer == "run" then
print("Running…")
sleep(5)
shell.run("quarry")
end>
and that works, but I want to take the code from this and instead of putting the x z y when program runs I want to have it the ask for the values once its starts. quarry code arguments part
<local args = { . . . }
if #args ~= 3 then
print("Usage: quarry <row length> <number of rows> <current y>")
error()
end
rowLength = args[1]
rows = args[2]
startingY = args[3]
curRow = 1
y = startingY>
so how do I change this from making me do "quarry x z y" to
>quarry
>please enter x z y: x z y
<write("type [run] to start:")
answer =read()
if answer == "run" then
print("Running…")
sleep(5)
shell.run("quarry")
end>
and that works, but I want to take the code from this and instead of putting the x z y when program runs I want to have it the ask for the values once its starts. quarry code arguments part
<local args = { . . . }
if #args ~= 3 then
print("Usage: quarry <row length> <number of rows> <current y>")
error()
end
rowLength = args[1]
rows = args[2]
startingY = args[3]
curRow = 1
y = startingY>
so how do I change this from making me do "quarry x z y" to
>quarry
>please enter x z y: x z y