Hey, itamaram, that script you posted was wrong, and dangerously so.
The buy command goes buy (quantity, item), and the create and use commands are inside the for loop. I was fidding around with getting buy to work (without reading the directions), and I very nearly bought 1800 of item 1...