Posted 19 October 2013 - 04:56 PM
I have a question about the pairs() command,
I would like to be able to run something like this.
Obviously this isnt a working piece of code as I would need to set the tables, open rednet, ect ect. But my problem is that I can seem to get the pairs() function to use a variable such as pairs(X). Is there a way to set a variable and then use the use the pairs command to take that variable and run the correct table?
I would like to be able to run something like this.
print("What program would you like me to run?")
X = read()
print("Who shall I tell to run ", X)
Y = read()
for x,y in pairs(Y) do
rednet.send(y, X)
Obviously this isnt a working piece of code as I would need to set the tables, open rednet, ect ect. But my problem is that I can seem to get the pairs() function to use a variable such as pairs(X). Is there a way to set a variable and then use the use the pairs command to take that variable and run the correct table?