Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local args = { ... } --row and col
- --Set variables
- local length = 10
- local height = 3
- local row = args[1] or 1
- local col = args[2] or 1
- --Set monitor properties
- mon = peripheral.wrap("monitor_1")
- mon.setTextScale(0.5)
- --Calculate position and offset
- local posX = (row-1) * length + 1
- local posY = (col-1) * height + 1
- local offsetX = posX + length - 1
- --Outline of button
- mon.setBackgroundColor(colors.white)
- mon.setCursorPos(posX,posY)
- mon.write(string.rep(" ", length))
- mon.setCursorPos(posX,posY+1)
- mon.write(" ")
- mon.setCursorPos(offsetX,posY+1)
- mon.write(" ")
- mon.setCursorPos(posX,posY+2)
- mon.write(string.rep(" ", length))
Add Comment
Please, Sign In to add comment