1 posts
Posted 10 March 2013 - 12:28 PM
Question:How can i input 2 things on 1 line like the tunnel program does "tunnel 10", it just seems more efficient
8543 posts
Posted 10 March 2013 - 03:18 PM
Split into new topic. A title was provided for you.
9 posts
Posted 10 March 2013 - 03:20 PM
What you're looking for is "args = {…}". for example, if you start your program as "DigDown 15"…
args = {…}
intDigDistance = args[1]
for i,intDigDistance do
turtle.digDown()
turtle.down()
end
That will send the turtle down 15 blocks. or if you instead type "DigDown 30", it'll go down 30.
148 posts
Posted 11 March 2013 - 03:10 AM
It is the same as if you use shell.run(function, arg1, arg2, arg3, …, argn)
All these arguments are stored in the … and you can pack them into a table.
The CC startup screen should use the same function. So the first string you type in is your file and anything followed by this that is separated with a space will be passed over as an argument