Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- component = require("component")
- term = require("term")
- c = component.gt_machine
- component.gpu.setResolution(12,2)
- while true do
- os.sleep(0.25)
- p = tonumber(c.getWorkProgress())
- pm = tonumber(c.getWorkMaxProgress())
- pc = math.floor(((p / pm) * 100) + 0.5)
- if pc < 10 then
- prog = "[ ]"
- elseif pc >= 10 and pc < 20 then
- prog = "[# ]"
- elseif pc >= 20 and pc < 30 then
- prog = "[## ]"
- elseif pc >= 30 and pc < 40 then
- prog = "[### ]"
- elseif pc >= 40 and pc < 50 then
- prog = "[#### ]"
- elseif pc >= 50 and pc < 60 then
- prog = "[##### ]"
- elseif pc >= 60 and pc < 70 then
- prog = "[###### ]"
- elseif pc >= 70 and pc < 80 then
- prog = "[####### ]"
- elseif pc >= 80 and pc < 90 then
- prog = "[######## ]"
- elseif pc >= 90 and pc < 100 then
- prog = "[######### ]"
- elseif pc == 100 then
- prog = "[##########]"
- end
- term.clear()
- term.setCursor(6,1)
- if pm == 0 then
- term.setCursor(2,1)
- term.write("Waiting...")
- else
- term.write(pc.."%")
- term.setCursor(1,2)
- term.write(prog)
- end
- end
Add Comment
Please, Sign In to add comment