I want each slot to store only one item. I referenced this question. Here's my code. How can I modify it to achieve this?
source2.setProperty("Triggers.OnCreation", "Object current = ownerobject(c);\n\
Object item = param(1);\n\
\n\
Map dimensions = current.outObjects[1].getProperty(\"Dimensions\");\n\
int Bay = dimensions.NumBays;\n\
int Level = dimensions.NumLevels;\n\
int Slot = dimensions.SlotsPerBay;\n\
\n\
int i = duniform(1, Bay, 1);\n\
int j = duniform(1, Level, 1);\n\
int k = duniform(1, Slot, 1);\n\
\n\
Storage.Slot slot = current.outObjects[1].as(Storage.Object).getSlot(i, j, k);\n\
if(slot.as(Storage.Slot).slotItems.length < 1) Storage.Item(item).as(Storage.Item).assignedSlot = current.outObjects[1].as(Storage.Object).getSlot(i, j, k);\n\
");
Thanks.