Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --local plantName = "PneumaticCraft:heliumPlant"
- local plantName = "PneumaticCraft:flyingFlower"
- local plantMeta = 6
- local plantInvName = "PneumaticCraft:plasticPlant"
- --local plantInvMeta = 11
- local plantInvMeta = 15
- local delay = 2
- local smallDelay = 1
- local seedSlot = 1
- turtle.select(seedSlot)
- local function dumpSeeds(slotNr,num)
- turtle.select(slotNr)
- --turtle.drop(num)
- turtle.dropDown(num)
- -- turtle.select(seedSlot)
- end
- local function checkInventory()
- local item = nil
- local count = 0
- local seedFound = false
- for i = 1,16 do
- item = turtle.getItemDetail(i)
- count = 0
- if item and item.name == plantInvName and item.damage == plantInvMeta then
- count = item.count
- if seedFound == false then
- if count > 1 then
- dumpSeeds(i,count - 1)
- end
- seedSlot = i
- --turtle.select(seedSlot)
- seedFound = true
- else
- if count > 0 then
- dumpSeeds(i,64)
- end
- end
- end
- end
- turtle.select(seedSlot)
- return seedFound
- end
- local function waitForSeed()
- local event, p1
- local validInv = false
- while not validInv do
- event, p1 = os.pullEvent("turtle_inventory")
- validInv = checkInventory()
- end
- end
- local function plantPlant()
- local validInv = checkInventory()
- --if not validInv then waitForSeed() end
- --turtle.select(seedSlot)
- local plantB,plantV = false,nil
- --plantB,plantV = turtle.inspectUp()
- plantB,plantV = turtle.inspect()
- while plantB and plantV.name == plantName and plantV.metadata ~= plantMeta do
- --plantB,plantV = turtle.inspectUp()
- plantB,plantV = turtle.inspect()
- sleep(delay)
- end
- if plantB and plantV.name == plantName and plantV.metadata == plantMeta then
- --turtle.digUp()
- turtle.dig()
- validInv = checkInventory()
- end
- --plantB,plantV = turtle.inspectUp()
- plantB,plantV = turtle.inspect()
- if not validInv then waitForSeed() end
- if not plantB then
- --turtle.dropUp(1)
- turtle.drop(1)
- sleep(delay*2)
- end
- end
- while true do
- --checkInventory()
- plantPlant()
- sleep(delay*2)
- end
Advertisement
Add Comment
Please, Sign In to add comment