So far, so good.
But after well over two hours I can't get the touchscreen function to work worth a damn. No matter what I do, I can't figure out the variables there. Nor how to do the second part;
My plan was that you put in the numbers and either hit clear (reset to no input recorded) or enter (Submit code.)
And that four asterisks would appear at that upper grey bar as you entered the code. But I can't figure even where to begin with those.
… help?
-- housekeeping; this area is for cleaning up
-- redstone output sides.
term.clear()
term.setCursorPos(1,1)
term.write("Enter redstone output side:")
term.setCursorPos(30,1)
local sides = {}
for k, v in pairs( rs.getSides() ) do
sides[ v ] = true
end
local side
repeat
side = read ()
until sides[ side ]
-- test of redstone output
redstone.setOutput(side, true)
sleep(1)
redstone.setOutput(side, false)
-- autodetection and assignment of monitor side
if peripheral.isPresent("top") == true then
monitor = peripheral.wrap("top")
elseif peripheral.isPresent("bottom") == true then
monitor = peripheral.wrap("bottom")
elseif peripheral.isPresent("left") == true then
monitor = peripheral.wrap("left")
elseif peripheral.isPresent("right") == true then
monitor = peripheral.wrap("right")
elseif peripheral.isPresent("front") == true then
monitor = peripheral.wrap("front")
elseif peripheral.isPresent("back") == true then
monitor = peripheral.wrap("back")
else
term.clear()
term.setCursorPos(1,1)
print("NO MONITOR ATTACHED!")
sleep(1)
os.shutdown()
end
--enter code
term.clear()
term.setCursorPos(1,1)
print("Enter Password- four digits, numbers only.")
local code
repeat
code = read()
until #code == 4
term.clear()
monitor.setTextScale(0.5)
while true do
--begin monitor pattern
monitor.setBackgroundColor(colors.gray)
monitor.setTextColor(colors.black)
monitor.clear()
monitor.setCursorPos(1,1)
monitor.setBackgroundColor(colors.lightGray)
monitor.write(" ")
monitor.setBackgroundColor(colors.lightGray)
monitor.setCursorPos(4,3)
monitor.write(" ")
monitor.setCursorPos(4,4)
monitor.write(" 1 2 3 ")
monitor.setCursorPos(4,5)
monitor.write(" ")
monitor.setCursorPos(4,6)
monitor.write(" 4 5 6 ")
monitor.setCursorPos(4,7)
monitor.write(" ")
monitor.setCursorPos(4,8)
monitor.write(" 7 8 9 ")
monitor.setCursorPos(4,9)
monitor.write(" ")
monitor.setCursorPos(4,10)
monitor.setBackgroundColor(colors.red)
monitor.write("CLR")
monitor.setBackgroundColor(colors.lightGray)
monitor.setCursorPos(7,10)
monitor.write(" 0 ")
monitor.setBackgroundColor(colors.lime)
monitor.setCursorPos(10,10)
monitor.write("ENT")
sleep(1)
end
And yes, I've deleted the section of code that was my os.pull. It just kept erroring, no matter what the hell I did. There IS a nice huge gap where it SHOULD be though.