You have to be careful with the script flow. You should organize your subs better.
Regarding the flow of the script as it is right now:
In line 3
Gosub setup
This will take you to line 112 which is the setup sub
Then it will start executing each line in a sequence inside that sub.
When it gets to line 137
gosub mainmenu
It will jump back to line 6 which is the MainMenu sub. This will start drawing your menu, and will wait for the user input.
Ok, now let's say I chose Potash from the menu and hit start. The following will happen:
The %item var will be set to Potash
Then, on line 72
choosesitem %item
What's this supposed to do? I don't know what this line means!

But okay, getting past that, on line 73 you will get a 'return'
This is going to take you back to where this sub was first called.
So you will be back on line 137, and the script is going to find another return on line 139 which will bring you back to line 4. Lines 4 and 5 are comments, so we'll be on line
Since line 6 is the entry point to the MainMenu sub, it will skip that whole code sub and jump again to line 74
Ok, so now we have
if %item = Potash
gosub MakePotash
so this will take you to the MakePotash sub
It's really confusing the way this is written, and it can lead to simple mistakes being overlooked. I would suggest you try and rewrite it with a little bit more organization, that would make things a lot simpler for you.
Well, anyways, that's just me babbling.
Now to your problem specifically.
I don't have a character to try that out with, but from reading the code it seems that this is where it's going wrong:
On line 106, you have
until #charghost = yes
To use "until something", you should have written a repeat in there somewhere to actually repeat the code that's between those lines. Something like this:
repeat
;code
;code
;code
until #charghost = yes
I suppose you meant to have it repeat the code starting from "if %item = Potash" until that part, so you should add the "repeat" line just above line 74. The code would look like this, for that part:
repeat
if %item = Potash
{
gosub MakePotash
}
if %Item = BlkPwdr
{
gosub MakeBlackPowder
}
if %item = LtPwdrChg
{
gosub LightPowderCharge
}
if %item = HvyPwdrChg
{
gosub HeavyPowderCharge
}
if %Item = LtGrpSht
{
gosub LightGrapeShot
}
if %Item = LtCanBall
{
gosub LightCannonBall
}
if %Item = HvyGrpSht
{
gosub HeavyGrapeShot
}
if %Item = HvyCanBall
{
gosub HeavyCannonBall
}
until #charghost = yes
I hope this is somewhat clear, and able to help you out a little bit.
Let me know if you have questions, or if this doesn't solve your problem specifically.
[]s