Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require("component")
- stor = component.proxy(component.get("526"))
- items = {
- {label="Lapis Lazuli",max_quantity=300,min_quantity=100,name="dye",damage=4,block_name="lapis_block",block_damage=0,block_size=9},
- {label="Tin Ingot",max_quantity=300,min_quantity=100,name="thermalfoundation:material",damage=129,block_name="thermalfoundation:storage",block_damage=1,block_size=9},
- {label="Coal",max_quantity=500,min_quantity=300,name="coal",damage=0,block_name="coal_block",block_damage=0,block_size=9},
- {label="Redstone",max_quantity=1000,min_quantity=700,name="redstone",damage=0,block_name="redstone_block",block_damage=0,block_size=9},
- {label="Lead Ingot",max_quantity=300,min_quantity=100,name="thermalfoundation:material",damage=131,block_name="thermalfoundation:storage",block_damage=3,block_size=9},
- {label="Silver Ingot",max_quantity=300,min_quantity=100,name="thermalfoundation:material",damage=130,block_name="thermalfoundation:storage",block_damage=2,block_size=9},
- {label="Aluminum Ingot",max_quantity=300,min_quantity=100,name="thermalfoundation:material",damage=132,block_name="thermalfoundation:storage",block_damage=4,block_size=9},
- {label="Iron Ingot",max_quantity=1000,min_quantity=700,name="iron_ingot",damage=0,block_name="iron_block",block_damage=0,block_size=9},
- {label="Copper Ingot",max_quantity=300,min_quantity=100,name="thermalfoundation:material",damage=128,block_name="thermalfoundation:storage",block_damage=0,block_size=9},
- {label="Gold Ingot",max_quantity=300,min_quantity=100,name="gold_ingot",damage=0,block_name="gold_block",block_damage=0,block_size=9}
- }
- for i,item in ipairs(items) do
- stack = {name=item.name,damage=item.damage}
- quantityInStorage = stor.getItem(stack).quantity
- if quantityInStorage > item.max_quantity then
- print(quantityInStorage - item.max_quantity,item.label,"to block")
- if (#stor.getTasks() == 0) then
- if item.block_size = 0 then
- print("Error: Spezify block size for item",item.name)
- else
- toCraft = math.floor((quantityInStorage - item.max_quantity) / item.block_size + 1)
- print("Blocking:",toCraft * 9,item.label)
- stor.scheduleTask({name=item.block_name},toCraft)
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement