Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- args = {...}
- turtle.select(16)
- quantity = 0
- function needMats()
- if sieve.getStackInSlot(1) == nil then
- getStack()
- print("Need more Mats")
- else
- if sieve.getStackInSlot(1).qty <= 57 then
- getStack()
- print("need more Mats")
- else
- print("waiting 10")
- os.sleep(10)
- end
- end
- end
- function getStack()
- for i=1, p.getInventorySize() do
- if p.getStackInSlot(i) ~= nil then
- if p.getStackInSlot(i).display_name ~= "Compressed Cobblestone" then
- quantity = p.getStackInSlot(i).qty
- if quantity >=63 then
- doCrafting(i, quantity)
- quantity = 0
- break
- end
- end
- end
- end
- end
- function settings()
- if #args==3 then
- p = peripheral.wrap(tostring(args[1]))
- sieve = peripheral.wrap(tostring(args[2]))
- turtleDir = tostring(args[3])
- else
- print("need 3 arguments USAGE *Compress <intput side> <output side> <input to turtle direction>*")
- end
- end
- function doCrafting(slot, n)
- craftNr = math.floor(n / 9)
- --craftNr = math.floor(n / 4)
- p.pushItemIntoSlot(turtleDir,slot,craftNr, 1)
- p.pushItemIntoSlot(turtleDir,slot,craftNr, 2)
- p.pushItemIntoSlot(turtleDir,slot,craftNr, 5)
- p.pushItemIntoSlot(turtleDir,slot,craftNr, 6)
- p.pushItemIntoSlot(turtleDir,slot,craftNr, 3)
- p.pushItemIntoSlot(turtleDir,slot,craftNr, 7)
- p.pushItemIntoSlot(turtleDir,slot,craftNr, 9)
- p.pushItemIntoSlot(turtleDir,slot,craftNr, 10)
- p.pushItemIntoSlot(turtleDir,slot,craftNr, 11)
- turtle.craft()
- print("crafted")
- turtle.drop()
- end
- settings()
- print(turtleDir)
- while true do
- p.condenseItems()
- needMats()
- --print("waiting 1")
- --os.sleep(0)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement