Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.pullEvent = os.pullEventRaw
- codeT = "1234"
- debug = "0000"
- attente = tonumber("3")
- cote = "back"
- -- front(devant), back(derriere), top(dessus), bottom(dessous), left(gauche), right(droite)
- inversion = "oui"
- sortie = "0"
- if inversion == "oui" then
- redstone.setOutput(cote, true)
- end
- while sortie == "0" do
- term.clear()
- term.setCursorPos(17,2)
- print("Inserez votre code")
- term.setCursorPos(18,4)
- print("*---**---**---*")
- term.setCursorPos(18,5)
- print("| 1 || 2 || 3 |")
- term.setCursorPos(18,6)
- print("*---**---**---*")
- term.setCursorPos(18,7)
- print("*---**---**---*")
- term.setCursorPos(18,8)
- print("| 4 || 5 || 6 |")
- term.setCursorPos(18,9)
- print("*---**---**---*")
- term.setCursorPos(18,10)
- print("*---**---**---*")
- term.setCursorPos(18,11)
- print("| 7 || 8 || 9 |")
- term.setCursorPos(18,12)
- print("*---**---**---*")
- term.setCursorPos(18,13)
- print("*---**---**---*")
- term.setCursorPos(18,14)
- print("|EFF|| 0 ||VAL|")
- term.setCursorPos(18,15)
- print("*---**---**---*")
- code = ""
- ok = tonumber("4")
- while ok ~= 5 do
- term.setCursorPos(22,17)
- if ok == 4 then
- print("_ _ _ _")
- elseif ok == 3 then
- print("* _ _ _")
- elseif ok == 2 then
- print("* * _ _")
- elseif ok == 1 then
- print("* * * _")
- elseif ok == 0 then
- print("* * * *")
- end
- event, button, x, y = os.pullEvent("mouse_click")
- if x == nil or y == nil or button == nil then
- elseif x >= 18 and x <= 22 and y >= 4 and y <= 6 and button == 1 then
- code = code.."1"
- ok = ok - 1
- elseif x >= 23 and x <= 27 and y >= 4 and y <= 6 and button == 1 then
- code = code.."2"
- ok = ok - 1
- elseif x >= 28 and x <= 32 and y >= 4 and y <= 6 and button == 1 then
- code = code.."3"
- ok = ok - 1
- elseif x >= 18 and x <= 22 and y >= 7 and y <= 9 and button == 1 then
- code = code.."4"
- ok = ok - 1
- elseif x >= 23 and x <= 27 and y >= 7 and y <= 9 and button == 1 then
- code = code.."5"
- ok = ok - 1
- elseif x >= 28 and x <= 32 and y >= 7 and y <= 9 and button == 1 then
- code = code.."6"
- ok = ok - 1
- elseif x >= 18 and x <= 22 and y >= 10 and y <= 12 and button == 1 then
- code = code.."7"
- ok = ok - 1
- elseif x >= 23 and x <= 27 and y >= 10 and y <= 12 and button == 1 then
- code = code.."8"
- ok = ok - 1
- elseif x >= 28 and x <= 32 and y >= 10 and y <= 12 and button == 1 then
- code = code.."9"
- ok = ok - 1
- elseif x >= 18 and x <= 22 and y >= 13 and y <= 15 and button == 1 then
- code = ""
- ok = tonumber("4")
- elseif x >= 23 and x <= 27 and y >= 13 and y <= 15 and button == 1 then
- code = code.."0"
- ok = ok - 1
- elseif x >= 28 and x <= 32 and y >= 13 and y <= 15 and button == 1 then
- if ok == 0 then
- ok = tonumber("5")
- end
- end
- if ok < 0 then
- ok = tonumber("0")
- end
- end
- term.setCursorPos(1,2)
- if code == codeT then
- print(" ACCEPTE ")
- if inversion == "non" then
- redstone.setOutput(cote, true)
- sleep(attente)
- redstone.setOutput(cote, false)
- elseif inversion == "oui" then
- redstone.setOutput(cote, false)
- sleep(attente)
- redstone.setOutput(cote, true)
- end
- elseif code == debug then
- sortie = "1"
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.yellow)
- print("CodeOS 1.0")
- term.setTextColor(colors.white)
- else
- print(" REFUSE ")
- sleep(attente)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement