Sensor turtles and inventory sensors OpenC...
g1eagle 29 Jun 2013
I hope I'm doing this correctly..
I'm trying to use a sensor turtle but I'm unable to get it to reconise a sensor card, and there seems to be almost no information on how one would go about getting the turtle to do such...
Also can you use a inventory sensor to tell the name of the item in an inventory? I can get it to pull up the name of the inventory but I can not figure out how to get the individual items in said inventory.
I'm trying to use a sensor turtle but I'm unable to get it to reconise a sensor card, and there seems to be almost no information on how one would go about getting the turtle to do such...
Also can you use a inventory sensor to tell the name of the item in an inventory? I can get it to pull up the name of the inventory but I can not figure out how to get the individual items in said inventory.
g1eagle 30 Jun 2013
Yes the sensor card is in slot 16.
But it returns nil when I try and pull information from it.
But it returns nil when I try and pull information from it.
g1eagle 30 Jun 2013
os.loadAPI("ocs/apis/sensor")
mySensor = sensor.wrap("left")
targets = mySensor.getTargets()
for k, v in pairs(targets) do
print(mySensor.getTargetDetails(k))
end
Though I figured out that problem.. I had a capital letter where it didn't belong...
The other issue of how do we get the slot information?
mySensor = sensor.wrap("left")
targets = mySensor.getTargets()
for k, v in pairs(targets) do
print(mySensor.getTargetDetails(k))
end
Though I figured out that problem.. I had a capital letter where it didn't belong...
The other issue of how do we get the slot information?
Lyqyd 30 Jun 2013
You use the Slots table contained in the table that getTargetDetails returns.
Try running ocs/programs/sensorview to see what is available for the targets.
Try running ocs/programs/sensorview to see what is available for the targets.