View difference between Paste ID: yiWG9JsP and EuQTppRd
SHOW: | | - or go back to the newest paste.
1
local Slot_Count = 16
2
local width, depth, height = 10, 10, 2
3
4
DROPPED_ITEMS = {
5
    "minecraft:stone",
6
    "minecraft:dirt",
7
    "minecraft:cobblestone",
8
    "minecraft:sand",
9
    "minecraft:gravel",
10
    "minecraft:flint",
11
    "minecraft:dye",
12
    "forestry:apatite"
13
}
14
15
16
function Drop_Items()
17
  print("Droping trash...")
18
  for SlotNum = 1, Slot_Count, 1 do
19
    local Item = turtle.getItemDetail(SlotNum)
20
    if(Item ~= nil) then
21
      for FilterIndex = 1, #DROPPED_ITEMS, 1 do
22
        if(Item["name"] == DROPPED_ITEMS[FilterIndex]) then
23
            print("Droppign - " .. Item["name"])
24
            turtle.select(SlotNum)
25
            turtle.dropDown()
26
          end
27
        end
28
      end
29
    end
30
  end
31
  
32
  
33
function GetEnderIndex()
34
  for SlotNum = 1, Slot_Count, 1 do
35
    local Item = turtle.getItemDetail(SlotNum)
36
    if(Item ~=nil) then
37
      if(Item["name"] == "enderstorage:ender_storage") then
38
        return SlotNum
39
      end
40
    end
41
  end
42
end
43
44
45
function manageInventory()
46
  Drop_Items()
47
  Index = GetEnderIndex()
48
  if(Index ~= nil) then
49
    turtle.select(Index)
50
    turtle.digUp()
51
    turtle.placeUp()
52
  end
53
  -- ender chest deployed
54
  for SlotNum = 1, Slot_Count, 1 do
55
    local Item = turtle.getItemDetail(SlotNum)
56
    if(Item ~=nil) then
57
      if(Item["name"] ~= "minecraft:coal_block" and Item["name"] ~= "minecraft:coal") then
58
        turtle.select(SlotNum)
59
        turtle.dropUp()
60
      end
61
    end
62
  end 
63
-- Items are stored
64
turtle.digUp()
65
end
66
67
68
manageInventory()