Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- 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
- --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(2,2)
- monitor.write("1")
- monitor.setCursorPos(4,2)
- monitor.write("2")
- monitor.setCursorPos(6,2)
- monitor.write("3")
- monitor.setCursorPos(2,3)
- monitor.write("4")
- monitor.setCursorPos(4,3)
- monitor.write("5")
- monitor.setCursorPos(6,3)
- monitor.write("6")
- monitor.setCursorPos(2,4)
- monitor.write("7")
- monitor.setCursorPos(4,4)
- monitor.write("8")
- monitor.setCursorPos(6,4)
- monitor.write("9")
- monitor.setCursorPos(4,5)
- monitor.write("0")
- monitor.setBackgroundColor(colors.red)
- monitor.setCursorPos(2,5)
- monitor.write("C")
- monitor.setBackgroundColor(colors.lime)
- monitor.setCursorPos(6,5)
- monitor.write("E")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement