API GetUnitSpeed

Returns a value representing the moving speed of a unit. Added in Patch 3.0.1. currentSpeed, runSpeed, flightSpeed, swimSpeed = GetUnitSpeed("unit");

Arguments

 * unit : String (unitId) - Unit to query the speed of. This has not been tested with all units but does work for "player" units.

Returns

 * currentSpeed : Number - current movement speed in yards per second (normal running: 7; an epic ground mount: 14)
 * runSpeed : Number - the maximum speed on the ground, in yards per second (including talents such as Pursuit of Justice and ground mounts)
 * flightSpeed : Number - the maximum speed while flying, in yards per second (the unit need to be on a flying mount to get the flying speed)
 * swimSpeed : Number - the maximum speed while swimming, in yards per second (not tested but it should be as the flying mount)

Example
The following snippet prints your current movement speed in percent: /script print(string.format("Current speed: %d%%", GetUnitSpeed("player") / 7 * 100))