Lucified

TestProgram.lua

Jun 2nd, 2022
903
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.48 KB | None | 0 0
  1. BlockList = {
  2.     2,
  3. }
  4.  
  5. function detectLeft()
  6.     turtle.turnLeft()
  7.  
  8.     for i, Block in pairs(BlockList) do
  9.         turtle.select(Block)
  10.         detected = turtle.compare()
  11.         if detected == true then turtle.turnRight() return true end
  12.     end
  13.     turtle.turnRight()
  14.     return false
  15. end
  16.  
  17. for i = 0, 20, 1 do
  18.  
  19.     if turtle.getFuelLevel() < 200 then
  20.         turtle.refuel(1)
  21.         print("Refueling")
  22.     end
  23.  
  24.     print(detectLeft())
  25.  
  26.     turtle.forward()
  27. end
Advertisement
Add Comment
Please, Sign In to add comment