gw2#

local gw2 = require 'gw2'

Submodules

Functions#

gw2.coord_m2c(x, z, contleft, contright, conttop, contbottom, mapleft, mapright, maptop, mapbottom)#

Convert a position from map coordinates to continent coordinates.

Parameters:
  • x (number) – The map X coordinate

  • z (number) – The map Z/Y coordinate. Note: this is the 3rd coordinate returned by mumble-link!

  • contleft (number) – The left value of the continent_rect from the GW2 API for the map.

  • contright (number) – The right value of the continent_rect from the GW2 API for the map.

  • conttop (number) – The top value of the continent_rect from the GW2 API for the map.

  • contbottom (number) – The bottom value of the continent_rect from the GW2 API for the map.

  • mapleft (number) – The left value of the map_rect from the GW2 API for the map.

  • mapright (number) – The right value of the map_rect from the GW2 API for the map.

  • maptop (number) – The top value of the map_rect from the GW2 API for the map.

  • mapbottom (number) – The bottom value of the map_rect from the GW2 API for the map.

Returns:

The continent coordinates, as two numbers: cx, cy

Return type:

number

Version History

Version

Notes

0.0.1

Added

gw2.coord_c2m(cx, cy, contleft, contright, conttop, contbottom, mapleft, mapright, maptop, mapbottom)#

Convert a position from continent coordinates to map coordinates.

Parameters:
  • cx (number) – The continent X coordinate

  • cy (number) – The continent Y coordinate.

  • contleft (number) – The left value of the continent_rect from the GW2 API for the map.

  • contright (number) – The right value of the continent_rect from the GW2 API for the map.

  • conttop (number) – The top value of the continent_rect from the GW2 API for the map.

  • contbottom (number) – The bottom value of the continent_rect from the GW2 API for the map.

  • mapleft (number) – The left value of the map_rect from the GW2 API for the map.

  • mapright (number) – The right value of the map_rect from the GW2 API for the map.

  • maptop (number) – The top value of the map_rect from the GW2 API for the map.

  • mapbottom (number) – The bottom value of the map_rect from the GW2 API for the map.

Returns:

The map coordinates, as two numbers: x, y. NOTE: the y coordinate corresponds to the third coordinate returned by mumble-link!

Return type:

number

Version History

Version

Notes

0.0.1

Added

gw2.player_map_coords()#

Returns the current player position in map coordinates. This is the value reported by mumble-link converted to inches.

Returns:

X,Y,Z coordinates

Return type:

number

Example

local px, py, pz = gw2.player_map_coords()

Version History

Version

Notes

0.0.1

Added

gw2.player_continent_coords()#

Returns the current player position in continent coordinates. This is based on the data returned by mumble-link and map data from gw2.static.

Returns:

X, Y coordinates

Return type:

number

Example

local cx, cy = gw2.player_continent_coords()

Version History

Version

Notes

0.0.1

Added