local monSide = "blank"
local redSide = "blank"
local code = "0000"
term.clear()
term.setCursorPos(1,1)
print("Enter side of monitor:")
term.setCursorPos(1,2)
print("top, back, left, right, front, bottom.")
term.setCursorPos(1,3)
monSide = read():lower()
term.setCursorPos(1,5)
print("Enter Redstone output side:")
term.setCursorPos(1,6)
print("top, back, left, right, front, bottom")
term.setCursorPos(1,7)
redSide = read():lower()
term.setCursorPos(1,9)
print("Enter four digit code:")
term.setCursorPos(1,10)
code = read()
So that right there is the "housekeeping" for a keypad entry system that I'm trying to make. What I'm trying to find a way to do is to make it so you run the program the first time and it stores monitor side, redstone output side, and the code without you having to muck about in the lua script for it. Thing is- I know how to make it so that it'll reject inputs that aren't "top, bottom, left, right, front, back."
I even plan to make it so you can't double up by mistake.
But how on earth do I get it to require four digits for the passcode, but reject five or three, or letters?