Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local screen = peripheral.wrap('monitor_7')
- local storage = peripheral.wrap('top')
- local maxStore = storage.getMaxEnergyStored()
- local storeOld = 0
- local paints = { title = colors.orange,
- percent = colors.yellow,
- background = colors.cyan,
- rft = colors.yellow }
- function setText(txt,x,y,color)
- screen.setCursorPos(x,y)
- screen.clearLine()
- screen.setTextColor(color)
- screen.write(txt)
- end
- function check()
- local store = storage.getEnergyStored()
- local percent = math.floor((store*100)/maxStore)
- local effective = math.floor((store - storeOld)/20)
- storeOld = store
- if effective > 0 then
- effColor, effEquals = colors.lime, '+'
- else
- effColor, effEquals = colors.red, ''
- end
- setText('--'..tostring(percent)..'%--',3,3,paints.percent)
- setText(effEquals..tostring(effective),1,5,effColor)
- screen.setTextColor(paints.rft)
- screen.write('Rf/t')
- end
- screen.setBackgroundColor(paints.background)
- screen.setTextScale(2.5)
- screen.clear()
- setText('DracStore',2,1,paints.title)
- while true do
- pcall(check)
- os.sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement