Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local status = {"<Enter Card>","<Rejected>","<Granted>"}
- local current = 1
- local combo = "1004"
- local lastTimer
- local etat = 1
- m = peripheral.wrap("left")
- m.clear()
- local function centerText(text)
- x,y = m.getSize()
- x1,y1 = m.getCursorPos()
- m.setCursorPos((math.floor(x/2) - (math.floor(#text/2))), y1)
- m.write(text)
- end
- while true do
- local event,arg1,arg2,arg3 = os.pullEvent()
- if event == "timer" and arg1 == lastTimer then
- current = 1
- lastTimer = nil
- rs.setOutput("top",false)
- if etat == 1 then
- sleep(3)
- --afficher image decompression
- m.setCursorPos(1,4)
- centerText("AIR : 0 %")
- m.setCursorPos(1, 7)
- centerText("OXYGENE : 0 %")
- m.setCursorPos(1, 10)
- centerText("DECOMPRESSION : 0 %")
- m.setCursorPos(1, 15)
- centerText("TOTAL : 0 %")
- sleep(1)
- m.setCursorPos(1, 4)
- centerText("AIR : 25 %")
- m.setCursorPos(1, 7)
- centerText("OXYGENE : 25 %")
- m.setCursorPos(1, 10)
- centerText("DECOMPRESSION : 25 %")
- m.setCursorPos(1, 15)
- centerText("TOTAL : 25 %")
- sleep(1)
- m.setCursorPos(1, 4)
- centerText("AIR : 75 %")
- m.setCursorPos(1, 7)
- centerText("OXYGENE : 75 %")
- m.setCursorPos(1, 10)
- centerText("DECOMPRESSION : 75 %")
- m.setCursorPos(1, 15)
- centerText("TOTAL : 75 %")
- sleep(1)
- m.setCursorPos(1, 4)
- centerText("AIR : 100 %")
- m.setCursorPos(1, 7)
- centerText("OXYGENE : 100 %")
- m.setCursorPos(1, 10)
- centerText("DECOMPRESSION : 100 %")
- m.setCursorPos(1, 15)
- centerText("TOTAL : 100 %")
- rs.setOutput("front",true)
- sleep(5)
- rs.setOutput("front",false)
- m.clear()
- os.reboot()
- end
- if etat == 2 then
- sleep(2)
- sensor=peripheral.wrap("back")
- for _, name in pairs(sensor.getPlayerNames()) do
- local victime = name
- m.setCursorPos(1, 6)
- centerText("Mr " ..name)
- m.setCursorPos(1, 7)
- centerText(" vous n'êtes pas autoriser être ici")
- m.setCursorPos(1, 8)
- centerText("veuillez rester ici jusqu'un agent arrive")
- end
- etat = 3
- end
- if etat == 5 then
- m.setCursorPos(1, 7)
- m.clearLine()
- m.setCursorPos(1, 8)
- m.clearLine()
- m.setCursorPos(1, 5)
- centerText("Personne non autoriser :")
- sleep(3)
- m.clear()
- etat = 4
- lastTimer = os.startTimer(3)
- rs.setOutput("top", true)
- end
- if etat == 4 then
- etat = 6
- sleep(1)
- end
- elseif event == "mag_swipe" then
- if arg1 == combo and etat == 1 then
- lastTimer = os.startTimer(5)
- current = 3
- rs.setOutput("top",true)
- etat = 1
- end
- if arg1 ~= combo then
- lastTimer = os.startTimer(5)
- etat = 2
- rs.setOutput("top", true)
- end
- if arg1 == combo and etat == 3 then
- lastTimer = os.startTimer(3)
- rs.setOutput("top", true)
- etat = 5
- end
- else
- lastTimer = os.startTimer(5)
- current = 2
- etat = 4
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement