Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local sides = require("sides")
- local robotApi = require("robot")
- local geo = require("component").geolyzer
- robot.select(2)
- function detectRight()
- return not (geo.analyze(sides.right).name == "minecraft:air")
- end
- while not robotApi.compareDown() do
- if detectRight() then
- if robotApi.detect() then
- robotApi.turnLeft()
- else
- robotApi.forward()
- end
- else
- robotApi.turnRight()
- robotApi.forward()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement