Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mon = peripheral.find("monitor")
- oldTerm = term.redirect(mon)
- w = 10
- function drawLine(x,y,length,color) --Defines the function
- oldBgColor = term.getBackgroundColor() --Gets the current background color
- for i = x, (length + x) do --Starts a for loop starting at x and ending when x gets to x + length
- term.setCursorPos(i,y) --Set the cursor position to i,y
- term.setBackgroundColor(color) --Set the background color to the color
- term.write(" ") --Write that color to the screen
- end
- term.setBackgroundColor(oldBgColor) --Reset the background color
- end
- local width, height = mon.getSize()
- drawLine(width / 2 - w / 2, height / 2, w, colors.gray)
- paintutils.drawBox(width / 2 - w / 2, height / 2, (width / 2 - w / 2) + w, (height / 2) + 1, colors.white)
Add Comment
Please, Sign In to add comment