231 posts
Posted 09 February 2016 - 08:30 PM
Hi everyone. On my data center i have a command computer running a password lock program. But the issue is that when you enter the correct or wrong password it will quit the program. And sometimes it just stops working (It shuts down and does not switch on until i restart minecraft or wait for it). What is going on with my data center?
2427 posts
Location
UK
Posted 09 February 2016 - 10:31 PM
231 posts
Posted 10 February 2016 - 04:33 PM
Hi. I followed this tutorial to make the password lock:
http://www.computercraft.info/wiki/Making_a_Password_Protected_DoorAnd what about the computer shutting down and not starting up issue?
1220 posts
Location
Earth orbit
Posted 10 February 2016 - 04:42 PM
FoxData, we need to see *your* code, not the tutorial. If we can't see your code, we can only guess as to why it's not working.
231 posts
Posted 10 February 2016 - 05:43 PM
Edited on 10 February 2016 - 04:54 PM
231 posts
Posted 10 February 2016 - 05:55 PM
Also: Is there anything i can do about the other computer issue?
Edited on 10 February 2016 - 04:59 PM
2427 posts
Location
UK
Posted 10 February 2016 - 06:19 PM
Have you heard of while loops?
while true do
--#stuff to do forever
end
Add a while loop at about line 9.
also, remove the os.reboot at line 28.
1220 posts
Location
Earth orbit
Posted 10 February 2016 - 08:17 PM
Lupus590 is on to something. If you take a look at the tutorial again, you will see that it used a while loop and didn't use os.reboot(). That loops allows the program to run indefinitely without having to restart the computer each time.
As your code is written now your program will exit when the correct password is entered but reboot if an incorrect password is entered. Both of these issues can be resolved with the use of a while loop.