RVAPI_Range (RV)

RVAPI

Range finder API. Based on your current abilities and map points.


Globals

RVAPI_Range.Ranges

  • MIN_RANGE: default minimum range
  • MAX_RANGE: default maximum range

RVAPI_Range.RangeType

  • RANGE_TYPE_MAP: output type based on the map information
  • RANGE_TYPE_SPELLS: output type based on the spells information

RVAPI_Range.DelayType*

  • DELAY_EXACT_TIME: ???
  • DELAY_DIFFERENCE_DETECTED: ???

API Functions v2.0

Function name: API_RegisterTarget()
Description: registers target name for tracking distances
Input:

  • CallbackOwner -
  • CallbackFunction -
  • TargetName - target name
  • Delay - delay for an updates
  • DelayType - can be one of the following: DELAY_EXACT_TIME, DELAY_DIFFERENCE_DETECTED
  • UserData - alias for the third party addons data. You can link your additional data (like user number in the group etc.) to this specific target name

Output: nothing

Function name: API_UnregisterTarget()
Description: unregisters target from the "Range API"
Input:

  • CallbackOwner -
  • CallbackFunction -
  • TargetName - target name

Output: nothing

API Functions v1.02

Function name: API_GetRange()
Description: returns MIN and MAX range for the selected friendly/hostile target
Input:

  • targetType - this could be three possible values: GameData.TargetTypes.TARGET_ALLY, GameData.TargetTypes.TARGET_ENEMY and GameData.TargetTypes.TARGET_PET

Output: array of two values

  • RangeMin: minimum range value
  • RangeMax: maximum range value

API Usage Example v2.0

-- : Lets look for some Mailboxes around us and update our records every one second
RVAPI_Range.API_RegisterTarget(MyAddon, MyAddon.OnTargetRangeUpdated, "Mailbox", 1, RVAPI_Range.DelayType.DELAY_EXACT_TIME, nil)


-- : Self: equals to the MyAddon
-- : Distances: array of the found distances. For instance you can find up to three "Mailboxes" in the Altdorf city
-- : RangeType: API is telling us which type of the information we got. This could be one of the following: RANGE_TYPE_MAP, RANGE_TYPE_SPELLS
-- : UserData: alias information related to this target. Defined by the third party addons.
function MyAddon.OnTargetRangeUpdated(Self, Distances, RangeType, UserData)

    -- : show the first found range in the debug window
    d(Distances[1].RangeMin..":"..Distances[1].RangeMax)
end

You must login to post a comment. Don't have an account? Register to get one!

Facts

Date created
Dec 06, 2009
Category
Last update
Nov 24, 2010
Development stage
Release
License
MIT License
Curse link
RVAPI_Range (RV)
Downloads
10,933
Recent files

Authors