Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Wrapping starting peripheral
- analyzer = peripheral.wrap("bottom")
- inventory = peripheral.wrap("right")
- local p1 = nil
- local p2 = nil
- local done = false
- -- checking on starting seeds
- local s1, s2, s3 = analyzer.getSpecimenStats("NORTH")
- p1 = s1 + s2 + s3
- local s1, s2, s3 = analyzer.getSpecimenStats("EAST")
- p2 = s1 + s2 + s3
- while not done do
- -- Check if parents are mature
- p1Mature = analyzer.isMature("EAST")
- p2Mature = analyzer.isMature("NORTH")
- if p1Mature and p2Mature then
- -- Place 2nd crop stick for crossbreeding
- turtle.forward()
- turtle.forward()
- turtle.turnLeft()
- turtle.forward()
- redstone.setOutput("bottom", true)
- sleep(1)
- redstone.setOutput("bottom", false)
- -- Move to 2nd analyzer
- turtle.forward()
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- -- wait for crossbreed
- analyzer = peripheral.wrap("bottom")
- while analyzer.isCrossCrop("SOUTH") do
- sleep(1)
- end
- -- pick up new seed
- turtle.forward()
- turtle.select(1)
- turtle.digDown()
- turtle.suckDown()
- turtle.placeDown()
- turtle.select(2)
- turtle.forward()
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- turtle.turnRight()
- sleep(0.1)
- print("Back at analyzer")
- -- Analyze new seed
- analyzer = peripheral.wrap("bottom")
- --inventory.pushItem("down", 1)
- turtle.dropDown(turtle.getItemCount())
- analyzer.analyze()
- sleep(3.5)
- turtle.select(2)
- --inventory.pullItem("down", 1)
- turtle.suckDown()
- print("seed analyzed")
- end
- sleep(5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement