Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tArgs = {...}
- --Roles:
- --crafter: Compresses cobblestone/other
- --manager: Holds on to different tiers of compressed cobble/other
- function craft(count)
- craftingSlots = {2,3,5,6,7,9,10,11}
- amount = count / 9
- for i = 1,8 do
- turtle.transferTo(craftingSlots[i], amount)
- end
- turtle.craft()
- end
- if tArgs[1] == 'crafter' then
- storedDown = 0
- while true do
- sleep(0.1)
- if redstone.getInput('top') == false then
- redstone.setOutput('top', false)
- turtle.suck()
- while turtle.getItemCount(1) < 9 do
- if not (storedDown == 0) then
- turtle.suckDown()
- storedDown = 0
- else
- sleep(0.001)
- turtle.suck()
- end
- end
- count = turtle.getItemCount(1)
- rest = count % 9
- turtle.dropDown(rest)
- storedDown = storedDown + rest
- craft(count - rest)
- redstone.setOutput('top', true)
- while turtle.getItemCount(1) > 0 do sleep(0.001) end
- elseif redstone.getInput('top') == true then
- while turtle.getItemCount(1) == 0 do sleep(0.001) end
- redstone.setOutput('top', false)
- craft(turtle.getItemCount(1))
- redstone.setOutput('top', true)
- while turtle.getItemCount(1) > 0 do sleep(0.001) end
- end
- end
- elseif tArgs[1] == 'manager' then
- while true do
- while redstone.getInput('bottom') == false do sleep(0.001) end
- turtle.select(1)
- turtle.suckDown()
- for i = 1,7 do
- count = turtle.getItemCount(i)
- if count >= 10 then
- redstone.setOutput('bottom', true)
- turtle.select(i)
- turtle.dropDown(count - (count % 9))
- sleep(0.1)
- while redstone.getInput('bottom') == false do sleep(0.001) end
- turtle.select(i+1)
- turtle.suckDown()
- end
- end
- redstone.setOutput('bottom', false)
- sleep(0.5)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement