Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Title: Community goals screen
- Date: 4-29-21
- creator: irnotbeowulf
- Description: When the item router collects an item.
- it is exported to the rs system. Then the contents
- of the rs system are written to the screen. A small
- delay has been added to be more server friendly.
- --]]
- -- Declare Peripherals
- barrel = "metalbarrels:diamond_tile_1"
- rsbridge = "rsBridge_1"
- router = "modularrouters:item_router_0"
- playerDetector = "playerDetector_1"
- chatBox = "chatBox_1"
- -- Wrap Peripherals
- inv = peripheral.wrap(barrel)
- rtr = peripheral.wrap(router)
- chat = peripheral.wrap(chatBox)
- mon = peripheral.find("monitor")
- rsb = peripheral.wrap(rsbridge)
- player = peripheral.wrap(playerDetector)
- item = inv.getItemDetail
- input = rtr.getItemDetail
- local function eject()
- rs.setAnalogOutput("right",5)
- sleep(3)
- rs.setAnalogOutput("right",0)
- return
- end
- local function newLine()
- local _,cY=mon.getCursorPos()
- mon.setCursorPos(1, cY+1)
- end
- local function writeInventory()
- if input(1) then
- rsb.importItemFromChest(input(1), router)
- local itemList = rsb.listItems()
- mon.clear()
- mon.setCursorPos(1,1)
- for i=1, #itemList do
- mon.write(itemList[i].displayName.. " = ".. itemList[i].amount)
- newLine()
- end
- end
- end
- writeInventory()
- while true do
- writeInventory()
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement