dr-scripts
dr-scripts copied to clipboard
workorders - new enchant functionality problem with 'rods'
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
This is expected I think. You need to keep your tools in a different container.
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
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.
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.
@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.
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.
Perhaps your base-crafting
file is not updated? You should have
rod:
Crossing:
part-room: 14753
part-number:
somewhere around line 2206.
Right, but that's not what you're looking up. The part you are passing to base-crafting is bobcat rod, not rod.
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.
Any luck with this testing? If you need me to check anything out, let me know!
If you could test as well that would help. I have not had anything not work with these new settings.
I tested using the most recent change and everything seems good!
I will work on putting the PR in over the next couple of days.
Hey, Dart, any chance you can put that PR in when you get a second?
I also ran into this problem. Log: https://pastebin.com/fCPrGTfj If there's a fix, I can help test.