Posted 04 July 2012 - 09:02 AM
This is a really simple but un-secure method of locking a Door Enjoy
Code
Those who know what there doing
Put that into your start up
Guide
Just in case your a little unsure
This is an incredibly un-secure method however a great starting point for all those new
to computer craft i will at the end suggest a couple of methods in which you can secure the OS a little better.
Step 1
Placing the console is really simple in my example i placed it like so
Key
D - door
C - Computer
A - Irrelevant
[D][C]
[D][A]
Step 2
To begin we need to prompt the user for a action ie to enter the password so type "edit startup"
now enter this section of code make sure to copy it exactly as it can be case sensitive.
awesome now lets quickly test that either type reboot or hold Ctrl + R
Step 3
We know need a Password for the door in this example it is IamHuman however you can change it to what ever you
want.
now lets create a program type "edit Iamhuman" remember what ever you type there will be your password now we
need to put the code in remember to change the IamHuman to what ever your password is.
also please change left to which ever side your door is on ie right,left,back
now click Ctrl + S then Ctrl + E
awesome now lets quickly test that either type reboot or hold Ctrl + R
Well done you just created a door lock with a nice user interface and the system instructs the user the whole time
this may seem simple now and it is but this is the fundamental's
Stage 4
Improvement no matter how simple the code or how complex there is always a way to improve your system
and although i am not saying that everyone has to bring there code to near perfection there is a basic algorithm
you should follow.
1)What is the problem
2)What is the solution
3)what is the solution in its simplest form
4)make solution in its simplest form
5)does solution solve problem
The most important lesson you will take from this guide today is that the most fancy dancy solution isn't always the best
and sometimes the best solution is the simplest.
However there are a few security features that are quite easy to implement to make this console more secure however do not
get under the false imprecision that it will be un-hackable because that is near in impossible to accomplish.
1) Delete all the security risk programs such as edit and programs (remember once u have deleted edit the only way to get it back is
to copy it from a floppy.
2) If you have access to the Rom in the mods files place your program in the secret folder (this will hide it from programs)
or
just delete programs much easier
3) Make a better Lock this one is a mere starting point
Please feel free to ask me any questions in the comment section regarding anything in this guide enjoy :P/>/>
Code
Those who know what there doing
Put that into your start up
print ("Please Enter The Door Code")
Create Program called IamHuman
print ("Thankyou the door will open in 3 seconds")
sleep(1)
print ("3")
sleep(1)
print ("2")
sleep(1)
print ("1")
sleep(1)
print ("door opening")
sleep(1)
redstone.setOutput("left", true)
sleep(7)
redstone.setOutput("left", false)
sleep(1)
os.shutdown()
Guide
Just in case your a little unsure
This is an incredibly un-secure method however a great starting point for all those new
to computer craft i will at the end suggest a couple of methods in which you can secure the OS a little better.
Step 1
Placing the console is really simple in my example i placed it like so
Key
D - door
C - Computer
A - Irrelevant
[D][C]
[D][A]
Step 2
To begin we need to prompt the user for a action ie to enter the password so type "edit startup"
now enter this section of code make sure to copy it exactly as it can be case sensitive.
print ("Please Enter The Door Code")
now click Ctrl + S then Ctrl + Eawesome now lets quickly test that either type reboot or hold Ctrl + R
Step 3
We know need a Password for the door in this example it is IamHuman however you can change it to what ever you
want.
now lets create a program type "edit Iamhuman" remember what ever you type there will be your password now we
need to put the code in remember to change the IamHuman to what ever your password is.
also please change left to which ever side your door is on ie right,left,back
print ("Thankyou the door will open in 3 seconds")
sleep(1)
print ("3")
sleep(1)
print ("2")
sleep(1)
print ("1")
sleep(1)
print ("door opening")
sleep(1)
redstone.setOutput("left", true)
sleep(7)
redstone.setOutput("left", false)
sleep(1)
os.shutdown()
now click Ctrl + S then Ctrl + E
awesome now lets quickly test that either type reboot or hold Ctrl + R
Well done you just created a door lock with a nice user interface and the system instructs the user the whole time
this may seem simple now and it is but this is the fundamental's
Stage 4
Improvement no matter how simple the code or how complex there is always a way to improve your system
and although i am not saying that everyone has to bring there code to near perfection there is a basic algorithm
you should follow.
1)What is the problem
2)What is the solution
3)what is the solution in its simplest form
4)make solution in its simplest form
5)does solution solve problem
The most important lesson you will take from this guide today is that the most fancy dancy solution isn't always the best
and sometimes the best solution is the simplest.
However there are a few security features that are quite easy to implement to make this console more secure however do not
get under the false imprecision that it will be un-hackable because that is near in impossible to accomplish.
1) Delete all the security risk programs such as edit and programs (remember once u have deleted edit the only way to get it back is
to copy it from a floppy.
2) If you have access to the Rom in the mods files place your program in the secret folder (this will hide it from programs)
or
just delete programs much easier
3) Make a better Lock this one is a mere starting point
Please feel free to ask me any questions in the comment section regarding anything in this guide enjoy :P/>/>