Flyskyhigh 0 Posted March 7, 2019 Share Posted March 7, 2019 Hello. I’m entirely new to Opencomputers and Lua scripts. I’m not familiar with the language nor can I code. I would like ask how to create a automatic door to open with a passcode. I have all the components just don’t know how to make it all work! Thanks in advance ;) Quote Link to post Share on other sites
lukeh990 0 Posted January 13, 2020 Share Posted January 13, 2020 Make sure to change password and test side it goes 1-6. All you should need is a redstone card local component=require("component") --references all connected components local r=component.redstone --Choose redstone from components list local gpu=component.gpu --Choose gpu from components local term=require("term") --References terminal commands ---- config section local password="1234" local delay=5 --time the door stays open local side=5 --side of the door, test this ----- local wrong=false while true do term.clear() --Clear screen gpu.set(1,1,"Please enter the password") if wrong then gpu.set(1,1,"Password was wrong, try again") wrong=false end term.setCursor(1,2) local input=io.read() --wait for user input if input==password then r.setOutput(side,15) -- check if this is the correct function os.sleep(delay) r.setOutput(side,0) -- same here else wrong=true end end Quote Link to post Share on other sites