Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --CertusianOS
- --ATM3 Comp.Craft OS
- --tell PC that the monitor is on top
- mon = peripheral.wrap("top")
- --creats mouse variables
- mouseWidth = 0
- mouseHeight = 0
- --Clears the monitor
- mon.clear()
- --set mouse position
- mon.setCursorPos(1,1)
- --Gets monitor size and sets it to variables
- w, h=mon.getSize()
- --Displays monitor size
- print(w)
- print(h)
- mon.clear()
- --sets monitor colors.
- mon.clear()
- mon.setTextColor(colors.cyan)
- mon.setBackgroundColor(colors.white)
- mon.clear()
- mon.setCursorPos(6,2)
- mon.write("o-----------------o")
- mon.setCursorPos(6,3)
- mon.write("| Certusian Inc |")
- mon.setCursorPos(6,4)
- mon.write("| |")
- mon.setCursorPos(6,5)
- mon.write("| [Login] |")
- mon.setCursorPos(12,5)
- mon.write("x")
- mon.setCursorPos(18,5)
- mon.write("x")
- function checkClickPosition()
- if mouseWidth > 12 and mouseWidth < 18 and mouseHeight == 5 then
- mon.clear()
- mon.setCursorPos(1,1)
- mon.write("It worked")
- end
- end
- repeat
- event,p1,p2,p3 = os.pullEvent()
- if event=="monitor_touch" then
- mouseWidth = p2
- mouseHeight = p3
- end
- until event=="char" and p1==("x")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement