Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- startup: os.loadAPI("waypoint")
- function wayforward()
- turtle.select(2)
- return turtle.compareDown()
- end
- function wayleft()
- turtle.select(1)
- return turtle.compareDown()
- end
- function wayright()
- turtle.select(3)
- return turtle.compareDown()
- end
- function waystop()
- turtle.select(4)
- return turtle.compareDown()
- end
- function go()
- stop = false
- print("slot 1 = left")
- print("slot 2 = forward")
- print("slot 3 = right")
- print("slot 4 = stop")
- while stop ~= true do
- while wayforward() do
- turtle.forward()
- end
- while wayleft() do
- turtle.turnLeft()
- turtle.forward()
- end
- while wayright() do
- turtle.turnRight()
- turtle.forward()
- end
- if waystop() == true then
- stop = true
- print("stop")
- end
- end
- end
- function goback()
- stop = false
- while stop ~= true do
- while wayforward() do
- turtle.forward()
- end
- while wayleft() do
- turtle.turnRight()
- turtle.forward()
- end
- while wayright() do
- turtle.turnLeft()
- turtle.forward()
- end
- if waystop() == true then
- stop = true
- print("stop")
- end
- end
- end
- function back()
- turtle.turnRight()
- turtle.turnRight()
- turtle.forward()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement