Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function r()
- rs.setOutput("right",true)
- sleep(0.5)
- rs.setOutput("right",false)
- sleep(0.5)
- end
- function l()
- rs.setOutput("left",true)
- sleep(0.5)
- rs.setOutput("left",false)
- sleep(0.5)
- end
- function right()
- r() r() r() r() r() r() r() r()
- end
- function left()
- l() l() l() l() l() l() l() l()
- end
- function front()
- rs.setOutput("front",true)
- sleep(0.5)
- rs.setOutput("front",false)
- end
- while true do
- file = fs.open("logs/log", "r")
- inhalt = file.readLine()
- file.close()
- if inhalt == "0.0" and rs.getInput("back") then
- local file = fs.open("logs/log", "w")
- file.write(1)
- file.close()
- front()
- left()
- end
- if inhalt == "1.0" and rs.getInput("back") then
- local file = fs.open("logs/log", "w")
- file.write(0)
- file.close()
- front()
- right()
- end
- sleep(0.5)
- end
Add Comment
Please, Sign In to add comment