Advertisement
Guest User

test

a guest
Dec 7th, 2019
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.67 KB | None | 0 0
  1. -- Farming script V2 by Mathias
  2.  
  3. -- Variables
  4. crop = "wheat"
  5. seed = "wheat_seeds"
  6.  
  7.  
  8. function check()
  9.   if (turtle.inspectDown()) then
  10.    local block, type = turtle.inspectDown()
  11.    type.name = type.name:gsub("minecraft:","")
  12.    return type
  13.   else
  14.    local type = {name = "empty",metadata = 0}
  15.    return type
  16.   end
  17.  
  18.   print(block.name)
  19. end
  20.  
  21. function plant()
  22.   for i = 1,16 do
  23.     if (turtle.getItemDetail(i)) then
  24.       local data = turtle.getItemDetail(i)
  25.       data.name = data.name:gsub("minecraft:","")
  26.       if (data.name == seed) then
  27.         turtle.select(i)
  28.         turtle.placeDown()
  29.         break
  30.       end
  31.     end    
  32.   end
  33. end
  34.  
  35. plant()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement