Advertisement
xKevinn

Progress Percent

Sep 27th, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.42 KB | None | 0 0
  1. component = require("component")
  2. term = require("term")
  3. c = component.gt_machine
  4.  
  5. component.gpu.setResolution(4,1)
  6.  
  7. while true do
  8.   os.sleep(0.25)
  9.   p = tonumber(c.getWorkProgress())
  10.   pm = tonumber(c.getWorkMaxProgress())
  11.   pc = math.floor(((p / pm) * 100) + 0.5)
  12.  
  13.   term.clear()
  14.   term.setCursor(1,1)
  15.   if pm == 0 then
  16.     term.setCursor(1,1)
  17.     term.write("Done")
  18.   else
  19.     term.write(pc.."%")
  20.   end
  21. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement