From 2f798f2485190216117ed050e8f66847c94cbee5 Mon Sep 17 00:00:00 2001 From: Jackson <9527380+Jaksuhn@users.noreply.github.com> Date: Sat, 17 Aug 2024 13:47:30 +0200 Subject: [PATCH] more commands --- SomethingNeedDoing/Grammar/Commands/LoopCommand.cs | 3 +-- SomethingNeedDoing/Misc/Changelog.cs | 5 ++++- SomethingNeedDoing/Misc/Commands/InternalCommands.cs | 2 ++ SomethingNeedDoing/Misc/Commands/QuestCommands.cs | 2 ++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/SomethingNeedDoing/Grammar/Commands/LoopCommand.cs b/SomethingNeedDoing/Grammar/Commands/LoopCommand.cs index 8b80250f..b00429b3 100644 --- a/SomethingNeedDoing/Grammar/Commands/LoopCommand.cs +++ b/SomethingNeedDoing/Grammar/Commands/LoopCommand.cs @@ -21,8 +21,7 @@ internal class LoopCommand : MacroCommand private readonly int startingLoops; private int loopsRemaining; - private LoopCommand(string text, int loopCount, WaitModifier wait, EchoModifier echo) - : base(text, wait) + private LoopCommand(string text, int loopCount, WaitModifier wait, EchoModifier echo) : base(text, wait) { loopsRemaining = loopCount >= 0 ? loopCount : MaxLoops; startingLoops = loopsRemaining; diff --git a/SomethingNeedDoing/Misc/Changelog.cs b/SomethingNeedDoing/Misc/Changelog.cs index a2a4bea9..7aa56373 100644 --- a/SomethingNeedDoing/Misc/Changelog.cs +++ b/SomethingNeedDoing/Misc/Changelog.cs @@ -20,7 +20,10 @@ static void DisplayChangelog(string date, string changes, bool separator = true) DisplayChangelog( "2024-08-24", - "- Added GetZoneInstance()\n"); + "- Added GetZoneInstance()\n" + + "- Added IsPauseLoopSet()\n" + + "- Added IsStopLoopSet()\n +" + + "- Added GetMonsterNoteRankInfo()\n"); DisplayChangelog( "2024-07-29", diff --git a/SomethingNeedDoing/Misc/Commands/InternalCommands.cs b/SomethingNeedDoing/Misc/Commands/InternalCommands.cs index 329cfea2..1b7cd993 100644 --- a/SomethingNeedDoing/Misc/Commands/InternalCommands.cs +++ b/SomethingNeedDoing/Misc/Commands/InternalCommands.cs @@ -35,4 +35,6 @@ public List ListAllFunctions() public void SetSNDProperty(string key, string value) => Service.Configuration.SetProperty(key, value); public object? GetSNDProperty(string key) => Service.Configuration.GetProperty(key); + public bool IsPauseLoopSet() => Service.MacroManager.PauseAtLoop; + public bool IsStopLoopSet() => Service.MacroManager.StopAtLoop; } diff --git a/SomethingNeedDoing/Misc/Commands/QuestCommands.cs b/SomethingNeedDoing/Misc/Commands/QuestCommands.cs index d0f14ff4..2a3b59e5 100644 --- a/SomethingNeedDoing/Misc/Commands/QuestCommands.cs +++ b/SomethingNeedDoing/Misc/Commands/QuestCommands.cs @@ -53,6 +53,8 @@ public static string GetQuestNameByID(ushort id) return matchingRows.Count > 0 ? Svc.Data.GetExcelSheet(Svc.ClientState.ClientLanguage)!.GetRow((uint)matchingRows.First().i)!.RowId : null; } + public unsafe MonsterNoteRankInfo GetMonsterNoteRankInfo(int index) => MonsterNoteManager.Instance()->RankData[index]; + private static bool IsMatch(string x, string y) => Regex.IsMatch(x, $@"\b{Regex.Escape(y)}\b"); private static object MatchingScore(string item, string line) {