aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/mass test client/Commands/Movement/JumpCommand.cs
blob: 6cead83bc3832fbbfc0844b10fa3cc8240eeab34 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using System;
using System.Collections.Generic;
using System.Text;
using libsecondlife;
using libsecondlife.Packets;

namespace libsecondlife.TestClient
{
    public class JumpCommand: Command
    {
        public JumpCommand(TestClient testClient)
		{
			Name = "jump";
			Description = "Teleports to the specified height. (e.g. \"jump 1000\")";
		}

        public override string Execute(string[] args, LLUUID fromAgentID)
		{
			if (args.Length != 1)
                return "usage: jump 1000";

			float height = 0;
			float.TryParse(args[0], out height);

			Client.Self.Teleport
			(
				Client.Network.CurrentSim.Name,
				new LLVector3(Client.Self.Position.X, Client.Self.Position.Y, Client.Self.Position.Z + height)
			);

            return "Jumped " + height;
		}
    }
}