I am reading a chest full of items, and I want to store the items data for later use.
you can see the snippet of the program and I hope you see what I mean.
How do I store and recall a list of items?
local component = require("component")
local sides = require("sides")
local tp = component.transposer
slot = 1
for i = 1 , slot do
gis = tp.getItemInSlot(sides,east,i) --store item that is being read to recall later
if gis then
gp.label(i) == gis.label
gp.size(i) == gis.size
slot = slot + 1
end
end
for i = 1 , slot do -- recall stored item and print
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Good day
I am reading a chest full of items, and I want to store the items data for later use.
you can see the snippet of the program and I hope you see what I mean.
How do I store and recall a list of items?
local component = require("component")
local sides = require("sides")
local tp = component.transposer
slot = 1
for i = 1 , slot do
gis = tp.getItemInSlot(sides,east,i) --store item that is being read to recall later
if gis then
gp.label(i) == gis.label
gp.size(i) == gis.size
slot = slot + 1
end
end
for i = 1 , slot do -- recall stored item and print
print(gp.label(i)
print(gp.size(i)
end
Link to post
Share on other sites