diff --git a/Core/Commands/Prims/UnRezObject.cs b/Core/Commands/Prims/UnRezObject.cs new file mode 100644 index 0000000..0260ea3 --- /dev/null +++ b/Core/Commands/Prims/UnRezObject.cs @@ -0,0 +1,45 @@ +using OpenMetaverse; +using System; +using System.Collections.Generic; +using System.Text; + +namespace BSB.Commands.Prims +{ + class UnRezObject : CoreCommand_1arg + { + public override string[] ArgTypes { get { return new[] { "UUID" }; } } + public override string[] ArgHints { get { return new[] { "The object to unrez"}; } } + public override string Helpfile { get { return "Returns a rezzed object"; } } + + public override bool CallFunction(string[] args) + { + if (base.CallFunction(args) == true) + { + if (UUID.TryParse(args[0], out UUID targetobject) == true) + { + bool found = false; + Dictionary objects_copy = bot.GetClient.Network.CurrentSim.ObjectsPrimitives.Copy(); + foreach (KeyValuePair Obj in objects_copy) + { + if (Obj.Value.ID == targetobject) + { + bot.GetClient.Inventory.RequestDeRezToInventory(Obj.Key); + found = true; + break; + } + } + if(found == true) + { + return true; + } + return Failed("Unable to see object"); + } + else + { + return Failed("Invaild object UUID"); + } + } + return false; + } + } +}