Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Variables
- inspectBool, blockTable = turtle.inspectDown()
- sideTurned = ""
- onSignal = redstone.getInput("bottom")
- function sideToTurn()
- if sideTurned == "" or "right" then
- turtle.turnLeft()
- turtle.forward()
- turtle.forward()
- turtle.turnLeft()
- turtle.forward()
- elseif sideTurned() == "left" then
- turtle.turnRight()
- turtle.forward()
- turtle.forward()
- turtle.turnRight()
- turtle.forward()
- end
- end
- function checkBlock()
- if inspectBool == true then
- for k,v in pairs(blockTable) do
- if v == "minecraft:melon_block" or v == "minecraft:pumpkin" then
- turtle.digDown()
- end
- if v == "minecraft:glass" then
- sideToTurn()
- end
- if v == "minecraft:stonebrick" then
- lookingForMonitor()
- else
- turtle.placeDown()
- turtle.suckDown(64)
- turtle.suckDown(64)
- end
- end
- else
- turtle.forward()
- end
- end
- function lookingForMonitor()
- if inspectBool == true then
- for k,v in pairs(blockTable) do
- if v == "computercraft:peripheral" then
- turtle.turnLeft()
- else
- turtle.forward()
- end
- end
- end
- end
- function harvestCrops()
- while true do
- checkBlock()
- end
- end
- repeat redstone.getInput("bottom")
- sleep(5)
- until redstone.getInput("bottom") == true
- --Move Turtle to start of crops.
- turtle.forward()
- turtle.turnLeft()
- turtle.forward()
- turtle.forward()
- turtle.forward()
- turtle.turnRight()
- --Selecting slot 1. This is where you should place a tool so the Turtle can use it to harvest crops.It does not use durability.
- turtle.select(1)
- harvestCrops()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement