Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ Crafting Display ]]--
- local modemSide="left"
- rednet.open(modemSide)
- local mon=peripheral.wrap("right")
- --[[ Make strings that correspond with your turtles ]]--
- displayStrings = {
- "Wireless Turtle ",
- " Turtle ",
- " Iron ",
- " Computer ",
- " Glass Pane ",
- " Red Stone ",
- " Stone ",
- " Chest ",
- " Wood ",
- " Modem ",
- " Redstone Torch ",
- " Stone "
- }
- --[[ Find the ids of the above turtles and put them
- here in the same order as your list of
- displayStrings ]]--
- displayIds = {
- 97,
- 96,
- 95,
- 93,
- 90,
- 89,
- 91,
- 94,
- 92,
- 88,
- 86,
- 87
- }
- while true do
- for i,v in ipairs(displayIds) do
- rednet.send(v,"Inventory Request")
- senderId,message,distance=rednet.receive(2)
- mon.setCursorPos(1,i)
- mon.write("->")
- mon.setCursorPos(1,i)
- os.sleep(1)
- mon.clearLine()
- if senderId == v then
- mon.write(displayStrings[i]..message)
- else
- mon.write(displayStrings[i].."?")
- end
- end
- os.sleep(5)
- end
- > WLcountInventory
- --[[ Take inventory ]]--
- print "In WL Count Inventory"
- rednet.open("right")
- local a
- local inv
- while true do
- senderId,message,distance=rednet.receive()
- if message == "Inventory Request" then
- a = 1
- inv=0
- while a <= 9 do
- inv = inv + turtle.getItemCount(a)
- a = a + 1
- end
- print("inv is "..inv)
- rednet.send(senderId,tostring(inv))
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement