Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function GetSeeds()
- local count = 16
- repeat
- local currentSlot = turtle.getSelectedSlot()
- local data = turtle.getItemDetail(currentSlot)
- if data.name == "minecraft:wheat_seeds" then
- return true
- else
- turtle.select((currentSlot%16)+1)
- count = count - 1
- end
- currentSlot = turtle.getSelectedSlot()
- data = turtle.getItemDetail(currentSlot)
- until(count == 0)
- return false
- end
- function ReplaceSeed()
- local passed,data = turtle.inspectDown()
- if passed then
- if data.name == "minecraft:wheat" then
- if data.state.age == 7 then
- turtle.digDown()
- if GetSeeds() then
- turtle.placeDown()
- else
- print("OOF")
- end
- end
- end
- end
- end
- function ReturnHome(w)
- turtle.back()
- turtle.turnRight()
- for i=1,w,1 do
- turtle.forward()
- end
- turtle.turnLeft()
- end
- local w = arg[1] or 10
- for i=1,w,1 do
- for j=1,w-1,1 do
- ReplaceSeed()
- turtle.forward()
- end
- if i%2 == 1 then
- ReplaceSeed()
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- else
- ReplaceSeed()
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- end
- end
- --ReturnHome(w)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement