fix rc turtle inventory display

This commit is contained in:
LordMZTE 2022-03-06 00:42:16 +01:00
parent 00df04540a
commit cb28d35b1f
Signed by: LordMZTE
GPG key ID: B64802DC33A64FF6

View file

@ -58,13 +58,15 @@ local actions = {
send_remote "Refueled"
end,
[keys.i] = function()
local detail = ""
for i = 1, 16 do
turtle.select(i)
local item = turtle.getItemDetail()
if item ~= nil then
send_remote(i .. ": " .. item.name .. " " .. item.count)
if item then
detail = detail .. i .. ": " .. item.name .. " " .. item.count .. "\n"
end
end
send_remote(detail)
end,
[keys.e] = function()
for i = 1, 16 do
@ -88,6 +90,7 @@ local function reset_output()
print "F = Refuel"
print "I = Show Inventory"
print "E = Empty Inventory"
print "------"
end
reset_output()