Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- monitor = peripheral.wrap("back")
- term.redirect(monitor)
- p = peripheral.wrap("draconic_rf_storage_3")
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- function Pos(x,y)
- term.setCursorPos(x,y)
- end
- function shorten(str)
- tostring(str)
- str = string.sub(str, 1, 6)
- return str
- end
- function UpdateReadout()
- current = p.getEnergyStored()
- maximum = p.getMaxEnergyStored()
- term.clear()
- Pos(1,1)
- term.write(" Draconic Energy Core:")
- monitor.setTextScale(1.5)
- Pos(1,3)
- term.write(" Stored Energy: "..current)
- Pos(1,5)
- term.write(" Max Energy: "..maximum)
- Pos(1,7)
- amountInt = ((current * 100) / maximum)
- term.write(" Percent: "..shorten(amountInt))
- end
- while true do
- UpdateReadout()
- os.sleep(0.5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement