Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cube = peripheral.wrap("left")
- energy = cube.getEnergy()
- term.clear()
- local printcentred =
- function(text)
- local maxw, maxh = term.getSize() --screen dimensions
- local curx, cury = term.getCursorPos() --cursor pos
- term.setCursorPos((maxw-#text)/2,cury) --set it to the point where write will make the text centred
- term.write(text) --write the text
- term.setCursorPos(curx,cury+1) --return the cursor to the same position on the next line
- end
- local maxw, maxh = term.getSize() --screen dimensions
- term.setCursorPos(1,math.floor(maxh/2))--set cursor to the start of the upper middle line
- printcentred("urrent Power Levels:")--print centred on that line
- printcentred(energy .. " RF")--print centred on the next line
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement