From db0659ae7b4c4775085af8e4b504b2f3fc19e2dc Mon Sep 17 00:00:00 2001 From: Madpeter <57852827+Madpeterz@users.noreply.github.com> Date: Wed, 4 Jun 2025 17:07:35 +0100 Subject: [PATCH] adds SetParcelAudioControls --- SecondBotEvents/Commands/ParcelCommands.cs | 46 +++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/SecondBotEvents/Commands/ParcelCommands.cs b/SecondBotEvents/Commands/ParcelCommands.cs index 243aa70..d93724b 100644 --- a/SecondBotEvents/Commands/ParcelCommands.cs +++ b/SecondBotEvents/Commands/ParcelCommands.cs @@ -719,7 +719,38 @@ namespace SecondBotEvents.Commands return BasicReply("ok"); } - + [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")] + [ReturnHintsFailure("Parcel data not ready")] + [ReturnHintsFailure("Unable to process everyone value")] + [ReturnHintsFailure("Unable to process grouponly value")] + [ArgHints("everyone", "can everyone trigger audio on this parcel", "BOOL")] + [ArgHints("grouponly", "can everyone trigger audio on this parcel", "BOOL")] + public object SetParcelAudioControls(string everyone,string grouponly) + { + KeyValuePair tests = SetupCurrentParcel(); + if (tests.Key == false) + { + return Failure(tests.Value, [everyone,grouponly]); + } + if(bool.TryParse(everyone, out bool everyonebool) == false) + { + return Failure("Unable to process everyone value", [everyone, grouponly]); + } + if (bool.TryParse(grouponly, out bool grouponlybool) == false) + { + return Failure("Unable to process grouponly value", [everyone, grouponly]); + } + if(everyonebool == true) + { + grouponlybool = false; + } + targetparcel.AnyAVSounds = everyonebool; + targetparcel.GroupAVSounds = grouponlybool; + targetparcel.Update(GetClient()); + return BasicReply("ok", [everyone, grouponly]); + } [About("Updates the current parcels name")] [ReturnHints("true|false")] @@ -874,6 +905,19 @@ namespace SecondBotEvents.Commands GetClient().Parcels.Buy(GetClient().Network.CurrentSim, targetparcel.LocalID, false, UUID.Zero, false, targetparcel.Area, amountvalue); return BasicReply("ok", [amount]); } + [ReturnHintsFailure("Error not in a sim")] + [ReturnHintsFailure("Parcel data not ready")] + public object SetParcelGround() + { + KeyValuePair tests = SetupCurrentParcel(); + if (tests.Key == false) + { + return Failure(tests.Value); + } + targetparcel.Ground = true; + targetparcel.Update(GetClient()); + return BasicReply("ok"); + } [About("Sets the current parcels snapshot")] [ReturnHints("ok")]