Advertisement
Guest User

maze

a guest
Mar 17th, 2020
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.49 KB | None | 0 0
  1. local sides = require("sides")
  2. local robotApi = require("robot")
  3. local geo = require("component").geolyzer
  4.  
  5. robot.select(2)
  6.  
  7. function detectRight()
  8.     return not (geo.analyze(sides.right).name == "minecraft:air")
  9. end
  10.  
  11. while not robotApi.compareDown() do
  12.     if detectRight() then
  13.         if robotApi.detect() then
  14.             robotApi.turnLeft()
  15.         else
  16.             robotApi.forward()
  17.         end
  18.     else
  19.         robotApi.turnRight()
  20.         robotApi.forward()
  21.     end
  22. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement