refactor(dr): workorders.lic comprehensive refactor#1
Closed
Conversation
Bug fixes: - Fix NPC walking away during turn-in not handled (add "What is it you're trying to give" pattern to retry loop) - find_npc now returns boolean and verifies NPC presence after walking Code improvements: - Add frozen_string_literal: true - Extract 15 frozen pattern constants (GIVE_LOGBOOK_*, REPAIR_*, BUNDLE_*, WORK_ORDER_*, READ_LOGBOOK_*, COUNT_*, TAP_HERB_*, MATERIAL_NOUNS) - Replace all Regexp.last_match with named captures (WORK_ORDER_ITEM_PATTERN, LOGBOOK_REMAINING_PATTERN, POLISH_COUNT_PATTERN, TAP_HERB_PATTERN, HERB_COUNT_PATTERN, REMEDY_COUNT_PATTERN) - Replace all echo/DRC.message with Lich::Messaging.msg and WorkOrders: prefix - Add verbose messaging on all exit paths - Nil-safe iteration with &. operator in buy_parts/order_parts - Remove unused reget call in enchanting_items Testing: - Add 41 comprehensive specs covering constants, find_npc, complete_work_order, bundle_item, find_recipe, repair_items, buy_parts, order_parts, and pattern matching Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Comprehensive refactor of
workorders.licfollowing established refactoring patterns. Fixes NPC walking away bug and adds robust error handling.Bug Fixes
"What is it you're trying to give"pattern to retry loop. When NPC wanders off mid-interaction, script now finds them again instead of timing out.find_npcdoesn't verify NPC presence — now returns boolean and confirms NPC is in room after walkingCode Improvements
frozen_string_literal: trueRegexp.last_matchwith named capturesecho/DRC.messagewithLich::Messaging.msgandWorkOrders:prefix&.eachinbuy_parts/order_partsregetcall inenchanting_itemsTest plan
🤖 Generated with Claude Code