Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- boolean lefts
- lefts = true
- local ki = 100
- local dep = 16
- monitor = peripheral.wrap("bottom")
- monitor.setTextScale(1)
- monitor.write("Line 1 -> Terminal")
- monitor.setCursorPos(1,2)
- local i
- i = 0
- while true do
- if i == 0 then
- os.pullEvent("redstone") -- wait for a "redstone" event
- if rs.getInput("right") then -- check the input
- redstone.setOutput("back", true)
- sleep(1)
- i = i + 1
- lefts = false
- monitor.setCursorPos(1,2)
- monitor.clearLine()
- monitor.write("Arrived! Departure in " + dep " sec.")
- ki = 100
- else
- monitor.setCursorPos(1,2)
- monitor.clearLine()
- monitor.write("Arrival in " + ki + "seconds")
- ki = ki - 1
- end
- else
- if i ~= 16 then
- if lefts then
- redstone.setOutput("back", false)
- redstone.setOutput("front", true)
- lefts = false
- else
- redstone.setOutput("back", true)
- redstone.setOutput("front", false)
- lefts = true
- end
- monitor.setCursorPos(1,2)
- monitor.clearLine()
- monitor.write("Arrived! Departure in " + dep " sec.")
- i = i + 1
- sleep(1)
- else
- redstone.setOutput("back", false)
- redstone.setOutput("front", false)
- redstone.setOutput("top", true)
- sleep(1)
- redstone.setOutput("front", false)
- i = 0
- dep = 16
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement