Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local left = 11 -- Blue Wool
- local right = 14 -- Read Wool
- local turnBack = 7 -- Grey Wool
- local pkLoc = 1
- local wheatLoc = 1
- local seedLoc = 1
- local carrotLoc = 1
- local sugurLoc = 1
- local cropSeeds = "minecraft:wheat_seeds"
- local cropSugar = "minecraft:reeds"
- local cropPk = "minecraft:pumpkin"
- local cropWheat = "minecraft:wheat"
- local cropCarrot = "minecraft:carrot"
- local cropPotato = "minecraft:potato"
- local currentCrop = cropWheat
- local bChest = "minecraft:chest"
- function setLocs()
- for i=1,16 do
- turtle.select(i)
- if turtle.getItemCount(i) > 0 then
- data = turtle.getItemDetail(i)
- if data.name == cropSeeds then
- seedLoc = i
- print("seedLoc = ",seedLoc)
- elseif data.name == cropPk then
- pkLoc = i
- print("pumpkins =",pkLoc)
- elseif data.name == cropCarrot then
- carrotLoc = i
- print("carrots = ",carrotLoc)
- elseif data.name == cropPotato then
- potatoLoc = i
- print("potatos = ",potatoLoc)
- elseif data.name == cropSugar then
- sugarLoc = i
- print("SugarCane =", sugarLoc)
- elseif data.name == cropWheat then
- wheatLoc = i
- print("Wheat =", wheatLoc)
- end
- end
- end
- end
- function refuel()
- for i = 1, 16 do
- turtle.select(i)
- if turtle.getItemCount(i) >0 then
- turtle.refuel()
- end
- end
- print("Fuel Level", turtle.getFuelLevel())
- end
- setLocs()
- currentSeed = seedLoc
- while true do
- refuel()
- while turtle.getFuelLevel() > 0 do
- local succFront, IDFront = turtle.inspect()
- local succDown, IDDown = turtle.inspectDown()
- if succDown == false then
- print("Plant Seed")
- turtle.digDown()
- if currentSeed == cropPk then
- elseif currentSeed == cropSugar then
- else
- turtle.select(currentSeed)
- turtle.placeDown()
- end
- else
- if IDDown.name == cropWheat then
- if IDDown.metadata == 7 then
- currentCrop = cropWheat
- currentSeed = seedLoc
- turtle.select(wheatLoc)
- turtle.digDown()
- turtle.digDown()
- turtle.select(seedLoc)
- turtle.placeDown()
- end
- elseif IDDown.name == cropCarrot then
- if IDDown.metadata == 7 then
- currentCrop = cropCarrot
- currentSeed = carrotLoc
- turtle.select(carrotLoc)
- turtle.digDown()
- turtle.digDown()
- turtle.placeDown()
- end
- elseif IDDown.name == cropPk then
- if IDDown.metadata == 0 then
- currentCrop = cropPk
- turtle.select(pkLoc)
- turtle.digDown()
- end
- elseif IDDown.name == bChest then
- for i = 1, 8, 1 do
- turtle.select(i)
- turtle.dropDown(turtle.getItemCount(i))
- end
- end
- end
- if IDFront.name == "minecraft:wool" then
- if IDFront.metadata == left then
- turtle.turnLeft()
- elseif IDFront.metadata == right then
- turtle.turnRight()
- elseif IDFront.metadata == turnBack then
- turtle.turnLeft()
- turtle.turnLeft()
- end
- elseif IDFront.name == "minecraft:reeds" then
- currentCrop = cropSugar
- turtle.dig()
- end
- turtle.forward()
- end
- setLocs()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement