This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
XoX's profile picture

XoXDoor ( as secure as it gets )

Started by XoX, 28 October 2012 - 11:15 AM
XoX #1
Posted 28 October 2012 - 12:15 PM
So, I know everyone has done 1000 door scripts in their time using computercraft, but many are very easy to bypass, and just really as simple as it gets.
So I thought I would release my door-script.
It's as secure as it gets and as user-friendly as it gets.
I know that it is not perfect and that you can still get around it but there is a few things you can do to make it better, though, this protects against the simpler methods that usually work against other scripts.

Alright, here it is:
Pastebinned, code tags on here didn't like my tabbing.

http://pastebin.com/88Zb1Q1S

There is no need to edit anything in the script! Simply run it and you will go through the setup.
For it to work properly security wise use this startup script:



while true do
  if shell.run("door") then
   return
  end
end

If you find a bug please report it.
The script should detect and prevent invalid input when setting it up, if you find a way to mess up the config process, please share it sp I can fix it.
I you have a question why I did something the way I did or have a better a way of doing it, post!
billysback #2
Posted 28 October 2012 - 12:25 PM
two things:
1: Please either put your code in to a spoiler or use pastebin (pastebin would be prefferable)
2: Please tab out your code, it makes it easier for you and others to read and is a habit you should really get in to.

(also you are checking for input == nil, if nothing is entered then in my experience inputs seem to = "", which is different from nil, I believe)

On a positive note this looks pretty good, at least you tried to use your intuitiveness unlike a lot of programs in this section of the forums!
XoX #3
Posted 28 October 2012 - 01:10 PM
1. Alright.
2. I tab, I just don't when I'm doing computercraft as part of it happens ingame, I tabbed it anyways.


Also, I never checked if the input was nil, it always checks against "" . What you probably saw way my check if tonumber(n) was nil, because this function returns nil when n is not a number, therefore it can be used to check if a certain variable is numeric.
billysback #4
Posted 28 October 2012 - 01:24 PM
Thanks for tabbing, and putting it in pastebin also makes it easier for people to download the program :D/>/>

and yeah, I didn't realize that it was tonumber() sorry for falsely ac
XoX #5
Posted 28 October 2012 - 06:29 PM
Updated! Now you can add a 3rd password to reset your config in case you wanna change any settings.
Lildirt #6
Posted 29 October 2012 - 01:21 PM
You could dedicate a computer to the locked door and rename the program as 'startup', technically impossible to penetrate without the password.
XoX #7
Posted 29 October 2012 - 03:13 PM
You could dedicate a computer to the locked door and rename the program as 'startup', technically impossible to penetrate without the password.
Place diskdrive, insert disk with startup script. HACKED!