Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rs.setAnalogOutput("bottom",15)
- monitor = peripheral.find("monitor")
- chest = peripheral.find("chest")
- destinations = {}
- cursorPosNull = {["x"] = 2, ["y"] = 2}
- clickX = 0
- clickY = 0
- row = 0
- rows = {}
- function Clear()
- monitor.clear()
- monitor.setCursorPos(cursorPosNull["y"],cursorPosNull["x"])
- end
- function ListDestinations()
- for slot = 1,chest.getInventorySize() do
- stack = chest.getStackInSlot(slot)
- if not stack then
- chest.pullItem("east",1,1,slot)
- stack = chest.getStackInSlot(slot)
- end
- if stack then
- destinations[slot] = stack.display_name
- end
- end
- rows = {}
- for slot, destination in pairs(destinations) do
- print(slot.." -> "..destination)
- x, y = monitor.getCursorPos()
- monitor.write(slot.." -> "..destination)
- monitor.setCursorPos(x, y+1)
- x, y = monitor.getCursorPos()
- rows[x]=slot
- end
- end
- function GetClick()
- local event
- local side
- local x
- local y
- event, side, x, y = os.pullEvent("monitor_touch")
- return x, y
- end
- Clear()
- ListDestinations()
- --clickX, clickY = GetClick()
- for key, value in pairs(rows) do
- print(key.." - "..value)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement