Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local X, Y = term.getSize()
- function clear()
- term.clear()
- term.setCursorPos(1, 1)
- end
- function cPrint(str, ypos)
- term.setCursorPos(x/2-#str/2, ypos)
- term.write(str)
- end
- function drawButton(x, y, text, color)
- local curX, curY = term.getCursorPos()
- paintutils.drawLine(x, y, x + #text + 1, y, color)
- term.setCursorPos(x + 1, y)
- print(text)
- term.setCursorPos(curX, curY)
- end
- function getMouseClick(sec, x1, y1, x2, y2)
- if sec == nil then
- while true do
- local event, but, x, y = os.pullEvent("mouse_click")
- if event == "mouse_click" then
- return x, y, but
- end
- break
- end
- elseif sec == true then
- local _, but, x, y = os.pullEvent("mouse_click")
- if x >= x1 and x <= x2 and y >= y1 and y <= y2 then
- return true
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement