Computer Craft Error!

Tornado3019

New Member
Jul 29, 2019
158
0
1
I'm playing around with OpenPeripheral trying to make it scan items in my chest, I thought I'd start with one. I keep getting the "attempt to index ? (a nill value)" at line 7 Error, here's my code.

chest = peripheral.wrap("container_chest_0")
chestInfo = chest.getStackInSlot(1)
for i,j in pairs(chestInfo) do
print(i .. " is " .. j)
end
print("")
print(chestInfo[1].name)

Anybody know a fix? Been to lots of computercraft help pages, couldn't find it.[DOUBLEPOST=1379929703][/DOUBLEPOST]I just realised what I did wrong. Just need to change print(chestInfo[1].name) to print(chestInfo.name)