iPSY Posted May 27, 2013 Posted May 27, 2013 Hi ! So i've just made a simple piston secret door design and place a computer has the opening mechanism, for some reason, it keeps giving me "bios:337: [srting "startup"]:11: syntax error. I've checked line 11 and found nothing wrong in it. Can you guys help me out, maybe im missing something. Also, wen it did work the first time, it gave me an Error in line 5 saying couldn't reach nil or something like that. correctpass = "PortalRoom123" while true do term.clear() term.setCursorPos(1,1) write("Welcome ! Please, enter Password Now: ") pass = read("*") if pass == correctpass then write("Access Granted !") redstone.setOutput("back",true) sleep(10) redstone.setOutput("back",false) else write("Access Denied !") sleep(2) end end
Teraku Posted May 28, 2013 Posted May 28, 2013 The way you posted it should work. You probably made an error while typing this into the PC.
ye_Craft Posted May 29, 2013 Posted May 29, 2013 that actually is useless, just hold ctrl + T, then you can stop the loop. type lua, then use redstone.setOutput("back",true), the door will be opened. lol
iPSY Posted May 29, 2013 Author Posted May 29, 2013 Im using this in my lan world with my cousin, and he doesn't understand computercraft, so ya, no problem in that. If i do want to stop the loop, I just need to type this os.pullEvent = os.pullEventRaw at the start of the program, I did my research.
Teraku Posted May 29, 2013 Posted May 29, 2013 that actually is useless, just hold ctrl + T, then you can stop the loop. type lua, then use redstone.setOutput("back",true), the door will be opened. lol That's why you can put this at the top of the code: os.pullEvent = os.pullEventRaw That will only make you able to reboot or restart the computer. Also, I always make a maintenance password in my door locks. If I input it, the loop stops and the PC starts normally, for when I want to edit the password or something. But people can still open your door with a lever or redstone torch. So what you then do is place the door in such a way that when the door is "closed" according to the game, it's actually open. Then make the computer constantly emit a redstone signal so the door closes, and when you input the password, have the redstone signal temporarily turn off, instead of on. Im using this in my lan world with my cousin, and he doesn't understand computercraft, so ya, no problem in that. If i do want to stop the loop, I just need to type this os.pullEvent = os.pullEventRaw at the start of the program, I did my research. That actually does something completely different, as mentioned earlier in this post. If you want to stop the loop, you'll have to actually assign a variable. Such as "loop = true". Example: loop = true while loop == true do input = read() if input == "password" then loop = false else print("incorrect") end end
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now