Posted 03 April 2014 - 02:05 AM
So I'm trying to design all my programs around the concept of being pulled from pastebin whenever they are run. So for example, my "Excavate" program that I wrote on the in-game computer would really just simply pull my real excavate program from pastebin, and then run it.
Here is my actual code so far:
On-Computer Excavate Program:
The Actual On-Pastebin Excavate File (which for now is just printing to the console):
As you perhaps can already tell, the main thing I am trying to do here is be capable of passing an arbitrary number of arguments from the command line into my on-computer excavate program, and then have the on-computer program pass all of those arguments into the downloaded pastebin program.
The problem is that apparently shell.run can only take an explicitly defined number of string arguments, and cannot, for example, pass a table like I'm trying to do above.
Does anyone know of a way to pass an arbitrary or unlimited amount of arguments through shell.run()?
Here is my actual code so far:
On-Computer Excavate Program:
--Get Command-Line Arguments
local tArgs = {...}
--Delete Old File
if(fs.exists("toRun")) then
fs.delete("toRun")
end
--Get New One
shell.run("pastebin","get","VT2WRccM","toRun")
--Run New File, passing tArgs from earlier
shell.run("toRun", tArgs)
The Actual On-Pastebin Excavate File (which for now is just printing to the console):
--Get Command-Line Arguments
local tArgs = {...}
--print each argument
for i=1, #tArgs do
print(tArgs[i])
end
As you perhaps can already tell, the main thing I am trying to do here is be capable of passing an arbitrary number of arguments from the command line into my on-computer excavate program, and then have the on-computer program pass all of those arguments into the downloaded pastebin program.
The problem is that apparently shell.run can only take an explicitly defined number of string arguments, and cannot, for example, pass a table like I'm trying to do above.
Does anyone know of a way to pass an arbitrary or unlimited amount of arguments through shell.run()?