Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- m = peripheral.wrap("monitor_41")
- cIn = ""
- code = "0000"
- side = "back"
- function setup()
- redstone.setOutput(side, true)
- m.setBackgroundColor(32768)
- m.clear()
- m.setCursorPos(1,1)
- m.write("1")
- m.setCursorPos(3, 1)
- m.write("2")
- m.setCursorPos(5, 1)
- m.write("3")
- m.setCursorPos(1, 3)
- m.write("4")
- m.setCursorPos(3, 3)
- m.write("5")
- m.setCursorPos(5, 3)
- m.write("6")
- m.setCursorPos(1, 5)
- m.write("7")
- m.setCursorPos(3, 5)
- m.write("8")
- m.setCursorPos(5, 5)
- m.write("9")
- m.setCursorPos(7, 1)
- m.setBackgroundColor(32)
- m.write("O")
- m.setBackgroundColor(16384)
- m.setCursorPos(7, 5)
- m.write("X")
- m.setBackgroundColor(32768)
- m.setCursorPos(7, 3)
- m.write("0")
- end
- setup()
- function checkCode()
- if(cIn == code) then
- redstone.setOutput(side, false)
- sleep(3)
- redstone.setOutput(side, true)
- cIn = ""
- else
- cIn = ""
- end
- end
- while true do
- _, p1, p2, p3 = os.pullEvent("monitor_touch")
- if(p1 == "monitor_41") then
- if(p2 == 1 and p3 == 1) then
- cIn = cIn.."1"
- elseif(p2 == 3 and p3 == 1) then
- cIn = cIn.."2"
- elseif(p2 == 5 and p3 == 1) then
- cIn = cIn.."3"
- elseif(p2 == 1 and p3 == 3) then
- cIn = cIn.."4"
- elseif(p2 == 3 and p3 == 3) then
- cIn = cIn.."5"
- elseif(p2 == 5 and p3 == 3) then
- cIn = cIn.."6"
- elseif(p2 == 1 and p3 == 5) then
- cIn = cIn.."7"
- elseif(p2 == 3 and p3 == 5) then
- cIn = cIn.."8"
- elseif(p2 == 5 and p3 == 5) then
- cIn = cIn.."9"
- elseif(p2 == 7 and p3 == 3) then
- cIn = cIn.."0"
- elseif(p2 == 7 and p3 == 1) then
- checkCode()
- elseif(p2 == 7 and p3 == 5) then
- cIn = ""
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement