new command: GetSimGlobalPos
This commit is contained in:
parent
934685970b
commit
c3e4af6658
1 changed files with 27 additions and 0 deletions
27
Core/Commands/Estate/GetSimGlobalPos.cs
Normal file
27
Core/Commands/Estate/GetSimGlobalPos.cs
Normal file
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue