Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local t = turtle
- local function forward(x)
- for i = 1, x do
- t.forward()
- end
- end
- local function rTurn(x)
- for i = 1, x do
- t.turnRight()
- end
- end
- local function lTurn(x)
- for i = 1, x do
- t.turnLeft()
- end
- end
- local function up(x)
- for i = 1, x do
- t.up()
- end
- end
- local function down(x)
- for i = 1, x do
- t.down()
- end
- end
- local function back(x)
- for i = 1, x do
- t.back()
- end
- end
- local fuelAmount = t.getFuelLevel()
- local function fuelCheck()
- if fuelAmount < 5000 then
- os.sleep(5)
- rs.setOutput("left", true)
- os.sleep(5)
- rs.setOutput("left", false)
- t.select(3)
- t.refuel(all)
- print("Gassed up and good to go!")
- forward(3)
- else
- print("Still Rollin!")
- forward(3)
- end
- end
- local sapCheck = t.getItemCount(1)
- local boneCheck = t.getItemCount(2)
- local function bonemealCheck()
- if t.getItemCount(2) < 30 then
- rs.setOutput("back", true)
- os.sleep(10)
- rs.setOutput("back", false)
- fuelCheck()
- else
- print("Ready to Bone")
- fuelCheck()
- end
- end
- local function saplingCheck()
- back(3)
- if sapCheck < 5 then
- rs.setOutput("right", true)
- os.sleep(5)
- rs.setOutput("right", false)
- bonemealCheck()
- else
- print("It's time to Lay")
- bonemealCheck()
- end
- end
- local function grow()
- t.select(2)
- while t.place() do
- t.place()
- end
- end
- local function plant()
- t.select(1)
- t.place()
- end
- local function harvest()
- t.dig()
- forward(1)
- for i = 1, 15, 1 do
- t.digUp()
- up(1)
- end
- down(15)
- back(1)
- end
- while true do
- saplingCheck()
- plant()
- grow()
- harvest()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement