aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ExportBot/Commands/Movement/MoveToCommand.cs
diff options
context:
space:
mode:
Diffstat (limited to 'ExportBot/Commands/Movement/MoveToCommand.cs')
-rw-r--r--ExportBot/Commands/Movement/MoveToCommand.cs24
1 files changed, 24 insertions, 0 deletions
diff --git a/ExportBot/Commands/Movement/MoveToCommand.cs b/ExportBot/Commands/Movement/MoveToCommand.cs
new file mode 100644
index 0000000..6d0a225
--- /dev/null
+++ b/ExportBot/Commands/Movement/MoveToCommand.cs
@@ -0,0 +1,24 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace libsecondlife.TestClient.Commands.Movement {
6 class MovetoCommand : Command {
7 public MovetoCommand(TestClient client) {
8 Name = "moveto";
9 Description = "Moves the avatar to the specified global position using simulator autopilot.";
10 }
11 public override string Execute(string[] args, LLUUID fromAgentID) {
12 if (args.Length != 3)
13 return "usage: moveto x y z";
14 float x = Client.Self.Position.X + Client.regionX;
15 float y = Client.Self.Position.Y + Client.regionY;
16 float z = Client.Self.Position.Z;
17 float.TryParse(args[0], out x);
18 float.TryParse(args[1], out y);
19 float.TryParse(args[2], out z);
20 Client.Self.AutoPilot((ulong)x, (ulong)y, z);
21 return "Attempting to move to <" + x + ", " + y + ", " + z + ">";
22 }
23 }
24}