Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.pullEvent = os.pullEventRaw
- local side = "bottom"
- local password = "1527"
- local password2 = "152780"
- local opentime = 18.48
- while true do
- term.clear()
- term.setCursorPos(1,1)
- print("-----------------------------------")
- print("TEC_NO's Password/Passcode Script")
- print("-----------------------------------")
- print("Welcome User, ")
- write("Password: ")
- local input = read("*")
- if input == password then
- term.clear()
- term.setCursorPos(1,1)
- print("Password correct!")
- rs.setOutput(side,true)
- local speaker = peripheral.find("speaker")
- speaker.playSound("minecraft:entity.player.levelup")
- sleep(0.5)
- speaker.playSound("minecraft:block.end_portal.spawn")
- sleep(0.5)
- speaker.playSound("minecraft:block.end_gateway.spawn")
- sleep(0.5)
- speaker.playSound("minecraft:ui.toast.challenge_complete")
- sleep(opentime)
- rs.setOutput(side,false)
- elseif input == password2 then
- term.clear()
- term.setCursorPos(1,1)
- print("Password correct!")
- rs.setOutput(side,true)
- local speaker = peripheral.find("speaker")
- local notes = {
- ["F#1"]=0, ["F#2"]=12,
- ["Gb1"]=0, ["Gb2"]=12,
- ["G1"]=1, ["G2"]=13,
- ["G#1"]=2, ["G#2"]=14,
- ["Ab1"]=2, ["Ab2"]=14,
- ["A1"]=3, ["A2"]=15,
- ["A#1"]=4, ["A#2"]=16,
- ["Bb1"]=4, ["Bb2"]=16,
- ["B1"]=5, ["B2"]=17,
- ["C1"]=6, ["C2"]=18,
- ["C#1"]=7, ["C#2"]=19,
- ["Db1"]=7, ["Db2"]=19,
- ["D1"]=8, ["D2"]=20,
- ["D#1"]=9, ["D#2"]=21,
- ["Eb1"]=9, ["Eb2"]=21,
- ["E1"]=10, ["E2"]=22,
- ["F1"]=11, ["F2"]=23,
- ["F#3"]=24,
- ["Gb3"]=24,
- }
- local function playNote(instrument,note,volume)
- volume = volume or 1
- speaker.playNote(instrument,volume,notes[note])
- end
- local function harp(note,volume)
- playNote("harp",note,volume)
- end
- --test
- local function a1()
- harp "E1"
- harp "G2"
- harp "B2"
- end
- local function a2()
- harp "G2"
- harp "C2"
- harp "E2"
- end
- local function a3()
- harp "G2"
- harp "B2"
- harp "D2"
- end
- local function a4()
- harp "D1"
- harp "F#2"
- harp "A2"
- end
- --[[
- --local bpm = 136
- --local bps = bpm / 60
- --local spb = 1 / bps
- --local quarter = spb / 4
- --]]
- local function a(f,...)
- local t={...}
- for _,s in ipairs(t) do
- if s > 0 then
- f()
- sleep(0.15 * s)
- else
- sleep(-0.15 * s)
- end
- end
- end
- local function song()
- a(a1, 2,2,1,2,2)
- a(a2, 1,2,2)
- a(a3, 1,2,2)
- a(a4, 1)
- a(a1, 2,2,1,2,2)
- a(a2, 1)
- a(a1, 2,2,1,2,2)
- a(a2, 1)
- a(a1, 2,2,1,2,2)
- a(a2, 1,2,2)
- a(a3, 1,2,2)
- a(a4, 1)
- a(a1, 2,2,1,2,2)
- a(a2, 1)
- a(a1, 2,2,1,2,2)
- a(a2, 1)
- local t1 = 1/3
- local t2 = 2/3
- parallel.waitForAll(
- function() a(a1, 2,2,1,2,2) end,
- function() a(function()harp "B2" end, -t1,t1,t2,t2) end
- )
- a(a2, 1,2,2)
- a(a3, 1,2,2)
- a(a4, 1)
- parallel.waitForAll(
- function() a(a1, 2,2,1,2,2) end,
- function() a(function()harp "B2" end, -t1,t1,t2,t2) end
- )
- a(a2, 1)
- a(a1, 2,2,1,2,2)
- a(a2, 1)
- for i=1,4 do
- parallel.waitForAll(
- function() a(a1, 2,2,1) end,
- function() a(function()harp "B2" end, -t1,t1,t2,t2) end
- )
- end
- for i=1,3 do
- parallel.waitForAll(
- function() a(a1, 2,2,1) end,
- function() a(function()harp "B2" end, -t1,t1,t2,t1,t1) end
- )
- end
- parallel.waitForAll(
- function() a(a1, 2,2,1) end,
- function() a(function()harp "B2" end, -t1,t1,t2) end
- )
- for j=1,3 do
- a(a1, .5,.5,.5,.5,1)
- a(a1, .5,.5,.5,.5,.5,.5,1)
- a(a2, .5,.5,.5,.5,.5,.5,1)
- a(a3, .5,.5,.5,.5,.5,.5,1)
- a(a4, .5,.5)
- for i=1,3 do
- a(a1, .5,.5,.5,.5,1)
- a(a1, .5,.5,.5,.5,.5,.5,1)
- a(a2, .5,.5)
- end
- a(a2, .5,.5,.5,.5,1)
- a(a3, .5,.5,.5,.5,.5,.5,1)
- a(a4, .5,.5)
- end
- end
- parallel.waitForAll(
- song
- )
- term.redirect(term.native())
- sleep(0.84)
- rs.setOutput(side,false)
- else
- print("Password incorrect!")
- sleep(2) -- Waits 2 seconds
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment