crife

turtle scava

Mar 30th, 2013
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.71 KB | None | 0 0
  1. -- var
  2. blocco = ""
  3. sopra = ""
  4. pieno = ""
  5. -- loop
  6. while true do
  7.     -- riconosce blocco sotto e scrivilo in Blocco
  8.     blocco = turtle.detectDown()
  9.     -- se è badrock torna su
  10.     if blocco == 7 then
  11.         sopra = turtle.detectUp()
  12.         while sopra == 0 do
  13.             turtle.up()
  14.         end
  15.         if not sopra == 0 then
  16.             turtle.turnRight()
  17.             turtle.forward()
  18.             turtle.turnLeft
  19.         end
  20.     -- altrimenti scava
  21.     else then
  22.         turtle.dig()
  23.         turtle.digDown()
  24.     -- e spostati giù
  25.         turtle.down(1)
  26.     end
  27.    
  28.     pieno = turtle.getItemCount(16)
  29.     if pieno == 64 then
  30.         sopra = turtle.detectUp()
  31.         while sopra == 0 do
  32.             turtle.up()
  33.         end
  34.         if not sopra == 0 then
  35.             turtle.turnRight()
  36.             turtle.forward()
  37.             turtle.turnLeft
  38.         end
  39.     end
  40. end
Advertisement
Add Comment
Please, Sign In to add comment