Add Andesite Alloy factory controller
This commit is contained in:
@@ -27,8 +27,10 @@ for _, name in ipairs(names) do
|
||||
writeLine("Methods: " .. table.concat(methods, ", "))
|
||||
|
||||
local hasBlockData = false
|
||||
local hasInventoryList = false
|
||||
for _, method in ipairs(methods) do
|
||||
if method == "getBlockData" then hasBlockData = true end
|
||||
if method == "list" then hasInventoryList = true end
|
||||
end
|
||||
|
||||
if hasBlockData then
|
||||
@@ -36,6 +38,13 @@ for _, name in ipairs(names) do
|
||||
writeLine("getBlockData OK: " .. tostring(ok))
|
||||
writeLine(ok and textutils.serialize(data) or tostring(data))
|
||||
end
|
||||
if hasInventoryList then
|
||||
local okSize, size = pcall(peripheral.call, name, "size")
|
||||
local okList, items = pcall(peripheral.call, name, "list")
|
||||
writeLine("Inventory size: " .. (okSize and tostring(size) or "ERROR"))
|
||||
writeLine("Inventory list OK: " .. tostring(okList))
|
||||
writeLine(okList and textutils.serialize(items) or tostring(items))
|
||||
end
|
||||
writeLine("")
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user