Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mouseWidth = 0
- mouseHeight = 0
- monitor = peripheral.wrap("top")
- ticket = peripheral.wrap("back")
- monitor.clear()
- monitor.setCursorPos(1, 1)
- w, h=monitor.getSize()
- monitor.setBackgroundColor((colors.blue))
- monitor.setCursorPos(2, 2)
- monitor.setTextColor(colors.white)
- monitor.write(" Sandshire ")
- monitor.setCursorPos(2, 4)
- monitor.setTextColor(colors.white)
- monitor.write(" Spawnbase ")
- monitor.setBackgroundColor(colours.white)
- function checkClickPosition()
- if mouseWidth > 1 and mouseWidth < 8 and mouseHeight == 2 then
- ticket.createTicket(1,1)
- elseif mouseWidth > 1 and mouseWidth < 8 and mouseHeight == 4 then
- ticket.createTicket(2,1)
- 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