Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.setTextColour(colors.lime)
- term.setTextColour(colors.lightBlue)
- term.setTextColour(colors.red)
- term.setTextColour(colors.yellow)
- mon = "monitor_2"
- term.setTextColour(colors.red)
- term.setTextColour(colors.yellow)
- cube = "RFStorageBattery_1"
- term.setTextColour(colors.red)
- term.setTextColour(colors.yellow)
- title = "Energy Vortex"
- term.setTextColour(colors.red)
- term.setTextColour(colors.blue)
- term.setTextColour(colors.red)
- --Center Text Function
- function centerText(text,yVal)
- length = string.len(text)
- minus = math.floor(54-length)
- x = math.floor(minus/2)
- mon.setCursorPos(x+1,yVal)
- mon.write(text)
- end
- --Wraps the Peripherals
- cube = peripheral.wrap(cube)
- mon = peripheral.wrap(mon)
- --Sets the BackGround to White (Messy! I know!)
- function clearScreen()
- mon.clear()
- mon.setBackgroundColour(colors.white)
- mon.setCursorPos(1,1)
- mon.write(string.rep(" ",54))
- mon.setCursorPos(1,2)
- mon.write(string.rep(" ",54))
- mon.setCursorPos(1,3)
- mon.write(string.rep(" ",54))
- mon.setCursorPos(1,4)
- mon.write(string.rep(" ",54))
- mon.setCursorPos(1,5)
- mon.write(string.rep(" ",54))
- mon.setCursorPos(1,6)
- mon.write(string.rep(" ",54))
- mon.setCursorPos(1,7)
- mon.write(string.rep(" ",54))
- mon.setCursorPos(1,8)
- mon.write(string.rep(" ",54))
- mon.setCursorPos(1,9)
- mon.write(string.rep(" ",54))
- mon.setCursorPos(1,10)
- mon.write(string.rep(" ",54))
- end
- clearScreen()
- --Centers and Displays Title On Monitor
- mon.setBackgroundColour(colors.lightGray)
- mon.setTextColour(colors.red)
- mon.setTextScale(0.85)
- mon.setCursorPos(1,1)
- centerText(string.rep(" ",string.len(title)+2),1)
- centerText(title,1)
- while true do
- --Variables for Calculations
- maxE = 1200000000000
- curE = cube.getEnergyStored("top")
- rawPer = curE/maxE
- rawPer = rawPer/1000000
- percent = math.floor((rawPer*100)+0.5)
- bar = math.floor((rawPer*52)+0.5)
- mon.setBackgroundColour(colors.white)
- mon.setTextColour(colors.blue)
- centerText("Current Energy: "..curE.." MrR",3)
- mon.setTextColour(colors.green)
- centerText(percent.."% Full",6)
- --Loading Bar Code Re-Written Much MUCH simpler than before
- mon.setCursorPos(2,8)
- mon.setBackgroundColour(colors.gray)
- mon.write(string.rep(" ",52))
- mon.setCursorPos(2,8)
- mon.setBackgroundColour(colors.lime)
- mon.write(string.rep(" ",bar))
- mon.setCursorPos(2,9)
- mon.setBackgroundColour(colors.gray)
- mon.write(string.rep(" ",52))
- mon.setCursorPos(2,9)
- mon.setBackgroundColour(colors.lime)
- mon.write(string.rep(" ",bar))
- end
Advertisement
Add Comment
Please, Sign In to add comment