ScriptUO

Official ScriptUO EasyUO Scripts => Script Debug => Topic started by: Crisis on November 29, 2015, 06:05:27 PM

Title: Need help with crafting issue, possibly menu related
Post by: Crisis on November 29, 2015, 06:05:27 PM
I am working on an all-in-one inscription script. I have it all set to make a spellbook, craft the scrolls, and fill it to complete the spellbook and I am currently working on bulk individual scrolls so people can make mass amounts of a single scroll. This is where I am getting stuck. It is the same for magery, myst, and necro. If you choose any one of the first 5 spells, it will make the correct amount, restock all of the supplies like it is supposed to but then it starts crafting the next spell which it will go on indefinitely if you don't stop the script and who needs thousands of the first 5 spells? I only have the first 10 magery spells, then 32, 52, and 64 for magery ready to be crafted. All of necro and myst are in already. I need to figure this out before adding the remainder of the magery spells.

I am sure that it is something simple that I am overlooking, I just don't understand why it only happens with the first 5 spells. Any insight will greatly slow my loss of sanity.

Please remember that this is only in it's alpha stage and no where near complete or done.

Thanks to TM for his meditate sub and manwinc for his crafting sub!
Title: Re: Need help with crafting issue, possibly menu related
Post by: 12TimesOver on November 30, 2015, 08:03:32 AM
I'm just taking a quick glance right now but it's pretty tough to dig with so much going on.

I think, for starters, you would be better served to clean things up a bit - maybe simplify a lot of the logic to shrink the script. For example, you definitely don't need that many subs; simple things like even just calling MWCraft directly at each location you are calling MakeXScroll### could help. Those extra subs aren't necessary and are just going to make it tougher to manage and troubleshoot script flow IMO. This is probably not the issue you're asking about but cleaner code makes those issues easier to troubleshoot.

So instead of:
Code: [Select]
    gosub Makescroll47
...
sub Makescroll47
    gosub MWCraft Scribe N/A 3 2 5
    wait 10
    Return

Why not just do:
Code: [Select]
gosub MWCraft Scribe N/A 3 2 5