Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local reactor0 = peripheral.wrap("BigReactors-Reactor_0")
- local reactor5 = peripheral.wrap("BigReactors-Reactor_5")
- local reactor1 = peripheral.wrap("BigReactors-Reactor_1")
- local reactor2 = peripheral.wrap("BigReactors-Reactor_2")
- local batcurrent = peripheral.wrap("tile_enderio_blockcapacitorbank_name_1")
- local curpull = reactor0.getEnergyProducedLastTick()+reactor5.getEnergyProducedLastTick()+reactor1.getEnergyProducedLastTick()+reactor2.getEnergyProducedLastTick()
- local mon = peripheral.wrap("monitor_3")
- term.clear()
- term.setCursorPos(1,1)
- --term.write(math.floor(reactor0.getEnergyProducedLastTick()+reactor5.getEnergyProducedLastTick()+reactor1.getEnergyProducedLastTick()+reactor2.getEnergyProducedLastTick()))
- --confusing progress bar shit--------------------------------------------
- monX, monY = mon.getSize()
- function clear()
- mon.setBackgroundColor(colors.black)
- mon.clear()
- mon.setCursorPos(1,1)
- end
- function drawText(x, y, text, color_txt, color_bg)
- mon.setBackgroundColor(color_bg)
- mon.setTextColor(color_txt)
- mon.setCursorPos(x,y)
- mon.write(text)
- end
- function drawLine(x, y, length, size, color_bar)
- for yPos = y, y+size-1 do
- mon.setBackgroundColor(color_bar)
- mon.setCursorPos(x, yPos)
- mon.write(string.rep(" ", length))
- end
- end
- function drawProg(x, y, name, length, size, minVal, maxVal, color_bar, color_bg)
- drawLine(x, y, length, size, color_bg)
- local barSize = math.floor((minVal/maxVal)*length)
- drawLine(x, y, barSize, size, color_bar)
- local text = name.." "..math.floor((minVal/maxVal)*100).."%"
- if barSize > length/2+#text/2 then
- drawText(x+length/2-#text/2, y+size/2, text, colors.black, color_bar)
- elseif barSize > #text then
- drawText((x+barSize)-#text, y+size/2, text, colors.black, color_bar)
- else
- drawText(x+length/2-#text/2, y+size/2, text, colors.black, color_bg)
- end
- end
- --progress bar-----------------------------------------------------------------------------------------------------
- mon.clear()
- mon.setBackgroundColor(colors.black)
- --for i = batcurrent.getEnergyStored("unknown"), batcurrent.getMaxEnergyStored("unknown") do
- drawProg(3,1, "Capacitor", 46, 2, batcurrent.getEnergyStored("unknown"), batcurrent.getMaxEnergyStored("unknown"), colors.green, colors.gray)
- mon.setBackgroundColor(colors.black)
- term.setTextColor(colors.red)
- print((math.floor(curpull)))
- --end
- --for i = curpull, 7580 do
- drawProg(3,4, "Current Output", 46, 2, curpull, 7580, colors.red, colors.gray)
- mon.setBackgroundColor(colors.black)
- term.setTextColor(colors.blue)
- print((math.floor(curpull)))
- mon.setBackgroundColor(colors.black)
- --end
- sleep(3)
- print("end")
- sleep(1)
- os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment