Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Automatic wheat farm by Alfaver
- -- Create a variable of Bone meal qty in 15th slot
- x = turtle.getItemCount (15)
- -- Create some local function for any operation we will use
- local function HarvestGo ()
- turtle.digDown ()
- turtle.forward ()
- end
- local function HarvestLeft ()
- turtle.digDown ()
- turtle.turnLeft ()
- turtle.forward ()
- turtle.turnLeft ()
- end
- local function HarvestRight ()
- turtle.digDown ()
- turtle.turnRight ()
- turtle.forward ()
- turtle.turnRight ()
- end
- local function PlantGo ()
- turtle.select (1)
- turtle.placeDown ()
- turtle.select (14)
- turtle.placeDown ()
- turtle.forward ()
- end
- local function PlantLeft ()
- turtle.select (1)
- turtle.placeDown ()
- turtle.select (14)
- turtle.placeDown ()
- turtle.turnLeft ()
- turtle.forward ()
- turtle.turnLeft ()
- end
- local function PlantRight ()
- turtle.select (1)
- turtle.placeDown ()
- turtle.select (14)
- turtle.placeDown ()
- turtle.turnRight ()
- turtle.forward ()
- turtle.turnRight ()
- end
- local function Coal ()
- if turtle.getFuelLevel () < 500 then
- turtle.up ()
- turtle.select (16)
- turtle.suck ()
- shell.run ("refuel 64")
- turtle.suck ()
- shell.run ("refuel 64")
- turtle.suck ()
- shell.run ("refuel 64")
- turtle.suck ()
- shell.run ("refuel 64")
- else
- sleep (1)
- end
- end
- local function Bone ()
- turtle.select (15)
- if turtle.getItemCount (15) < 25 then
- turtle.suck ()
- turtle.select (16)
- turtle.drop ()
- turtle.turnRight ()
- turtle.turnRight ()
- else
- sleep (1)
- end
- turtle.select (15)
- if turtle.getItemCount (15) < 25 then
- shell.run ("shutdown")
- else
- turtle.turnRight ()
- turtle.turnRight ()
- end
- end
- -- Create a 5X5 harvest cycle with final drop of item in the 16th slot, in a front chest
- local function Harvest ()
- print ("Sto raccogliendo...")
- sleep (1)
- HarvestGo ()
- HarvestGo ()
- HarvestGo ()
- HarvestGo ()
- HarvestRight ()
- HarvestGo ()
- HarvestGo ()
- HarvestGo ()
- HarvestGo ()
- HarvestLeft ()
- HarvestGo ()
- HarvestGo ()
- HarvestGo ()
- HarvestGo ()
- HarvestRight ()
- HarvestGo ()
- HarvestGo ()
- HarvestGo ()
- HarvestGo ()
- HarvestLeft ()
- HarvestGo ()
- HarvestGo ()
- HarvestGo ()
- HarvestGo ()
- turtle.digDown ()
- turtle.select (16)
- turtle.drop ()
- turtle.turnRight ()
- turtle.turnRight ()
- end
- -- Create a 5X5 plant cycle with final check of fuel and nยฐof bone meal. If the fuel/bone meal level low, the turtle provide to recharge it self
- local function Plant ()
- print ("Sto piantando...")
- sleep (1)
- PlantGo ()
- PlantGo ()
- PlantGo ()
- PlantGo ()
- PlantRight ()
- PlantGo ()
- PlantGo ()
- PlantGo ()
- PlantGo ()
- PlantLeft ()
- PlantGo ()
- PlantGo ()
- PlantGo ()
- PlantGo ()
- PlantRight ()
- PlantGo ()
- PlantGo ()
- PlantGo ()
- PlantGo ()
- PlantLeft ()
- PlantGo ()
- PlantGo ()
- PlantGo ()
- PlantGo ()
- turtle.select (1)
- turtle.placeDown ()
- turtle.select (13)
- turtle.placeDown ()
- end
- -- Create an false infinity loop. False because if the aren't enough bone meal also after the refill, the turtle should turn off
- while true do
- Harvest ()
- Plant ()
- Coal ()
- Bone ()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement