Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local args = { ... }
- if #args ~= 2 then
- print( "Requires length of lines and total lines to farm." )
- error()
- end
- data = turtle.getItemDetail()
- fuelLevel = turtle.getFuelLevel()
- reprocessorSuccess, reprocessorData = turtle.inspectDown()
- if (not data) and (not reprocessorSuccess) then
- print( "Requires seeds in current slot" )
- error()
- end
- if data then
- if data.name ~= "mysticalagriculture:inferium_seeds" then
- print( "Requires inferium seeds in current slot" )
- error()
- end
- end
- if reprocessorData then
- if reprocessorData.name ~= "mysticalagriculture:inferium_reprocessor" then
- print( "Requires inferium reprocessor below start point" )
- error()
- end
- end
- if fuelLevel == 0 then
- print("Out of fuel!")
- error()
- end
- print("Here we go!")
- local lengthOfLines = tonumber(args[1])
- local totalPairs = tonumber(args[2])
- lengthOfLines = lengthOfLines + 1
- local function checkIfGrown()
- success, data = turtle.inspectDown()
- if success then
- if data.name ~= "mysticalagriculture:inferium_crop" then
- print( "Can't find inferium")
- error()
- end
- if data.state.age == 7 then
- return true
- else
- return false
- end
- end
- end
- local function forwardLoop(loopAmount)
- for i=1,loopAmount do
- grown = checkIfGrown()
- if grown == true then
- turtle.digDown()
- turtle.placeDown()
- end
- if i ~= loopAmount then
- turtle.forward()
- end
- end
- end
- for x=1,25 do
- turtle.forward()
- for i=1,totalPairs do
- forwardLoop(lengthOfLines)
- turtle.turnLeft()
- turtle.forward()
- turtle.forward()
- turtle.turnLeft()
- forwardLoop(lengthOfLines)
- turtle.turnRight()
- turtle.forward()
- turtle.forward()
- turtle.turnRight()
- end
- turtle.turnRight()
- local goBack = totalPairs * 4
- for i=1,goBack do
- turtle.forward()
- end
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- turtle.turnLeft()
- local curSeeds = turtle.getItemCount() - 1
- if curSeeds ~= 0 then
- turtle.dropDown(curSeeds)
- end
- os.sleep(240)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement