Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- forward = false
- function pulse(colour)
- redstone.setBundledOutput("back", colour)
- os.sleep(.1)
- redstone.setBundledOutput("back", 0)
- end
- function moveForward()
- pulse(colours.blue)
- print("Moving forwards")
- end
- function moveBackward()
- pulse(colours.white)
- print("Moving backwards")
- end
- while true do
- local wait
- if colors.test(redstone.getBundledInput("back"), colors.pink) == true then
- forward = false
- end
- if colors.test(redstone.getBundledInput("back"), colors.red) == true then
- wait = true
- forward = true
- end
- if forward == true then
- if wait then
- for i=1, 6 do
- print("Waiting... " .. i)
- os.sleep(1)
- end
- end
- wait = false
- moveForward()
- else
- moveBackward()
- end
- os.sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement