GHI_Position

Pilus edited this page Aug 11, 2015 · 1 revision

Syntax:

obj = GHI_Position()
obj.function()

Functions:

GetCoor(unit, decimal)

#### Arguments
unit
''String, UnitID [http://wowprogramming.com/docs/api_types#unitID]''
A This specifies the unit you wish to find the coordinates for. If nil then it will use the player.
decimal [optiona]
''number''
This specifies how many decimal places to round the coordinates off to. If left blank it does nto round the position.

Returns

Returns separate variables.

x
''Number''
The X coordinate in the GHI coordinate system (in meters)
y
''Number''
The Y coordinate in the GHI coordinate system (in meters)
world
''Number''
The World the player is on. 1 for Azeroth, 2 for Outland.

GetPlayerPos(decimal)

####Arguments

decimal [optional]
''number''
This specifies how many decimal places to round the coordinates off to. If left blank it does nto round the position.

Returns

Returns the player's position in a Table.
x
''Number''
The X coordinate in the GHI coordinate system
y
''Number''
The Y coordinate in the GHI coordinate system
world
''Number''
The World the player is on. 1 for Azeroth, 2 for Outland.

IsPosWithinRange(positon,range)

Arguments

position
''Table''
Contains a table of coordinates that contains the following.
x
''Number''
The X coordinate in the GHI coordinate system
y
''Number''
The Y coordinate in the GHI coordinate system
world
''Number''
The World the player is on. 1 for Azeroth, 2 for Outland.
range
''Number''
Range from the specified coordinates. Must be at least 1.

Returns

Returns true OR false.

Example:

local obj = GHI_Position()

local tarX, tarY, tarWorld = obj.GetCoor("target",10)

local tarPos = {x=tarX,y=tarY,world=tarWorld}

if obj.IsPosWithinRange(tarPos,5) then

print("You are close enough")

else

local playPos = {}

playPos = obj.GetPlayerPos()

print("You are here:")

print(playPos.x,playPos.y,playPos.world)

print("You should be here:")

print(tarPos.x, tarPos.y, tarPos.world)

end

This script is usable with a party member. You must be able to track someone on your world map to use it. It will tell you if you are withing 5 meters of your target.

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.