Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local slotCount = 16
- function init()
- if lookForChest() == false then return end
- getItems()
- -- should have full inv of tiny dry rubber
- turnAround()
- turtle.craft()
- turtle.select(1)
- turtle.drop()
- turnAround()
- end
- function lookForChest()
- local success, item = turtle.inspect()
- local turns = 0
- while item == nil or item.name ~= 'quark:custom_chest' do
- if turns >= 4 then
- print('no chest around turtle')
- return false
- end
- turtle.turnLeft()
- turns = turns + 1
- if item.name ~= nil then
- print(item.name)
- end
- end
- return true
- end
- function getItems()
- while(checkForAllFullStacks() == false) do
- turtle.suck()
- end
- end
- function turnAround()
- turtle.turnLeft()
- turtle.turnLeft()
- end
- function checkForAllFullStacks()
- local full = true
- for slot = 1, slotCount, 1 do
- local count = turtle.getItemCount(slot)
- if count < 64 then full = false end
- end
- return full
- end
- init()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement