4 posts
Posted 04 January 2014 - 04:26 PM
i have 2 programs named test and rail that both have a number argument (ie. test 5 and rail 5)
is there a way to have both programs run with only one input (ie. build 5) and it would run both with the same variable number
28 posts
Posted 04 January 2014 - 04:39 PM
You want them to run parallel or sequential? With a script?
squential just a script like that:
local tArgs = {...}
shell.run("rail",tonumber(tArgs[1]) )
shell.run("test",tonumber(tArgs[1]) )
should do
Sorry, but i dont think i understood you totally. Could you please elaborate?
Edited on 04 January 2014 - 03:44 PM
4 posts
Posted 04 January 2014 - 04:46 PM
i have a program "test" that runs first then when its done i want it to run the program "rail" but i only want it to require the number input when i start it for the first time. i wil try what you sugested, it looks like what i need them to do.
i tried that and it keeps telling me unexpected symbol on line 2
the code is right now
local args = {..}
shell.run("test",tonumber(args[1]))
shell.run("rail",tonumber(args([1]))
Edited on 04 January 2014 - 03:58 PM
758 posts
Location
Budapest, Hungary
Posted 04 January 2014 - 05:16 PM
When we, the ones who help you, show you
three dots (…), we really mean
three dots. That
three dot structure has an actual meaning in Lua. On line 1, you have only two dots. And line 3 has one too many opening parentheses.
Edited on 04 January 2014 - 04:18 PM