Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Made by Bobton Co's. engineers Bob and Sylvyrfysh
- --v0.1.1
- function monBox()
- local monitor = peripheral.wrap("top")
- print("Please click on adjacent corners of the box.")
- local e, m, x, y = os.pullEvent("monitor_touch")
- x1 = x
- y1 = y
- local e,m,x,y = os.pullEvent("monitor_touch")
- term.redirect(monitor)
- paintutils.drawLine(x1,y1,x,y1,1)
- paintutils.drawLine(x1,y1,x1,y,1)
- paintutils.drawLine(x1,y,x,y,1)
- paintutils.drawLine(x,y1,x,y,1)
- term.restore()
- end
- function monClear()
- local monitor = peripheral.wrap("top")
- term.redirect(monitor)
- term.setBackgroundColor(colors.black)
- term.clear()
- term.restore()
- end
- function comTextBox()
- local monitor = peripheral.wrap("top")
- print("Please click on adjacent corners of the box.")
- local event, button, x, y = os.pullEvent("mouse_click")
- x1 = x
- y1 = y
- local event, button, x, y = os.pullEvent("mouse_click")
- l1 = x - x1
- l = l1 - 4
- m = 1
- while m == 1 do
- write("Enter your Text: "..l.." characters max: ")
- r = io.read()
- if string.len(r) > l then
- print("Too long.")
- else
- paintutils.drawLine(x1,y1,x1,y,1)
- paintutils.drawLine(x1,y1,x,y1,1)
- paintutils.drawLine(x1,y,x,y,1)
- paintutils.drawLine(x,y1,x,y,1)
- term.setCursorPos(x1 + 2, y1 + 2)
- print(r)
- m = 0
- return
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment