Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function padLeft(str, w)
- return string.rep(" ", w - #str) .. str
- end
- --[[
- * Locate the nearest
- ]]
- local function findPeripheral(_type)
- for _,name in pairs(peripheral.getNames()) do
- if peripheral.getType(name) == _type then
- return peripheral.wrap(name)
- end
- end
- end
- local totalCap = 0
- local totalStore = 0
- local percent = 0
- local mfsu
- os.startTimer(1)
- while true do
- totalCap = peripheral.call("back", getEUCapacity())
- totalStore = peripheral.call("back", getEUStored())
- end
- -- Calculate a percentage
- percent = math.ceil(totalStore / totalCap) * 100
- -- Analogue redstone output
- redstone.setAnalogOutput("right", (math.ceil(totalStore / totalCap) * 15))
- os.pullEvent("timer")
- os.startTimer(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment