Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ FARM program v0.3 ]]--
- print("Please input how far forward the turtle should go...")
- y = io.read()
- print("Please input the number of columns there are...")
- x = io.read()
- print("You should place the turtle at the X.")
- for rowsSample=0,y-1,1 do
- print(string.rep('.',x))
- end
- print("X"..string.rep('.',x-1))
- print("Input Y to continue.")
- confirmation = io.read()
- if confirmation ~= "Y" then
- print("Cancelled farming...")
- return
- end
- alternating = false
- function alternateTurn()
- if alternating then
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- else
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- end
- end
- function checkCrop()
- local exists, data = turtle.inspectDown()
- if exists and data.name == "minecraft:wheat" and data.metadata == 7 then
- turtle.digDown()
- turtle.placeDown()
- end
- end
- for ax=1,x,1 do
- for ay=1,y,1 do
- checkCrop()
- turtle.forward()
- end
- checkCrop()
- alternateTurn()
- alternating = not alternating
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement