It's got so many features, man. So many features…
pastebin get XDgeSDTq sinelock
std pb XDgeSDTqs sinelock
std ld sinelock sinelock
I call it 'Sinelock' because while you enter your password, it's shows a beautiful sinewave animation (that I tried my best to optimize)! YAY!
Syntax:
sinelock --Open the lock screen.
sinelock addpass <password> --Adds a new password to accept.
sinelock keymake <password> --Puts a password on a disk or pocket computer.
Features:
+Uses SHA256 hashing w/ salt
+Allows for multiple passwords (either enter one of many, or enter all in order)
+Can use disks as key cards
+Prevents termination (duh)
+Works as computer lock OR door lock
Config options: (in program, not separate config file)
Spoiler
local terminateMode = 2 --0 enables termination, 1 blocks it, 2 provides a taunting screen.
local passFile = ".sl_password" --The ABSOLUTE path of the password file.
local saltFile = ".sl_salt" --The ABSOLUTE path of the salt file.
local characterLimit = 1024 --The cap of characters at the read() prompt. Set this to prevent crashes.
local runProgram = "" --Set to something to run it when correct, and not using doors.
local dahChar = "*" --The character used to hide characters when typed.
local doKeyCards = true --Whether or not the lock also accepts keycards (floppy disks) as well as passwords.
local doEjectDisk = false --Whether or not to eject a keycard after it's accepted, just to speed things up a bit.
local doorSides = {} --If it has anything, the lock will open the doors instead of unlocking the PC.
local doInvertSignal = false --If true, it will invert the redstone signal of the door, in case you need to.
local doShowDoorSides = true --If true, will show the door sides being opened. Set to false if you are paranoid.
local beWavey = true --Whether or not to animate the sine wave.
local readYpos = scr_y-2 --The Y position of the read() prompt
local requireAllPasswords = false --Whether or not the lock asks for ONE of the multiple passwords, or ALL of them in order.
local badlength = 4 --The length in seconds that you have to wait to try again.
local goodlength = 6 --The length in seconds that doors will stay open.
local sineFrameDelay = 0.15 --The amount of time between sine animation frames. Tradeoff of purty vs performance.
Screenshots:
Spoiler
The main screen, showcasing the duel-layered sine wave animation. The "P1" is if you have more than one password.
You can load passwords onto a disk as a keycard!