shiroxxblank

progressBar

Jul 2nd, 2022 (edited)
20
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. mon = peripheral.find("monitor")
  2. oldTerm = term.redirect(mon)
  3. w = 10
  4.  
  5. function drawLine(x,y,length,color) --Defines the function
  6. oldBgColor = term.getBackgroundColor() --Gets the current background color
  7. for i = x, (length + x) do --Starts a for loop starting at x and ending when x gets to x + length
  8. term.setCursorPos(i,y) --Set the cursor position to i,y
  9. term.setBackgroundColor(color) --Set the background color to the color
  10. term.write(" ") --Write that color to the screen
  11. end
  12. term.setBackgroundColor(oldBgColor) --Reset the background color
  13. end
  14.  
  15. local width, height = mon.getSize()
  16.  
  17. drawLine(width / 2 - w / 2, height / 2, w, colors.gray)
  18. paintutils.drawBox(width / 2 - w / 2, height / 2, (width / 2 - w / 2) + w, (height / 2) + 1, colors.white)
  19.  
  20.  
Add Comment
Please, Sign In to add comment