From bbc9aa655319b06eaabeb264a1b1e891ebeab022 Mon Sep 17 00:00:00 2001 From: Madpeter <57852827+Madpeterz@users.noreply.github.com> Date: Sat, 9 Aug 2025 19:49:53 +0100 Subject: [PATCH] Update Animation.cs --- SecondBotEvents/Commands/Animation.cs | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/SecondBotEvents/Commands/Animation.cs b/SecondBotEvents/Commands/Animation.cs index b9040c4..53a715a 100644 --- a/SecondBotEvents/Commands/Animation.cs +++ b/SecondBotEvents/Commands/Animation.cs @@ -26,21 +26,40 @@ namespace SecondBotEvents.Commands return Failure("@todo"); } - [About("Attempts to play a gesture")] - [ReturnHintsFailure("Error with gesture")] + [About("Attempts to play a gesture \n using the inventory uuid")] + [ReturnHintsFailure("Error with gesture inventory uuid")] [ReturnHints("Accepted")] - [ArgHints("gesture", "What gesture to trigger", "UUID")] + [ArgHints("gesture", "inventory uuid for the gesture to trigger", "UUID")] + [ReturnHintsFailure("unable to get gesture from inventory")] [CmdTypeDo()] public object PlayGesture(string gesture) { if (UUID.TryParse(gesture, out UUID gestureUUID) == false) { - return BasicReply("Error with gesture", [gesture]); + return BasicReply("Error with gesture inventory uuid", [gesture]); } InventoryItem itm = GetClient().Inventory.FetchItem(gestureUUID, GetClient().Self.AgentID, TimeSpan.FromSeconds(15)); + if (itm == null) + { + return BasicReply("unable to get getsture from inventory", [gesture]); + } GetClient().Self.PlayGesture(itm.AssetUUID); return BasicReply("Accepted", [gesture]); } + [About("Attempts to play a gesture \n using the real asset uuid not the inventory uuid")] + [ReturnHintsFailure("Error with gesture asset uuid")] + [ReturnHints("Accepted")] + [ArgHints("gesture", "asset uuid for the gesture to trigger", "UUID")] + [CmdTypeDo()] + public object PlayGestureDirect(string gesture) + { + if (UUID.TryParse(gesture, out UUID gestureUUID) == false) + { + return BasicReply("Error with gesture", [gesture]); + } + GetClient().Self.PlayGesture(gestureUUID); + return BasicReply("Accepted", [gesture]); + } [About("Resets the animation stack for the bot")] [ReturnHints("Accepted - X stopped animations")]