Posted 21 July 2013 - 05:11 PM
I'm trying to learn how to use the sensor from OpenCCSensors.
According to this(http://www.computerc...e=OpenCCSensors) website getTargets() is supposed to return a string, but it doesn't.
Here's the code:
When i run the program it says "Test:6: bad argument: Table expected, got number"
Why does getTargets() return a number?
According to this(http://www.computerc...e=OpenCCSensors) website getTargets() is supposed to return a string, but it doesn't.
Here's the code:
os.loadAPI("ocs/apis/sensor")
local sensor = peripheral.wrap("right")
local targets = sensor.getTargets()
for key, value in pairs(targets) do
print(key.." "..value)
end
When i run the program it says "Test:6: bad argument: Table expected, got number"
Why does getTargets() return a number?