From 4690cb28d8411059fcee052d84518ed3ff0d74d0 Mon Sep 17 00:00:00 2001 From: Tirost <40617243+Tirost@users.noreply.github.com> Date: Tue, 22 Oct 2024 14:46:42 -0700 Subject: [PATCH 1/7] Update base.yaml for healing plants --- profiles/base.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/profiles/base.yaml b/profiles/base.yaml index e6faba2d0e..7d1ce30844 100644 --- a/profiles/base.yaml +++ b/profiles/base.yaml @@ -638,6 +638,9 @@ performance_while_healing: false # use tome.lic while waiting for healing / being healed # assumes you have tome setup properly tome_while_healing: false +# Adjectives and nouns for safe-room healing plants +healing_plant_adjective_regex: "vela'tohr|swaying" +healing_plant_noun_regex: "briar|bush|plant|shrub|thicket|thornbush" # override the repair location to use instead of hometown force_repair_town: From 81ed2519a1b47bd157b4087365d8884dfca9530f Mon Sep 17 00:00:00 2001 From: Tirost <40617243+Tirost@users.noreply.github.com> Date: Tue, 22 Oct 2024 14:50:22 -0700 Subject: [PATCH 2/7] Update safe-room.lic to allow altered healing plants --- safe-room.lic | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/safe-room.lic b/safe-room.lic index 817b480f9c..c198e8fd8a 100644 --- a/safe-room.lic +++ b/safe-room.lic @@ -15,6 +15,8 @@ class SafeRoom args = parse_args(arg_definitions) settings = get_settings + @plant_adjectives = settings['healing_plant_adjective_regex'] + @plant_nouns = settings['healing_plant_noun_regex'] @health_threshold = settings.saferoom_health_threshold @withdraw_amount = settings.safe_room_withdraw_amount @keep_bank_amount = settings.safe_room_keep_bank_amount @@ -22,8 +24,7 @@ class SafeRoom @stop_performance_after_heal = false @tome_while_healing = settings.tome_while_healing @stop_tome_after_heal = false - - @plant_regex = /vela'tohr (briar|bush|plant|shrub|thicket|thornbush)/ + @plant_regex = /(?:#{@plant_adjectives}) (\w+)/ return unless args.force || need_healing? @@ -210,8 +211,9 @@ class SafeRoom DRC.release_invisibility - if /.*vela.tohr (\w+)/ =~ DRRoom.room_objs.grep(@plant_regex).to_s - fput("touch #{Regexp.last_match(1)}") + if /#{@plant_adjectives} (\w+)/ =~ DRRoom.room_objs.grep(@plant_regex).to_s + plant_type = Regexp.last_match(1) + fput("touch #{plant_type}") end # check for safe-room idle thing to do From cedce888beecf62d4f0b1102c608b38b4e054d0d Mon Sep 17 00:00:00 2001 From: Tirost <40617243+Tirost@users.noreply.github.com> Date: Wed, 30 Oct 2024 06:57:46 -0700 Subject: [PATCH 3/7] Update base-empty.yaml for healing plants --- profiles/base-empty.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/profiles/base-empty.yaml b/profiles/base-empty.yaml index e2005ac69b..c42097853d 100644 --- a/profiles/base-empty.yaml +++ b/profiles/base-empty.yaml @@ -130,3 +130,5 @@ empty_values: zombie: {} script_watch_ignored_scripts: [] custom_clerk_tools: {} + healing_plant_adjectives: [] + healing_plant_nouns: [] From a19c4c76afbffc6bf4936e458c7b67aff2f59d43 Mon Sep 17 00:00:00 2001 From: Tirost <40617243+Tirost@users.noreply.github.com> Date: Wed, 30 Oct 2024 07:12:05 -0700 Subject: [PATCH 4/7] Update safe-room.lic for custom healing plants --- safe-room.lic | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/safe-room.lic b/safe-room.lic index c198e8fd8a..1468eb3435 100644 --- a/safe-room.lic +++ b/safe-room.lic @@ -24,7 +24,11 @@ class SafeRoom @stop_performance_after_heal = false @tome_while_healing = settings.tome_while_healing @stop_tome_after_heal = false - @plant_regex = /(?:#{@plant_adjectives}) (\w+)/ + @plant_adjectives = settings.healing_plant_adjectives + @plant_nouns = settings.healing_plant_nouns + @adjectives_regex = Regexp.union(settings.healing_plant_adjectives) + @noun_regex = Regexp.union(settings.healing_plant_nouns) + @plant_regex = Regexp.new("#{@adjectives_regex} #{@noun_regex}") return unless args.force || need_healing? @@ -211,9 +215,10 @@ class SafeRoom DRC.release_invisibility - if /#{@plant_adjectives} (\w+)/ =~ DRRoom.room_objs.grep(@plant_regex).to_s - plant_type = Regexp.last_match(1) - fput("touch #{plant_type}") + # Match room objects against the full regex to find and capture the noun + if DRRoom.room_objs.grep(@plant_regex).to_s =~ @plant_regex + plant_type = Regexp.last_match(1) # Captures the noun (e.g., "plant", "bush") + fput("touch #{plant_type}") # Sends command to touch the specific noun end # check for safe-room idle thing to do From 83128576a6f49cfd2fdfeff3b4613eab66413ff7 Mon Sep 17 00:00:00 2001 From: Tirost <40617243+Tirost@users.noreply.github.com> Date: Wed, 30 Oct 2024 07:17:04 -0700 Subject: [PATCH 5/7] Update base.yaml for custom healing plants --- profiles/base.yaml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/profiles/base.yaml b/profiles/base.yaml index 1811c76d99..9efc9eaf6d 100644 --- a/profiles/base.yaml +++ b/profiles/base.yaml @@ -639,8 +639,17 @@ performance_while_healing: false # assumes you have tome setup properly tome_while_healing: false # Adjectives and nouns for safe-room healing plants -healing_plant_adjective_regex: "vela'tohr|swaying" -healing_plant_noun_regex: "briar|bush|plant|shrub|thicket|thornbush" +healing_plant_adjectives: + - vela'tohr + - swaying + +healing_plant_nouns: + - briar + - bush + - plant + - shrub + - thicket + - thornbush # override the repair location to use instead of hometown force_repair_town: From 6c62ccdf41f31f4d48dfc35839d86e7ea9be24d8 Mon Sep 17 00:00:00 2001 From: Tirost <40617243+Tirost@users.noreply.github.com> Date: Wed, 30 Oct 2024 10:19:03 -0700 Subject: [PATCH 6/7] Update safe-room.lic --- safe-room.lic | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/safe-room.lic b/safe-room.lic index 1468eb3435..eaf7e34145 100644 --- a/safe-room.lic +++ b/safe-room.lic @@ -216,9 +216,11 @@ class SafeRoom DRC.release_invisibility # Match room objects against the full regex to find and capture the noun - if DRRoom.room_objs.grep(@plant_regex).to_s =~ @plant_regex - plant_type = Regexp.last_match(1) # Captures the noun (e.g., "plant", "bush") - fput("touch #{plant_type}") # Sends command to touch the specific noun + if /#{@adjectives_regex} (\w+)/ =~ DRRoom.room_objs.grep(@plant_regex).to_s + plant_type = Regexp.last_match(1) + + # Send touch command for the captured noun + fput("touch #{plant_type}") if @plant_nouns.include?(plant_type) end # check for safe-room idle thing to do From 8f205bc5e5c9f880d21b09f270473ccd906e7b36 Mon Sep 17 00:00:00 2001 From: Tirost <40617243+Tirost@users.noreply.github.com> Date: Wed, 30 Oct 2024 13:56:41 -0700 Subject: [PATCH 7/7] Update safe-room.lic Co-authored-by: Mahtra <93822896+MahtraDR@users.noreply.github.com> --- safe-room.lic | 2 -- 1 file changed, 2 deletions(-) diff --git a/safe-room.lic b/safe-room.lic index eaf7e34145..cfac5e019f 100644 --- a/safe-room.lic +++ b/safe-room.lic @@ -15,8 +15,6 @@ class SafeRoom args = parse_args(arg_definitions) settings = get_settings - @plant_adjectives = settings['healing_plant_adjective_regex'] - @plant_nouns = settings['healing_plant_noun_regex'] @health_threshold = settings.saferoom_health_threshold @withdraw_amount = settings.safe_room_withdraw_amount @keep_bank_amount = settings.safe_room_keep_bank_amount