Posted 23 January 2013 - 06:21 AM
I want to create a program that will in part check each side of the computer and discover what peripherals are attached.
Then for it to output each peripheral as a variable name with the side it's attached to as the value.
I've read up on dynamic variable names but I'm not really sure what I'm reading… :/
Is there either a simple way to to do what I want or an API that I can add that adds this easily… I just want to enumerate my peripherals easily and quickly and not need to bother with it again. :/
Then for it to output each peripheral as a variable name with the side it's attached to as the value.
I've read up on dynamic variable names but I'm not really sure what I'm reading… :/
sSides = {(redstone.getSides())}
perifs = {}
for k, v in pairs(sSides) do
perifs[v] = (peripheral.getType()) -- <<-- This is line 15 btw <<
end
I get an error @ line 15 expected string.Is there either a simple way to to do what I want or an API that I can add that adds this easily… I just want to enumerate my peripherals easily and quickly and not need to bother with it again. :/