Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- pastebin get kZaXMD1Y
- -- Normally for 3 recipes which compact 3 different ore reeds to ingots
- -- you would use 3 crafters. This is the all-in-one solution.
- -- One turtle for many 3x3 recipes.
- -- Made by Konitor 2024
- -- this turtle compacts 3x3 recipes. Originally made for a
- -- ore reed farm which delivered different reeds to be compacted
- -- to different ore ingots.
- -- front chest = input chest. Make sure it has enough empty space
- -- for the turtle to put back its contents.
- -- down chest = output chest. Have a pipe system on it to always keep it empty.
- -- you need a crafting turtle!!!!
- -- crafted how many items so far?
- crafted = 0
- -- Check to see if I'm alright and ready for crafting
- bCrafting = (peripheral.getType("left") == "workbench") or (peripheral.getType("right") == "workbench")
- if not bCrafting then
- error("I want to be a crafty turtle! Craft me together with a crafting table.")
- end
- --Auto Label
- if os.getComputerLabel() == nil then
- os.setComputerLabel("new-3x3")
- end
- -- copy this program to startup when its not "startup"
- me = fs.getName( shell.getRunningProgram() )
- if( me ~= "startup") then
- print( "Overwriting startup with "..me )
- if( fs.exists("startup") ) then
- fs.delete("startup")
- end
- fs.copy( me, "startup" )
- end
- print( "Front chest = input" )
- print( "Down chest = output" )
- print( "Konitor 2024" )
- -- first stack is selected after clearing
- function cleartablebiggestfirst()
- local biggeststack = 0
- local biggestnum = 0
- for i=1, 16 do
- n = turtle.getItemCount( i )
- if n > biggestnum then
- biggeststack = i
- biggestnum = n
- end
- end
- if biggeststack > 0 then
- turtle.select( biggeststack )
- turtle.drop()
- end
- for i = 16, 1, -1 do
- turtle.select(i)
- turtle.drop()
- end
- sleep( 1 )
- end
- while true do
- cleartablebiggestfirst()
- docraft = true
- if turtle.suck(64) then
- n = turtle.getItemCount( 1 )
- r = n % 9
- anz = math.floor( n / 9 )
- if( anz > 0 ) then
- turtle.transferTo( 2, anz )
- turtle.transferTo( 3, anz )
- turtle.transferTo( 5, anz )
- turtle.transferTo( 6, anz )
- turtle.transferTo( 7, anz )
- turtle.transferTo( 9, anz )
- turtle.transferTo( 10, anz )
- turtle.transferTo( 11, anz )
- else
- docraft = false
- end
- else
- docraft = false
- end
- if docraft then
- turtle.craft( anz )
- -- drop rest of slot 1 back to source chest
- if r == 0 then
- -- Slot 1 contains crafted item
- turtle.dropDown()
- else
- -- Slot 1 contains input item - drop it back
- turtle.drop()
- end
- -- drop crafted items into target chest
- turtle.select(2)
- turtle.dropDown()
- crafted = crafted + anz
- print( "crafted " .. crafted .. " items")
- else
- cleartablebiggestfirst()
- for i = 1, 16 do
- turtle.suck()
- end
- cleartablebiggestfirst()
- end
- end
Advertisement
Comments
-
- pastebin get kZaXMD1Y new-3x3
- One crafting turtle for many 3x3 recipes.
- For the "ore reed" mod.
- One crafting turtle uses the harvests chest in front and crafts everything to ores. The harvest chest may contain different reeds at the same time. Ore output is bottom chest. I suggest using a pipe mod to transfer crafted items to a drawers system.
- I recommend the harvest system from Kaikaku. https://www.youtube.com/watch?v=Oz2xnDchqFg
- pastebin get ZVc6H649 aHarvester
Add Comment
Please, Sign In to add comment
Advertisement