Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Hi, this is the lock-part of my vault framedoor system.
- -- The problem im having, is that when i run the 2nd program (bundled controle program), i get this error:
- -- "door:3: Too long without yeilding"
- -- I cant figure out what the problem is, I need help! D:
- Program 1: Lock program (This program works fine, just wanted to include it so you could see the entire system)
- term.clear()
- term.setCursorPos(2, 1)
- term.write("-------------------------------------------------")
- term.setCursorPos(2, 1)
- term.write("-------------------------------------------------")
- function Write()
- term.write("|")
- end
- for i=1,17 do
- term.setCursorPos(51, i+1)
- Write()
- end
- for i=1,17
- term.setCursorPos(1, i+1)
- Write()
- end
- term.setCursorPos(15, 7)
- term.write("The vault is locked!")
- term.setCursorPos(21, 9)
- term.write("Password: ")
- term.setCursorPos(21, 10)
- X = read("*")
- pass = "Notrelevant"
- pass2 = "Notrelevant"
- pass3 = "Notrelevant"
- if X == pass then
- term.setCursorPos(19, 11)
- term.write("password #2: ")
- term.setCursorPos(21, 12)
- sleep(1)
- Y = read("*")
- if Y == pass2 then
- term.setCursorPos(19, 13)
- term.write("Password #3: ")
- term.setCursorPos(21, 14)
- sleep(1)
- Z = read("*")
- if Z == pass3 then
- term.setCursorPos(14, 15)
- term.write("Correct, you may enter")
- redstone.setOutput("left", true)
- sleep(3)
- redstone.setOutput("left", false)
- sleep(3)
- os.reboot()
- end
- else
- term.setCursorPos(21, 15)
- term.write("False, try again")
- sleep(3)
- os.reboot()
- end
- else
- term.setCursorPos(21, 13)
- term.write("False, try again")
- sleep(3)
- os.reboot()
- end
- else
- term.setCursorPos(21, 11)
- term.write("False, try again")
- sleep(3)
- os.reboot()
- end
- sleep(3)
- os.reboot
- Now, here is the 2nd program. There is a red alloy wire from the left of computer #1 to the left of computer #2, which is behind a wall. Computer #1 is in the wall.
- I intend Computer #2 to open a frame door, when it recieves a redstone signal from Computer #1.
- I want it to also close the frame door, when its provided with a redstone signal, under computer #2.
- while true do
- i = 0
- if(redstone.getInput("left")) then
- function open()
- rs.setBundledOutput("right", colors.orange)
- sleep(.5)
- c = colors.subtract(colors.orange)
- rs.setBundledOutput("right", c)
- sleep(.5)
- end
- open()
- open()
- pulse = i+2
- limit = 2
- elseif pulse == limit then
- redstonedown = redstone.getInput("bottom")
- if redstonedown == true then
- function close()
- rs.setBundledOutput("right", colors.white)
- sleep(.5)
- Y = colors.subtract(colors.white)
- rs.setBundledOutput("right", Y)
- sleep(.5)
- end
- close()
- close()
- pulse = i-2
- end
- end
- end
- sleep(3)
- os.reboot()
- Upon running this program, I get this error:
- door:3: Too long without yeilding
- Please help me D:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement