dr-scripts icon indicating copy to clipboard operation
dr-scripts copied to clipboard

workorders - new enchant functionality problem with 'rods'

Open mikejcook opened this issue 2 years ago • 15 comments

I ran into an issue where the new functionality got stuck on a rod. Recipe was for 2 a cambrinth retuners. As you can see below, because the imbuement rod (enchanting tool) was in the backpack, it only bought 1 bobcat rod, so the script eventually hung. @Dartellum

[workorders]>rummage /C rod in my backpack
You rummage through a rugged backpack looking for something similar to "rod" and see an imbuement rod.
<pushBold/>need_part with potiental plus 1 is 1.<popBold/>
[workorders]>buy bobcat rod
You decide to purchase the rod, and pay the sales clerk 312 Kronars.
The sales clerk hands you your bobcat rod.
[workorders]>put my bobcat rod in my backpack
You put your rod in your backpack.
[workorders]>tap my fount

mikejcook avatar Dec 15 '22 05:12 mikejcook

This is expected I think. You need to keep your tools in a different container.

MahtraDR avatar Dec 15 '22 05:12 MahtraDR

Negative. Clerk-tools and workorders put your tools in crafting_container, which is also what the new code checks.

problematic code:

@bag = @settings.crafting_container

    # Parts #
    tmp_part_count = 0
    need_part = 0
    if recipe['part']
      for p in recipe['part']
        p.to_s 
        tmp_part_count = DRCI.count_items_in_container(p.split.last, @bag)

clerk-tools.lic

@bag = settings.crafting_container

  def get_tools(tools, roomnumber, repairnpc)
    DRCT.walk_to(roomnumber)
    tools.each do |tool|
      case DRC.bput("ask #{repairnpc} for #{tool}", 'Ah, yes, we have one of your tools like that', 'Ah, yes, we have several of your tools like that', "It doesn't look like we have anything like that")
      when 'Ah, yes, we have one of your tools like that'
        DRCC.stow_crafting_item(tool, @bag, @belt)
      when 'Ah, yes, we have several of your tools like that'
        # #Sack
      end
    end
  end

mikejcook avatar Dec 15 '22 05:12 mikejcook

I don't know what the solution would be. Adding a new parts bag? But that sounds terrible.

Honest question: what problem is this change trying to solve? The sigils make sense, since you can farm your own, but can you get your own parts? I'm not aware of a reason you would have existing parts in your bag already.

mikejcook avatar Dec 15 '22 05:12 mikejcook

Honest question: what problem is this change trying to solve? The sigils make sense, since you can farm your own, but can you get your own parts? I'm not aware of a reason you would have existing parts in your bag already.

You may have the parts if you failed a workorder before due to whatever reason; disconnection, not good enough quality to bundle so the script exits, etc.

I did not run into this because I have a belt. Let me think on it. Rummage only uses the noun. I could add a check for that in the logic. I will work on this. I do have a char I can test on that does not have a belt.

Dartellum avatar Dec 15 '22 11:12 Dartellum

@mikejcook

Change line 845 from need_part += 1 if reget(3, "but there is nothing in there like that") && (need_part + tmp_part_count) != quantity to need_part += 1 if reget(3, "but there is nothing in there like that" || reget(3, /see (a|an)(.*) rod/) && (need_part + tmp_part_count) != quantity

My rod is a fey-bone rod thus the qualifier in the logic.

If this works for you, I will put in a PR.

Dartellum avatar Dec 15 '22 15:12 Dartellum

Interesting. It seemed to work (you are missing a closing ) on your first reget in what you copied to me), but I ran into another issue. It looks like if all you need is parts, it doesn't take you to the proper room?

[workorders]>ask Trainer for challenging artificing work
Trainer shuffles through some notes and says, "Alright, this is an order for a cambrinth retuner. I need 3 of superior quality, made from any material and due in 95 roisaen.  Please complete the items, bundle them with your logbook and then give me the logbook to complete this order.  Good luck!"

You seem to recall this item being somewhere in chapter 2 of the instruction book.
>
[workorders]>put my logbook in my backpack
You put your logbook in your backpack.
>
[workorders]>wealth kronars
  1 platinum, 9 gold, 8 silver, 18 bronze, and 20 copper Kronars (20,000 copper Kronars).
>
[workorders]>rummage /C sigil-scroll in my backpack
You rummage through a rugged backpack looking for something similar to "sigil-scroll" and see an intricate congruence sigil-scroll comprised of broad strokes, an intricate congruence sigil-scroll comprised of broad strokes and an intricate congruence sigil-scroll comprised of broad strokes.
>
[workorders]>rummage /C rod in my backpack
You rummage through a rugged backpack looking for something similar to "rod" and see a basalt bobcat rod and an imbuement rod.
>
need_part with potiental plus 1 is 1.
[workorders: ]
[workorders: bobcat rod]
[workorders]>buy bobcat rod
That bobcat rod is not for sale.
>;k work
      echo data['part-room']
      echo part
      DRCT.buy_item(data['part-room'], part)

I added the two echos. Looks like part-room is empty.

mikejcook avatar Dec 15 '22 20:12 mikejcook

Perhaps your base-crafting file is not updated? You should have

rod:
    Crossing:
      part-room: 14753
      part-number:

somewhere around line 2206.

Dartellum avatar Dec 15 '22 21:12 Dartellum

Right, but that's not what you're looking up. The part you are passing to base-crafting is bobcat rod, not rod.

mikejcook avatar Dec 15 '22 21:12 mikejcook

I will need to see if this breaks anything else: order_parts(p.split.last, need_part).

Edit: since the parts are listed as the nouns in base-crafting this will work. I will do some more testing.

Dartellum avatar Dec 15 '22 21:12 Dartellum

Any luck with this testing? If you need me to check anything out, let me know!

mikejcook avatar Dec 24 '22 02:12 mikejcook

If you could test as well that would help. I have not had anything not work with these new settings.

Dartellum avatar Dec 24 '22 14:12 Dartellum

I tested using the most recent change and everything seems good!

mikejcook avatar Jan 10 '23 02:01 mikejcook

I will work on putting the PR in over the next couple of days.

Dartellum avatar Jan 10 '23 02:01 Dartellum

Hey, Dart, any chance you can put that PR in when you get a second?

mikejcook avatar Jan 31 '23 04:01 mikejcook

I also ran into this problem. Log: https://pastebin.com/fCPrGTfj If there's a fix, I can help test.

Donntae avatar Mar 12 '23 14:03 Donntae