Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- modem = peripheral.wrap("top")
- monitor1 = peripheral.wrap("right")
- monitor2 = peripheral.wrap("back")
- monitor1.setBackgroundColor(colors.black)
- monitor2.setBackgroundColor(colors.black)
- monitor1.clear()
- monitor2.clear()
- modem.open(100)
- rs.setOutput("left", true)
- while true do
- i = 3
- j = 1
- monitor = monitor1
- event, modemside, senderChannel, replyChannel, message, senderDistance = os.pullEvent("modem_message")
- aspects = textutils.unserialize(message)
- local sort_func = function( a,b ) return a.name < b.name end
- table.sort( aspects, sort_func )
- monitor.setBackgroundColor(colors.black)
- monitor.clear()
- for k, v in pairs(aspects) do
- monitor.setCursorPos(j,i)
- monitor.setBackgroundColor(colors.black)
- monitor.write(v["name"])
- monitor.setBackgroundColor(2)
- for a = 1, (tonumber(v["quantity"])/3) do
- monitor.setCursorPos(j+12+a,i)
- monitor.write(" ")
- end
- monitor.setCursorPos(j+14,i)
- monitor.write(v["quantity"])
- i = i + 2
- if i > 32 and j ~= 37 then
- i = 3
- j = 37
- elseif i > 32 and j == 37 then
- i = 3
- j = 1
- monitor = monitor2
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement