Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local p = peripheral
- local r = p.wrap("left")
- local c = p.wrap("front")
- local t = turtle
- rs.setOutput("top", false)
- function empty()
- for i=1,16 do
- t.select(i)
- t.drop()
- end
- end
- function getItem(name, amount, toSlot)
- for slot, item in pairs(c.getAllStacks()) do
- for a, b in pairs(item) do
- if a == "all" then
- for a2, b2 in pairs(b()) do
- if a2 == "display_name" then
- if string.match(b2, name) then
- if t.getItemCount(toSlot) ~= amount then
- toMove = amount - t.getItemCount(toSlot)
- moved = c.pushItem("WEST", slot, toMove, toSlot)
- if tonumber(moved) ~= tonumber(amount) then
- toMove = amount - t.getItemCount(toSlot)
- getItem(name, amount, toSlot)
- end
- end
- end
- end
- end
- end
- end
- print("]")
- end
- return false
- end
- if true then
- t.digDown()
- empty()
- sleep(1)
- getItem("Seeds", 1, 1)
- sleep(1)
- t.select(1)
- t.placeDown()
- rs.setOutput("top", true)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement