The inventory commands are JIP compatible and either have global effect or fully global, there is no need to create public variables with randomisation indexes and waituntil on other units.
Better and faster: http://pastie.org/private/gbzqt1aaslumiov2hf0eaq