Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --robot remote - computer
- print("password:")
- local password=io.read()
- local computer = require("computer")
- local component = require("component")
- local event = require("event")
- local gpu = component.gpu
- gpu.setResolution(80,25)
- local power="";
- local powerold=9e9;
- function fill(x,y,w,h,cb,cf,t) gpu.setBackground(cb);gpu.setForeground(cf);gpu.fill(x,y,w,h,t) end
- function set(x,y,cb,cf,t) gpu.setBackground(cb);gpu.setForeground(cf);gpu.set(x,y,t) end
- function updatedata()
- local o=computer.maxEnergy() /100;local pr=math.ceil(computer.energy() / o);local p=math.floor(computer.energy() / o / 10);local i="";
- if p>=9 then i="█" elseif p>=7 then i="▆" elseif p>=5 then i="▅" elseif p>=3 then i="▃" elseif p>=1 then i="▂" elseif p>=0 then i="▁" end
- if powerold>=o then
- powerold=o
- power = i .. " " .. pr .. "% "
- else
- powerold=o
- power = i .. "⚡ " .. pr .. "% "
- end
- end
- function screen()
- set(68,1,0x000000,0x00bbff,power) -- power
- set(76,1,0x000000,0x00bbff,os.date("%H") .. ":" .. os.date("%M"))
- end
- fill(1,1,80,1,0x000000,0x000000," ")
- fill(1,2,80,4,0x0060ff,0x000000," ")
- set(1,3,0x0060ff,0xffffff,"Robot Remote")
- fill(1,5,80,25,0x7a7a7a,0x000000," ")
- while true do
- --------------------------------------------------
- updatedata()
- screen()
- --------------------------------------------------
- local eventData = { event.pull() }
- --------------------------------------------------
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement