Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local monitor = peripheral.wrap("monitor_1")
- local battery = peripheral.wrap("Induction Matrix_1")
- local white = 1
- local orange = 2
- local magenta = 4
- local lightBlue = 8
- local yellow = 16
- local lime = 32
- local pink = 64
- local gray = 128
- local lightGray = 256
- local cyan = 512
- local purple = 1024
- local blue = 2048
- local brown = 4096
- local green = 8192
- local red = 16384
- local black = 32768
- function setTextScale(size)
- monitor.setTextScale(size)
- end
- function setTextColor(color)
- monitor.setTextColor(color)
- end
- function setCursorPos(x, y)
- monitor.setCursorPos(x, y)
- end
- function setBgColor(color)
- monitor.setBackgroundColor(color)
- end
- function write(str)
- monitor.write(str)
- end
- monitor.clear()
- setBgColor(black)
- setTextScale(0.5)
- setTextColor(green)
- setCursorPos(1,1)
- write("Capacity:")
- setCursorPos(1,2)
- write("Input:")
- setCursorPos(1,3)
- write("Output:")
- setCursorPos(1,4)
- write("Energy level")
- setCursorPos(1,5)
- setTextColor(lightBlue)
- for i = 1, 36 do
- write("#")
- end
- for i = 1, 4 do
- setCursorPos(1, i + 5)
- write("#")
- setCursorPos(36, i + 5)
- write("#")
- end
- setCursorPos(1, 10)
- for i = 1, 36 do
- write("#")
- end
- setTextColor(green)
- local cof = 10000000
- local capacity
- local output
- local proc
- --Cycle
- setCursorPos(10,1)
- capacity = battery.getEnergy()
- write(math.floor(capacity / cof * 4) / 1000)
- write(" GRF")
- setCursorPos(10,2)
- input = battery.getInput()
- write(input / 4)
- write(" RF/t")
- setCursorPos(10,3)
- output = battery.getOutput()
- write(output / 4)
- write(" RF/t")
- proc = capacity / battery.getMaxEnergy()
- if proc > 0.7 then
- setTextColor(green)
- setBgColor(green)
- elseif proc > 0.3 then
- setTextColor(orange)
- setBgColor(orange)
- elseif proc <= 0.3 then
- setTextColor(red)
- setBgColor(red)
- end
- for i = 1, 4 do
- for j = 1, 34 * proc do
- setCursorPos(j + 1,i + 5)
- write("i")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement