From a20c70d806afc28a6be8a3499b41dd7c4502d0bf Mon Sep 17 00:00:00 2001 From: Madpeterz <57852827+Madpeterz@users.noreply.github.com> Date: Thu, 18 Feb 2021 11:10:23 +0000 Subject: [PATCH] corrects issues and fixs rez command wiki make will no longer report negative args required for direct calls. Rez command updated to return UUID --- BetterSecondbot/WikiMake/wikimake.cs | 7 ++++++- Core/Commands/Inventory.cs | 16 ++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/BetterSecondbot/WikiMake/wikimake.cs b/BetterSecondbot/WikiMake/wikimake.cs index f33bcc4..7e4383c 100644 --- a/BetterSecondbot/WikiMake/wikimake.cs +++ b/BetterSecondbot/WikiMake/wikimake.cs @@ -476,7 +476,12 @@ namespace BetterSecondBot.WikiMake sb.Append(".html'>"); sb.Append(c); sb.Append(""); - sb.Append((args-1).ToString()); + int argcount = args - 1; + if(argcount < 0) + { + argcount = 0; + } + sb.Append(argcount.ToString()); sb.Append(""); } sb.Append(""); diff --git a/Core/Commands/Inventory.cs b/Core/Commands/Inventory.cs index 2c787d1..e8db20a 100644 --- a/Core/Commands/Inventory.cs +++ b/Core/Commands/Inventory.cs @@ -17,7 +17,9 @@ namespace BetterSecondBot.HttpService public HTTP_Inventory(SecondBot mainbot, TokenStorage setuptokens) : base(mainbot, setuptokens) { } [About("rezs the item at the bots current location")] - [ReturnHints("True|False")] + [ReturnHints("UUID of rezzed item")] + [ReturnHints("Invaild item UUID")] + [ReturnHints("Unable to find item")] [ArgHints("item", "URLARG", "UUID of item to rez")] [Route(HttpVerbs.Get, "/RezObject/{item}/{token}")] public object RezObject(string item, string token) @@ -26,7 +28,17 @@ namespace BetterSecondBot.HttpService { return Failure("Token not accepted"); } - return Failure("Broken awaiting repairs"); + if (UUID.TryParse(item, out UUID targetitem) == true) + { + return Failure("Invaild item UUID"); + } + InventoryItem itm = bot.GetClient.Inventory.FetchItem(targetitem, bot.GetClient.Self.AgentID, (5 * 1000)); + if (itm == null) + { + return Failure("Unable to find item"); + } + UUID rezedobject = bot.GetClient.Inventory.RequestRezFromInventory(bot.GetClient.Network.CurrentSim, bot.GetClient.Self.SimRotation, bot.GetClient.Self.RelativePosition, itm); + return BasicReply(rezedobject.ToString()); }