Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- closeBounds = {
- ["xMin"] = 1,
- ["xMax"] = 5,
- ["yMin"] = 1,
- ["yMax"] = 1
- }
- function checkPos(x,y,bounds)
- if x >= bounds.xMin and x <= bounds.xMax and y >= bounds.yMin and y <= bounds.yMax then
- return true
- else
- return false
- end
- end
- function display()
- term.clear()
- term.setCursorPos(1,1)
- print("close")
- term.setCursorPos(1,3)
- print("1")
- term.setCursorPos(3,3)
- print("2")
- end
- function clickMenu()
- display()
- while true do
- local event, button, x, y = os.pullEvent( "mouse_click" )
- if checkPos(x,y,closeBounds) then
- return
- elseif x == 1 and y == 3 then
- picked = 1
- term.setCursorPos(1,5)
- print("picked " .. picked)
- elseif x == 3 and y == 3 then
- picked = 2
- term.setCursorPos(1,5)
- print("picked " .. picked)
- end
- end
- end
- clickMenu()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement