rpherbig / dr-scripts

A series of Lich 5 (https://github.com/elanthia-online/lich-5) scripts for use with DragonRealms (http://www.play.net/dr/). Donations are welcome (http://www.paypal.me/rcuhljr)!
GNU General Public License v2.0
52 stars 177 forks source link

Sew.lic - breaks when holding too little material #3839

Closed dakre18 closed 1 year ago

dakre18 commented 5 years ago

I am making a Charm Bag for a work order (sewing/tailoring). Occasionally i'm left with 2 yards of material from an older work order, and that causes the script to get stuck in an infinite loop. I usually have another 20 yards of cloth in my pack, but it doesn't combine the 2 stacks and doesn't attempt to check if i have more cloth.

I've only had this problem after starting Charm Bags, but it comes up often as it leaves leftover cloth.

Note: i removed extra lines, except from the match error. I can duplicate the issue if needed.


[sew]>turn my book to page 18 You turn your book to page 18, instructions for crafting a cloth charm bag.

[sew]>study my book You scan the charm bag instructions with a glance and completely understand all facets of the design. You now feel ready to begin the crafting process. Roundtime: 8 sec.

[sew]>put my book in my pack You put your book in your hunting pack.

[sew]>get my burlap cloth You get some burlap cloth from inside your ebony carryall.

[sew]>untie my scissors from my tailor toolbelt You untie some scissors with glaes cutting edges and decorative finger rings from the straps of your tailor's toolbelt.

[sew]>cut my burlap cloth with my scissors You need a larger amount of material to continue crafting.

[sew: *** No match was found after 15 seconds, dumping info] [sew: messages seen length: 5] [sew: message: Grounding Field (1 roisan)] [sew: message: You feel fully prepared to cast your spell.] [sew: message: [DRPrime]-DR:Rholav: "DAmn power keeps flickerin"] [sew: message: Grounding Field (1 roisan)] [sew: message: You need a larger amount of material to continue crafting.] [sew: checked against [/dimensions appear to have shifted and could benefit from some remeasuring/i, /With the measuring complete, now it is time to cut away more/i, /and could use some pins to/i, /deep crease develops along/i, /wrinkles from all the handling and could use/i, /The needles need to have thread put on them before they can be used for sewing/i, /needs holes punched/i, /requires some holes punched/i, /You realize that cannot be repaired/i, /not damaged enough to warrant repair/i, /You cannot figure out how to do that/i, /appears ready to be reinforced with some large cloth padding/i, /New seams must now be sewn to properly fit the lightened material together/i, /Roundtime/i]] [sew: for command cut my burlap cloth with my scissors]

[sew]>tie my scissors to my tailor toolbelt You attach some scissors with glaes cutting edges and decorative finger rings to a strap on your tailor's toolbelt.

[sew]>stow my burlap cloth You put your cloth in your ebony carryall.

[sew]>untie my scissors from my tailor toolbelt You untie some scissors with glaes cutting edges and decorative finger rings from the straps of your tailor's toolbelt.

[sew]>push my bag with my needles You must be holding the watersilk bag to do that.

[sew: ** No match was found after 15 seconds, dumping info] [sew: messages seen length: 4] [sew: message: Rhorgul was just struck down! ] [sew: message: The black lotus blossoms of your morgawr bone armband flare with radiance, a sense of peace and restfulness spreading through you to ease your mental fatigue.] [sew: message: Grounding Field (1 roisan)] [sew: message: You must be holding the watersilk bag to do that.] [sew: checked against [/dimensions appear to have shifted and could benefit from some remeasuring/i, /With the measuring complete, now it is time to cut away more/i, /and could use some pins to/i, /deep crease develops along/i, /wrinkles from all the handling and could use/i, /The needles need to have thread put on them before they can be used for sewing/i, /needs holes punched/i, /requires some holes punched/i, /You realize that cannot be repaired/i, /not damaged enough to warrant repair/i, /You cannot figure out how to do that/i, /appears ready to be reinforced with some large cloth padding/i, /New seams must now be sewn to properly fit the lightened material together/i, /Roundtime/i]] [sew: for command push my bag with my needles]

Sarvatt commented 5 years ago

so this probably happens on every cloth recipe that has a volume that isn't divisible by 5, it may be worth turning all of those off for workorders for now until it gets fixed.

Sarvatt commented 5 years ago

Hmm or just have workorders trash all cloth between each craft before buying more. sew handles >5 volumes fine.

Sarvatt commented 5 years ago

Sew cant handle You need a larger amount of material to continue crafting. because it doesn't do the purchasing and workorders has already passed off control to sew.lic at that point.

dakre18 commented 5 years ago

I would be fine if it trashed the leftover cloth at the end. Otherwise it just builds up until i have to dump it or use it.

GreyhallowDR commented 4 years ago

I'm starting to run into this issue more frequently. I think every time i've encountered it, there was extra cloth in my container. If the script could at least check and combine if it finds some then that would certainly make it more robust if not fix the problem entirely. I'm guessing the extra cloth is because WO purchases enough for the total number of items, so it may just break on the last item when you really are short on cloth.

I know it's not feasible for sew to go grab more because it's meant to be a standalone script. Could it be possible to have a restock option in yaml or arguments?

[sew]>get my scissors

You get some steel serrated scissors from inside your haversack.

[sew]>cut my burlap cloth with my scissors

You need a larger amount of material to continue crafting.

[sew: *** No match was found after 15 seconds, dumping info]

GreyhallowDR commented 4 years ago

or do we need to back up and prevent the problem earlier in WO? I'm not sure what the actual root is, but it seems like it would only be happening if WO didn't buy enough material to begin with.

Tarhish commented 4 years ago

Yeah, it shouldn't be doing this, but I don't see it happen on my end. What does it do when it's buying and counting the cloth at the 'start workorder' stage?

GreyhallowDR commented 4 years ago

I see what happened in my case. In reviewing logs, almanac kicked in while wo was purchasing the material. Almanac "stows left" but does not get the material back out. My default stow container is not the container I have set for crafting. So the first 3 bolts that wo purchased were put out of reach by almanac. So not technically a problem with sew or wo, but I wonder if almanac can be updated to put what it stowed back in your left hand before it unpauses everything else to continue.

AND/OR does it make sense to make sew more robust but searching elsewhere for the material? GET MY burlap cloth if it doesn't find any in the crafting container?

GreyhallowDR commented 4 years ago

here is a log showing how almanac lost the cloth https://pastebin.com/58MnRxyE

I've added workorder to my almanac no use list.

That could be messing up a lot of other scripts couldn't it? Would probably allow the list of scripts in the almanac_no_use_scripts to be shorter. Considering how long crafting takes, it would significantly increase the frequency of almanac use if using during crafting was an option.

dakre18 commented 4 years ago

My suggestion would be to add a catch for that specific message, then stows the scissors, get more material from the pack, combine it, get the scissors, and try to cut the cloth again. That would handle multiple cases where somehow you pull out too little cloth, but there's more in your bag.

edit: another option is to count the material before getting the scissors (to start the process), and if there's too little material it tries to get more and combine it.

Tarhish commented 4 years ago

I'm going to try and nip this in the bud from all the points of failure, though some of them may take a bit. There's a change I've submitted to make it so almanac won't displace/drop other items, I'm testing a change to the function that orders items, and probably changing something in workorders later down the line.

MahtraDR commented 1 year ago

@Raykyn55 Is this a thing today still? Or can we close this?

Raykyn55 commented 1 year ago

@Raykyn55 Is this a thing today still? Or can we close this?

Well, sew will still break if you don't bring enough cloth, but workorders provides the right amount now.

MahtraDR commented 1 year ago

@Raykyn55 Is this a thing today still? Or can we close this?

Well, sew will still break if you don't bring enough cloth, but workorders provides the right amount now.

Thank you. Closing as completed.