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
- back(3)
- os.sleep(5)
- rs.setOutput("left", true)
- os.sleep(5)
- rs.setOutput("left", false)
- t.select(3)
- t.refuelAll()
- forward(3)
- --t.print("Gassed up and good to go!")
- else
- t.print("Still Rollin!")--
- end
- end
- local itemCheck1 = t.getItemCount(1)
- local itemCheck2 = t.getItemCount(2)
- local function bonemealCheck()
- t.select(2)
- if itemCheck2 < 10 then
- back(3)
- rs.setOutput("back", true)
- os.sleep(15)
- rs.setOutput("back", false)
- forward(3)
- else
- --os.print("Ready to Bone")--
- end
- end
- local function saplingCheck()
- t.select(1)
- if itemCheck1 < 5 then
- back(3)
- rs.setOutput("right", true)
- os.sleep(5)
- rs.setOutput("right", false)
- forward(3)
- else
- --os.print("It's time to Lay")--
- end
- end
- local function readyCheck()
- saplingCheck()
- bonemealCheck()
- fuelCheck()
- 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()
- for i = 1, 15, 1 do
- t.digUp()
- up(1)
- end
- down(15)
- back(1)
- end
- while true do
- readyCheck()
- plant()
- grow()
- Harvest()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement