Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function wait()
- --Anytime in seconds you want
- sleep(15)
- end
- --Harvests bellpepper in front of it then drops all the bellpepper in selected slot except 1.
- function dig()
- turtle.dig()
- turtle.suck()
- turtle.suckDown()
- turtle.suckUp()
- turtle.place()
- for i = 1,turtle.getItemCount() - 1, 1 do
- turtle.suck()
- turtle.suckDown()
- turtle.suckUp()
- end
- end
- --Checks if bellpepper is planted, if so checks if its ready for harvesting
- function inspect()
- local booleanValue, bellpepperInfo = turtle.inspect()
- if (not booleanValue) then
- for i = 1, 16, 1 do
- turtle.select(i)
- turtle.getItemDetail(i)
- print(turtle.getItemDetail(i))
- if(turtle.getItemDetail(i) ~= nil) then
- if (turtle.getItemDetail(i).name == "pamhc2crops:pambellpeppercrop") then
- turtle.place()
- turtle.suck()
- turtle.suckDown()
- turtle.suckUp()
- break
- end
- end
- end
- turtle.place()
- else
- if (bellpepperInfo.state.age == 7) then
- dig()
- turtle.suck()
- turtle.suckDown()
- turtle.suckUp()
- next()
- else
- wait()
- inspect()
- end
- end
- end
- --Moves forward and checks next bellpepper, if it detects a block in front of it, turns around and goes back to start
- function next()
- turtle.turnLeft()
- if (turtle.inspect() == false) then
- turtle.forward()
- turtle.turnRight()
- turtle.suck()
- turtle.suckDown()
- turtle.suckUp()
- inspect()
- else
- turtle.turnLeft()
- turtle.turnLeft()
- while (turtle.inspect() == false) do
- turtle.forward()
- turtle.suck()
- turtle.suckDown()
- turtle.suckUp()
- end
- turtle.turnLeft()
- turtle.suck()
- turtle.suckDown()
- turtle.suckUp()
- inspect()
- end
- end
- inspect()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement