From 45b714451ca3a2a7b9a3b76fe33c77bd92311cdb Mon Sep 17 00:00:00 2001 From: Madpeter <57852827+Madpeterz@users.noreply.github.com> Date: Thu, 9 Jan 2025 21:05:16 +0000 Subject: [PATCH] adds CancelParcelSale --- SecondBotEvents/Commands/ParcelCommands.cs | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/SecondBotEvents/Commands/ParcelCommands.cs b/SecondBotEvents/Commands/ParcelCommands.cs index 7b7fa77..0faa2a6 100644 --- a/SecondBotEvents/Commands/ParcelCommands.cs +++ b/SecondBotEvents/Commands/ParcelCommands.cs @@ -172,6 +172,23 @@ namespace SecondBotEvents.Commands return BasicReply(JsonConvert.SerializeObject(reply)); } + [About("Cancels the current parcel the bot is in sale")] + [ReturnHints("ok")] + [ReturnHintsFailure("Error not in a sim")] + [ReturnHintsFailure("Parcel data not ready")] + public object CancelParcelSale() + { + KeyValuePair tests = SetupCurrentParcel(); + if (tests.Key == false) + { + return Failure(tests.Value); + } + ParcelStatic.ParcelSetFlag(ParcelFlags.ForSale, targetparcel, false); + ParcelStatic.ParcelSetFlag(ParcelFlags.ForSaleObjects, targetparcel, false); + targetparcel.Update(GetClient()); + return BasicReply("ok"); + } + [About("Sets the current parcel for sale Also marks the parcel for sale")] [ReturnHints("ok")] [ReturnHintsFailure("Error not in a sim")] @@ -210,9 +227,11 @@ namespace SecondBotEvents.Commands ParcelStatic.ParcelSetFlag(ParcelFlags.ForSale, targetparcel, true); ParcelStatic.ParcelSetFlag(ParcelFlags.ForSaleObjects, targetparcel, false); targetparcel.Update(GetClient()); - return Failure("ok", new [] { amount, avatar }); + return BasicReply("ok", new [] { amount, avatar }); } + + [About("Gets the parcel Dwell (Traffic) value and returns it via the reply target")] [ReturnHints("traffic value")] [ReturnHintsFailure("Error not in a sim")]