Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---- SCRIPT GALACTICRAFT AUTOCRAFT ----
- ---- By Yazzou ----
- local component = require("component")
- local sides = require("sides")
- local ic = component.proxy(component.get("bb78"))
- local function print_table(table)
- if table then
- for k,v in pairs(table) do
- print(k,v)
- end
- else
- print("print_table :", "Table vide")
- end
- end
- local function print_inventory(comp, side)
- if (comp) then
- for i = 1,comp.getInventorySize(side),1 do
- local item = comp.getStackInSlot(side, i)
- if item then
- print("#"..i, item.label, "x "..item.size)
- else
- print("#"..i, "empty")
- end
- end
- else
- print("print_table", "Composant null")
- end
- end
- ---- MAIN PROGRAM ----
- print("Inventaire Nord")
- print_inventory(ic, sides.north)
- print("\nInventaire Ouest")
- print_inventory(ic, sides.west)
- ic.suckFromSlot(sides.west, 1, 1)
- ic.dropIntoSlot(sides.north, 2, 1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement