Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Locating controller...")
- for i,k in pairs(peripheral.getNames()) do
- if peripheral.getType(k) == "refinedstorage:controller" then
- print("Controller: " .. k)
- controller = peripheral.wrap(k)
- end
- end
- print("Locating monitor...")
- for i,k in pairs(peripheral.getNames()) do
- if peripheral.getType(k) == "monitor" then
- print("Monitor: " .. k)
- monitor = peripheral.wrap(k)
- end
- end
- print("Getting monitor size...")
- resolution = {monitor.getSize()}
- print("Width: " .. resolution[1] .. " Height: " .. resolution[2])
- print("Is colour: " .. tostring(monitor.isColour()))
- if not monitor.isColour() then
- error("Colour monitor needed")
- end
- term.redirect(monitor)
- term.clear()
- term.setTextColour(colours.white)
- term.setBackgroundColour(colours.black)
- term.clear()
- while true do
- ttlitems = controller.listAvailableItems()
- ttlcount = 0
- for i,k in pairs(ttlitems) do
- if k['count'] then
- ttlcount = ttlcount + k['count']
- end
- end
- term.setTextColour(colours.white)
- term.setCursorPos(2,2)
- term.write("Energy: ")
- term.setCursorPos(10,2)
- perc = (controller.getRFStored() / controller.getRFCapacity()) * 100
- if perc >= 90 then
- term.setTextColour(colours.green)
- elseif perc <= 89 and perc >= 70 then
- term.setTextColour(colours.lime)
- elseif perc <= 69 and perc >= 50 then
- term.setTextColour(colours.yellow)
- elseif perc <= 49 and perc >= 20 then
- term.setTextColour(colours.orange)
- else
- term.setTextColour(colours.red)
- end
- term.write(controller.getRFStored() .. "RS/" .. controller.getRFCapacity() .. "RS")
- term.setCursorPos(2,3)
- term.setTextColour(colours.white)
- term.write("Total items:")
- term.setCursorPos(15,3)
- term.setTextColour(colours.cyan)
- term.write(tostring(ttlcount))
- term.setCursorPos(2,4)
- term.setTextColour(colours.white)
- term.write("Active crafting tasks: " .. #controller.getCraftingTasks())
- sleep(0)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement