Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mouseWidth = 0
- mouseHeight = 0
- local monitor_1 = peripheral.wrap("right")
- local monitor_2 = peripheral.wrap("left")
- monitor_1.clear()
- monitor_2.clear()
- monitor_1.setCursorPos(1,1)
- monitor_2.setCursorPos(1,1)
- w_1, h_1 = monitor_1.getSize()
- w_2, h_2 = monitor_2.getSize()
- print(w_1)
- print(h_1)
- monitor_1.setBackgroundColor((colors.lime))
- monitor_2.setBackgroundColor((colors.lime))
- --width, 18; height, 12
- monitor_1.setCursorPos(3,2)
- monitor_2.setCursorPos(3,2)
- monitor_1.write(" Combination: ")
- monitor_2.write(" Combination: ")
- monitor_1.setCursorPos(2,6)
- monitor_2.setCursorPos(2,6)
- monitor_1.write(" 1 ")
- monitor_2.write(" 1 ")
- monitor_1.setCursorPos(13,6)
- monitor_2.setCursorPos(13,6)
- monitor_1.write(" 2 ")
- monitor_2.write(" 2 ")
- monitor_1.setCursorPos(2,10)
- monitor_2.setCursorPos(2,10)
- monitor_1.write(" 3 ")
- monitor_2.write(" 3 ")
- monitor_1.setCursorPos(13,10)
- monitor_2.setCursorPos(13,10)
- monitor_1.write(" 4 ")
- monitor_2.write(" 4 ")
- monitor_1.setBackgroundColor((colors.black))
- monitor_2.setBackgroundColor((colors.black))
- local counter = 0
- function c3()
- repeat
- event, p1,p2,p3 = os.pullEvent()
- if(event == "monitor_touch") then
- w_1 = p2
- h_1 = p3
- if(w_1 > 12 and w_1 < 18 and h_1 == 10) then
- rs.setOutput("back", true)
- sleep(1)
- rs.setOutput("back", false)
- counter = counter + 1
- main()
- else
- main()
- end
- end
- until (event == "char" and p1 == ("x"))
- end
- function c2()
- repeat
- event,p1,p2,p3 = os.pullEvent()
- if(event == "monitor_touch") then
- w_1 = p2
- h_1 = p3
- if(w_1 > 1 and w_1 < 7 and h_1 == 10) then
- c3()
- else
- main()
- end
- end
- until(event == "char" and p1 == ("x"))
- end
- function c1()
- repeat
- event,p1,p2,p3 = os.pullEvent()
- if(event == "monitor_touch") then
- w_1 = p2
- h_1 = p3
- if(w_1 > 12 and w_1 < 18 and h_1 == 6) then
- c2()
- else
- main()
- end
- end
- until(event == "char" and p1 == ("x"))
- end
- function main()
- repeat
- event,p1,p2,p3 = os.pullEvent()
- if (event == "monitor_touch") then
- w_1 = p2
- h_1 = p3
- if(w_1 > 1 and w_1 < 7 and h_1 == 6) then
- c1()
- else
- main()
- end
- end
- until(event == "char" and p1 == ("x"))
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment