Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local fuelSlot = 16
- local length = 8
- local width = 8
- function tF(d)
- for i = 1,d do
- while(not turtle.forward()) do
- sleep(1)
- end
- end
- end
- function tRefuel()
- while (turtle.getFuelLevel() < 200) do
- turtle.select(fuelSlot) --charcol in this slot
- turtle.refuel(1)
- print("Refueled")
- end
- print( "Fuel Level: ", turtle.getFuelLevel() )
- end
- local function selectCactus()
- turtle.select(1)
- if turtle.getItemCount(1) > 1 then
- return true
- else
- for otherSlot = 2, 15 do
- if (turtle.compareTo(otherSlot)) then
- turtle.select(otherSlot)
- return true
- end
- end
- end
- return false
- end
- function plant()
- selectCactus()
- turtle.placeDown()
- end
- function harvestRow()
- for i=1, length do
- tF(1)
- tF(1)
- if (turtle.detectDown()) then
- turtle.digDown()
- turtle.down()
- turtle.digDown()
- turtle.up()
- end
- end
- end
- function harvestField()
- for i=1, width do
- harvestRow()
- if (i % 2 == 0) then
- tF(1)
- turtle.turnRight()
- tF(1)
- turtle.turnRight()
- else
- tF(1)
- turtle.turnLeft()
- tF(1)
- turtle.turnLeft()
- end
- end
- end
- turtle.up()
- turtle.up()
- harvestField()
- turtle.turnLeft()
- tF(width)
- turtle.turnLeft()
- turtle.down()
- turtle.down()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement