Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while true do
- function CheckWheat()
- local success, data = turtle.inspect()
- local mature
- if success and data.metadata == 7 then
- mature = true
- elseif success and data.metadata ~= 7 then
- mature = fals
- else
- mature = nil
- end
- return mature
- end
- function FuelUp()
- local fuel = turtle.getFuelLevel()
- if fuel<128 then
- turtle.suck(32)
- turtle.refuel(32)
- end
- end
- function Store()
- turtle.select(1)
- for i = 1, 16
- local inv = turtle.getItemDetail()
- if inv and inv.name == "minecraft:wheat" then
- turtle.drop()
- elseif inv and inv == "minecraft:wheat_seeds" and i > 2 then
- turtle.drop()
- end
- end
- repeat
- turtle.turnLeft()
- local wheat = CheackWheat()
- if wheat == true then
- turtle.dig()
- elseif wheat == nil then
- turtle.select(2)
- turtle.place()
- end
- turtle.turnRight()
- turtle.turnRight()
- local wheat =CheckWheat()
- if wheat == true then
- turtle.dig()
- elseif wheat == nil then
- turtle.place()
- end
- turtle.turnLeft()
- local stop = turtle.detect()
- if stop == true then
- FuelUp()
- end
- until stop == true
- repeat
- turtle.turnLeft()
- local wheat = CheackWheat()
- if wheat == true then
- turtle.dig()
- elseif wheat == nil then
- turtle.select(2)
- turtle.place()
- end
- turtle.turnRight()
- turtle.turnRight()
- local wheat =CheckWheat()
- if wheat == true then
- turtle.dig()
- elseif wheat == nil then
- turtle.place()
- end
- turtle.turnLeft()
- local stop = turtle.detect()
- if stop == true then
- Store()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement