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?
Computers not working correctly and password lock quitting
Started by FoxData, Feb 09 2016 08:30 PM
computer help
7 replies to this topic
#1
Posted 09 February 2016 - 08:30 PM
#3
Posted 10 February 2016 - 04:33 PM
Lupus590, on 09 February 2016 - 10:31 PM, said:
Hi. I followed this tutorial to make the password lock: http://www.computerc..._Protected_Door
And what about the computer shutting down and not starting up issue?
#4
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.
#5
Posted 10 February 2016 - 05:43 PM
Lupus590, on 09 February 2016 - 10:31 PM, said:
Post your code. http://pastebin.com
This is my code: http://pastebin.com/Hm4PPnZ4
Edited by FoxData, 10 February 2016 - 05:54 PM.
#6
Posted 10 February 2016 - 05:55 PM
Also: Is there anything i can do about the other computer issue?
Edited by FoxData, 10 February 2016 - 05:59 PM.
#7
Posted 10 February 2016 - 06:19 PM
Have you heard of while loops?
Add a while loop at about line 9.
also, remove the os.reboot at line 28.
while true do --#stuff to do forever end
Add a while loop at about line 9.
also, remove the os.reboot at line 28.
#8
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.
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.
2 user(s) are reading this topic
0 members, 2 guests, 0 anonymous users











