From 25e6f6269824cdfbfab1c8a5eb66c682a8c670b3 Mon Sep 17 00:00:00 2001 From: Madpeter <57852827+Madpeterz@users.noreply.github.com> Date: Thu, 5 Jun 2025 20:36:06 +0100 Subject: [PATCH] add GetParcelPrimCounts --- SecondBotEvents/Commands/ParcelCommands.cs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/SecondBotEvents/Commands/ParcelCommands.cs b/SecondBotEvents/Commands/ParcelCommands.cs index 2cd4daa..f53acf9 100644 --- a/SecondBotEvents/Commands/ParcelCommands.cs +++ b/SecondBotEvents/Commands/ParcelCommands.cs @@ -719,6 +719,27 @@ namespace SecondBotEvents.Commands return BasicReply("ok"); } + + [About("Gets the current parcel prim count data")] + [ReturnHints("a json object with prim counts")] + [ReturnHintsFailure("Error not in a sim")] + [ReturnHintsFailure("Parcel data not ready")] + public object GetParcelPrimCounts() + { + KeyValuePair tests = SetupCurrentParcel(); + if (tests.Key == false) + { + return Failure(tests.Value); + } + Dictionary collection = []; + collection.Add("TotalPrims", targetparcel.TotalPrims.ToString()); + collection.Add("GroupPrims", targetparcel.GroupPrims.ToString()); + collection.Add("OwnerPrims", targetparcel.OwnerPrims.ToString()); + collection.Add("OtherPrims", targetparcel.OtherPrims.ToString()); + collection.Add("MaxPrims", targetparcel.MaxPrims.ToString()); + collection.Add("ParcelPrimBonus", targetparcel.ParcelPrimBonus.ToString()); + return BasicReply(JsonConvert.SerializeObject(collection)); + } [About("Controls who can trigger audio on this parcel\n if everyone is set to true then grouponly will switch to false")] [ReturnHints("ok")] [ReturnHintsFailure("Error not in a sim")]