Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local test_id = "0"
- local test_state = -1
- local test_start = 0
- local test_end = 0
- local test_label = "1/1"
- local test_elements = {"Button Interaction"}
- function Loop()
- ChamberManager("on")
- while true do
- local event, a, b, c = os.pullEvent()
- if event == "rednet_message" then
- elseif event == "key" then
- else
- if redstone.getInput("bottom") == true then--test subject exits
- test_end = os.time()
- ChamberManager("reset")
- elseif redstone.getInput("left") == true then--test begins
- test_start = os.time()
- end
- end
- os.queueEvent("pass")
- end
- end
- function ChamberManager(action)
- if action == "reset" then
- redstone.setOutput("right",true)
- os.sleep(3)
- redstone.setOutput("right",false)
- elseif action == "off" then
- redstone.setOutput("top",false)
- DisplayError_Monitor("chamber offline")
- elseif action == "on" then
- redstone.setOutput("top",true)
- DrawMonitor()
- end
- end
- function DisplayError_Monitor(error)
- local monitor = peripheral.find("monitor_0")
- monitor.setBackgroundColor(colors.black)
- monitor.setTextColor(colors.yelloe)
- monitor.clear()
- monitor.setCursorPos(1,1)
- monitor.write("an Error has occured")
- monitor.setCursorPos(2,3)
- monitor.write(error)
- end
- function DrawMonitor()
- local monitor = peripheral.find("monitor_0")
- monitor.setBackgroundColor(colors.white)
- monitor.clear()
- monitor.setCursorPos(2,2)
- monitor.setTextColor(colors.black)
- monitor.write("Aperture Science")
- monitor.setCursorPos(2,3)
- monitor.write(test_label)
- monitor.setCursorPos(2,9)
- monitor.write("testing elements")
- for i = 1, #test_elements do
- monitor.setCursorPos(2,9 + i)
- monitor.write(test_elements[i])
- end
- end
- Loop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement