What are you having trouble with, specifically?
Timing is going to be a major factor in a command like that, so you'd want to start out either with very long pauses, or perhaps even a way to step through it manually (E.G. using one of the "Wait For" actions).
It's also going to require having the interface in a known state.
There's also going to be input required to quantify "until all items are sold". Unless that's information a plugin can provide (I.E. if that information is provided through the games' API).