3 posts
Posted 31 July 2013 - 12:26 AM
Hey again, this time I am wondering how to add it so I can chose how many times to do something, like for tunneling that you put 'tunnel 5' and it repeats the tunnel code 5 times, I am wondering how I can do that so I don't have to put so much code in and make better mining programs! Thanks!
8543 posts
Posted 31 July 2013 - 12:35 PM
Split into new topic.
7 posts
Posted 31 July 2013 - 03:43 PM
EDIT: welp I feel like an idiot now. I misunderstood OPs question.
8543 posts
Posted 31 July 2013 - 06:38 PM
That is not what he's asking. OP, have you read through the tunnel program to see how it does it?
16 posts
Posted 01 August 2013 - 12:50 PM
The command line arguments are passed to your program as the special ellipses variable
...
You can reference them more easily by assigning them to a table
local args = {...}
Then use the value from the args table in a for loop
local times = args[1]
for i=1,times do
--stuff
end
8543 posts
Posted 01 August 2013 - 03:54 PM
Don't forget to tonumber() the argument, since they come in as strings.
3 posts
Posted 01 August 2013 - 04:44 PM
Thanks :)/> and I looked through it just wasn't too sure what I was looking for since I had no idea where to start! But I got it now.