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

[Lua] shell.run with 2 arguments. Help!

Started by Ray1235, 30 March 2012 - 01:01 PM
Ray1235 #1
Posted 30 March 2012 - 03:01 PM
Hi. I'm doing Nazi Zombies map using ComputerCraft abilities and i need help with startup program that runs monitor with arguments right and packapunch (For those who want to know. This checks if the power is on and opens packapunch machine)
EatenAlive3 #2
Posted 30 March 2012 - 03:40 PM
local args = {...}
local right,packapunch
if #args > 2 or #args < 2 then print("Invalid number of arguments.")
else
right,packapunch = args[1],args[2]
end
Advert #3
Posted 30 March 2012 - 04:20 PM
Hi. I'm doing Nazi Zombies map using ComputerCraft abilities and i need help with startup program that runs monitor with arguments right and packapunch (For those who want to know. This checks if the power is on and opens packapunch machine)
local args = {...}
local right,packapunch
if #args > 2 or #args < 2 then print("Invalid number of arguments.")
else
right,packapunch = args[1],args[2]
end

You might want to read the OP (again).

You can use shell.run:


shell.run("path/to/program", arg1, arg2, ...)