From 306839b026e3022287906772407a7b45f97f2fdf Mon Sep 17 00:00:00 2001 From: "Skyfire.Reapp" Date: Sat, 19 Nov 2022 12:58:45 -0500 Subject: [PATCH] Allow mob aliases, parse rune command --- WhatRune.cs | 58 ++++++++++++++++++++++++++---------- bin/Release/ActWhatRune.dll | Bin 14848 -> 15360 bytes runes.txt | 54 ++++++++++++++++----------------- 3 files changed, 69 insertions(+), 43 deletions(-) diff --git a/WhatRune.cs b/WhatRune.cs index 8d77b02..68f23f1 100644 --- a/WhatRune.cs +++ b/WhatRune.cs @@ -31,6 +31,8 @@ public class WhatRune : IActPluginV1 public static string CONSIDER_TOKEN = "You consider"; public static Regex REGEX_CONSIDER = new Regex(@"^(\\#[ABCDEF0-9]{6})?" + CONSIDER_TOKEN); + public static string RUNE_TOKEN = "'rune "; + public static Regex REGEX_RUNE = new Regex(@"^Unknown command: " + RUNE_TOKEN); private WhatRuneSettings _settings = null; private TabPage _pluginScreenSpace = null; @@ -230,9 +232,11 @@ private async Task FetchRuneDefs() string[] defParts = line.Split(new char[] { '=' }, StringSplitOptions.RemoveEmptyEntries); if (defParts.Length > 0) { - string mobName = defParts[0].Trim(); + // The part of the string on the left of "=" can be a comma separated list of aliases, + // or in multi-name encounters the complete set of mob names + string[] mobNames = defParts[0].Trim().Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries); - string rune = "No rune"; + string rune = "No specific rune"; if (defParts.Length >= 2) { // Let's make this part future-proof. We'll separate info bits using a token: ";" @@ -247,9 +251,13 @@ private async Task FetchRuneDefs() } // If we get duplicate mobs, only add the first one - if (!Runes.ContainsKey(mobName)) + foreach (string mobName in mobNames) { - Runes.TryAdd(mobName, rune); + string key = mobName.ToLower(); + if (!Runes.ContainsKey(key)) + { + Runes.TryAdd(key, rune); + } } } } @@ -320,32 +328,52 @@ private void oFormActMain_OnLogLineRead(bool isImport, LogLineEventArgs logInfo) { // Scan for consider messages, eg: // \#FFFF40You consider High Shikari Olyxa... It looks tough -and it's a LOT tougher than it looks. Better have a lot of backup for this one! + // or, /rune MobName + // Unknown command: 'rune Mayong' try { + string mobName = null; + string logLine = logInfo.logLine; int startPos = logLine.IndexOf("]"); if (startPos >= 0) { logLine = logLine.Substring(startPos + 2); + if (REGEX_CONSIDER.IsMatch(logLine)) { startPos = logLine.IndexOf(CONSIDER_TOKEN) + CONSIDER_TOKEN.Length + 1; int endPos = logLine.IndexOf("...", startPos); if (endPos >= 0) { - string mobName = logLine.Substring(startPos, (endPos - startPos)); - Log("Considering " + mobName); - string runeInfo = "Unknown rune"; - if (Runes.ContainsKey(mobName)) - { - runeInfo = Runes[mobName]; - } - Log(" " + runeInfo); - ActGlobals.oFormActMain.TTS(runeInfo); - WriteMacroFile(runeInfo); - ShowLog(); + mobName = logLine.Substring(startPos, (endPos - startPos)); } } + else if (REGEX_RUNE.IsMatch(logLine)) + { + startPos = logLine.IndexOf(RUNE_TOKEN) + RUNE_TOKEN.Length; + int endPos = logLine.LastIndexOf("'"); + if (endPos >= 0) + { + mobName = logLine.Substring(startPos, (endPos - startPos)); + } + } + } + + if (!string.IsNullOrEmpty(mobName)) + { + Log("Considering " + mobName); + string runeInfo = "Unknown rune"; + + string key = mobName.ToLower(); + if (Runes.ContainsKey(key)) + { + runeInfo = Runes[key]; + } + Log(" " + runeInfo); + ActGlobals.oFormActMain.TTS(runeInfo); + WriteMacroFile(runeInfo); + ShowLog(); } } catch { } // Black hole... diff --git a/bin/Release/ActWhatRune.dll b/bin/Release/ActWhatRune.dll index 240184fbecd025f77779ba96775f6559a77c9e0e..b357781d02b183a78154fd9afd240ac5d72d391e 100644 GIT binary patch delta 5175 zcmZWs3wTx4m0o+FbI<$U+>@K!ynrMGlA9Ng1Ps9-k1+z3f(Zn{Vj%*B2;sm@6k{GY zkpkiajc0ttL5syw#44ChN7@;!pr4;we9hRRBhgH23sV?|(Q$OFVg9}E1+{bYoqw;j z_F8N2_1OEI^tSija_{Y9b7sGAhEl(eXl#MaCJ{}6KuZc68~dMJ8oJOxv`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{ z4E#W?Sl$i&v=kHMuvO+t-pXXOP8F?{y#*_+)vrK;e#}go&@I8 z-+@D^K^uYpIaT@y3e$LC9?b$4(mY@(wE!z=BXAu33HTc&KL0#d%g&k~6oX+>{VR2gGo5Q7IGrtS?fx^jjJ?*6fl*`U$SFmO5c6JYY zlWDx&dp&26R?a7QhjYS-eYlwLmj3Z`C$DCb(QuD4%2f1bJ`NY%FYOwQU(1s3-k-Ef2Di`*)6bYZt(K5i_t*>W){%Wmf;m{RY z&wqw*e&bxs<0KjovIrnR-2* zx;i|gy)~6X(z7@9%s&0fQ_kDAuX%p{4M#5b_Eb*H=!O1=&nJ@3?<$D!eRVy>Rg+jx T@Z|3_{_V(~&?$#l*GS`kvy)a5 diff --git a/runes.txt b/runes.txt index 88dd1be..999f61d 100644 --- a/runes.txt +++ b/runes.txt @@ -24,43 +24,41 @@ The Reanimated Horror= Lithania Dyrmelia= # Forlorn Gist: Akashic Incursion -Flora Maldehyde=Stifle rune -Beulus the Claw=Stun rune -Odelia Wretch=Fear rune -Sister Belladonna= -Auntie Grimm= +Flora Maldehyde,Flora=Stifle rune +Beulus the Claw,Beulus=Stun rune +Odelia Wretch,Odelia=Fear rune +Sister Belladonna,Sister,Auntie Grimm,Auntie= Cloaked Necromancer= -Mother Ballentree= -Grandmother Deliria= +Mother Ballentree,Mother= +Grandmother Deliria,Grandmother= # Castle Vacrul: Thirst for Power -Lady of the Lute=Stifle rune -Legion Captain Bloodrite= -Gidget= -The Bloodtender= -Lysander Mistmoore= -Vorigan Mistmoore= +Lady of the Lute,Lady=Stifle rune +Legion Captain Bloodrite,Bloodrite,Captain= +Gidget,The Bloodtender,Bloodtender= +Lysander Mistmoore,Lysander= +Vorigan Mistmoore,Vorigan= # Castle Vacrul: Haunting Presence -The Butcher of Vacrul= -Zarrakon= -Lenya Thex= -Poppet the Thrasher= -Lord Mayong Mistmoore=Stifle rune +The Butcher of Vacrul,Butcher= +Zarrakon,Zarakon= +Lenya Thex,Lenya= +Poppet the Thrasher,Poppet= +Lord Mayong Mistmoore,Mayong=Stifle rune # Fabled Veeshan's Peak -Kluzen the Protector=Bloodbound Stun rune -Nexona= +Kluzen the Protector,Kluzen=Stun rune +Nexona=Stun rune Elder Ekron= -Druusk=Bloodbound Fear rune -Taskmaster Nichok= -Milyex Vioren= -Qunard Ashenclaw=Bloodbound Stun rune +Druushk,Drushk,Druusk=Fear rune +Taskmaster Nichok,Nichok,Taskmaster,Task master= +Milyex Vioren,Milyex= +Qunard Ashenclaw,Qunard=Stun rune Xygoz= Hoshkar= -Traverno the Skygazer= -Silverwing=Bloodbound Fear rune -Phara Dar= +Travenro the Skygazer,Travenro,Traverno= +Silverwing=Fear rune +Phara Dar,Phara= # Fabled Trakanon's Lair -Trakanon=Stifle rune +Trakanon,Trak=Stifle rune