I have done this multiple times using code, but having brainfart with C2 drag&drop system, any help would be very welcome.
In short:
1) while inventory(0) < inventory.width let loop run trough array from first to final "slot".
2) If currentX equals 0 set string to get what X is first empty, then stop loop all together, no need to touch anything other as I want to get first empty (in this case "0") X location.
Here is my few attempts but they fail, some loop affect all X?s and other just stops after first one, does not run trough all values and then pick first 0.
This is inventory test where I want to put new item automatic to first empty slot available, since its random (maybe first slot is taken, maybe first, second, fourth but not third etc.).
<img src="http://media.rajatila.com/images/failurtpt.jpg" border="0" />