From c3e4af6658a93d60f9c513e26596d78458d80b0d Mon Sep 17 00:00:00 2001 From: Madpeter Date: Mon, 18 May 2020 15:49:36 +0100 Subject: [PATCH] new command: GetSimGlobalPos --- Core/Commands/Estate/GetSimGlobalPos.cs | 27 +++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Core/Commands/Estate/GetSimGlobalPos.cs diff --git a/Core/Commands/Estate/GetSimGlobalPos.cs b/Core/Commands/Estate/GetSimGlobalPos.cs new file mode 100644 index 0000000..8a6dc16 --- /dev/null +++ b/Core/Commands/Estate/GetSimGlobalPos.cs @@ -0,0 +1,27 @@ +using OpenMetaverse; + +namespace BSB.Commands.Estate +{ + public class GetSimGlobalPos : CoreCommand_SmartReply_2arg + { + public override string Helpfile { get { return "Fetchs a region and returns its global X,Y"; } } + + public override bool CallFunction(string[] args) + { + if (base.CallFunction(args) == true) + { + if (bot.GetClient.Grid.GetGridRegion(args[1], GridLayerType.Objects, out GridRegion region)) + { + collection.Add("X", region.X.ToString()); + collection.Add("Y", region.Y.ToString()); + return bot.GetCommandsInterface.SmartCommandReply(true, args[0], "ok", CommandName,collection); + } + else + { + return Failed("Unable to find region"); + } + } + return false; + } + } +}