Have you configured the .lua file before starting the script? It is supposed to withdraw 1k gold, make sure you have that much in bank. If you want it to withdraw more to buy more potions, you'll have to change it in the .xbst file.
Line 188
<item text="Withdraw Gold(1,000)" tag="249"/>