Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ItemCount = 15
- function getListOfItems()
- rednet.broadcast("items", "storage_check")
- local itemCount = 0
- local items = {}
- while itemCount < ItemCount do
- local id, message = rednet.receive("storage_response")
- print(message)
- itemCount = itemCount + 1
- items[itemCount] = message
- end
- return items
- end
- function hasItem(itemname)
- rednet.broadcast("Item: " .. itemname, "storage_check")
- local id, message = rednet.receive("storage_response")
- return message
- end
- function main()
- local modem = peripheral.find("modem", rednet.open)
- -- local list = getListOfItems()
- -- for i = 1, #list do
- -- print(list[i])
- -- end
- local itemInSystem = hasItem("minecraft:stone")
- if itemInSystem then
- print("Has Stone!")
- else
- print("No Stone!")
- end
- local itemInSystemTwo = hasItem("minecraft:cobblestone")
- if itemInSystemTwo then
- print("Has Cobble!")
- else
- print("No Cobble!")
- end
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement