Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mouseWidth = 0
- mouseHeight = 0
- monitor = peripheral.wrap("top")
- monitor.clear()
- monitor.setCursorPos(1,1)
- w,h=monitor.getSize()
- print(w)
- print(h)
- monitor.setCursorPos(4,3)
- monitor.write(" ON ")
- monitor.setBackgroundColor((colors.lime))
- monitor.setCursorPos(15,3)
- monitor.write(" ON ")
- monitor.setBackgroundColor((colors.lime))
- monitor.setCursorPos(24,3)
- monitor.write(" ON ")
- monitor.setBackgroundColor((colors.lime))
- monitor.setCursorPos(33,3)
- monitor.write(" ON ")
- monitor.setBackgroundColor((colors.lime))
- monitor.setCursorPos(4,9)
- monitor.write(" ON ")
- monitor.setBackgroundColor((colors.lime))
- monitor.setCursorPos(15,9)
- monitor.write(" ON ")
- monitor.setBackgroundColor((colors.lime))
- monitor.setCursorPos(24,9)
- monitor.write(" ON ")
- monitor.setBackgroundColor((colors.lime))
- monitor.setCursorPos(33,9)
- monitor.write(" ON ")
- monitor.setBackgroundColor((colors.lime))
- monitor.setCursorPos(4,15)
- monitor.write(" ON ")
- monitor.setBackgroundColor((colors.lime))
- monitor.setCursorPos(15,15)
- monitor.write(" ON ")
- monitor.setBackgroundColor((colors.lime))
- monitor.setCursorPos(24,15)
- monitor.write(" ON ")
- monitor.setBackgroundColor((colors.lime))
- monitor.setCursorPos(33,15)
- monitor.write(" ON ")
- monitor.setBackgroundColor((colors.lime))
- monitor.setCursorPos(4,21)
- monitor.write(" ON ")
- monitor.setBackgroundColor((colors.lime))
- monitor.setCursorPos(15,21)
- monitor.write(" ON ")
- monitor.setBackgroundColor((colors.lime))
- monitor.setCursorPos(24,21)
- monitor.write(" ON ")
- monitor.setBackgroundColor((colors.lime))
- monitor.setCursorPos(33,21)
- monitor.write(" ON ")
- monitor.setBackgroundColor((colors.lime))
- function checkClickPosition()
- if mouseWidth > 4 and mouseWidth < 10 and mouseHeight == 3 then
- elseif mouseWidth > 14 and mouseWidth < 20 and mouseHeight == 3 then
- elseif mouseWidth > 23 and mouseWidth < 29 and mouseHeight == 3 then
- elseif mouseWidth > 32 and mouseWidth < 38 and mouseHeight == 3 then
- elseif mouseWidth > 4 and mouseWidth < 10 and mouseHeight == 9 then
- elseif mouseWidth > 14 and mouseWidth < 20 and mouseHeight == 9 then
- elseif mouseWidth > 23 and mouseWidth < 29 and mouseHeight == 9 then
- elseif mouseWidth > 32 and mouseWidth < 38 and mouseHeight == 9 then
- elseif mouseWidth > 4 and mouseWidth < 10 and mouseHeight == 15 then
- elseif mouseWidth > 14 and mouseWidth < 20 and mouseHeight == 15 then
- elseif mouseWidth > 23 and mouseWidth < 29 and mouseHeight == 15 then
- elseif mouseWidth > 32 and mouseWidth < 38 and mouseHeight == 15 then
- elseif mouseWidth > 4 and mouseWidth < 10 and mouseHeight == 21 then
- elseif mouseWidth > 14 and mouseWidth < 20 and mouseHeight == 21 then
- elseif mouseWidth > 23 and mouseWidth < 29 and mouseHeight == 21 then
- elseif mouseWidth > 32 and mouseWidth < 38 and mouseHeight == 21 then
- end
- end
- repeat
- event,p1,p2,p3 = os.pullEvent()
- if event=="monitor_touch" then
- mouseWidth = p2
- mouseHeight = p3
- checkClickPosition()
- end
- until event=="char" and p1==("x")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement