API:OpenURL
From RoR Wiki
UI Lua API · Interface functions
Version: WAR 1.4.8
Opens one of the client's predefined web addresses in the default web browser.
OpenURL(urlIndex)
Arguments
- urlIndex
number– Index of the address in the client's URL list. Use theGameData.URLsvalues. Fractions are dropped.
Returns
Nothing.
Details
- The address is not passed from Lua: the index is looked up in the client's built-in
URLsdata list. An addon cannot open an arbitrary address with this function. - An index outside the list gives an empty address, and nothing is opened.
- An address without a scheme gets
httpadded. An address with a scheme is opened only if the scheme ishttporhttps(case does not matter); anything else is not opened. - The address is opened through the Windows shell with the "open" verb, which normally starts the default browser.
- No result is returned to Lua, so a script cannot tell whether a browser was started.
- The function needs at least one argument and only reads the last one.
Errors
None besides the generic Invalid Parameters message when the argument is missing or not a number.
Example
From ea_helpwindow/source/faqwindow.lua:
OpenURL( GameData.URLs.URL_KNOWLEDGE_BASE )
From interfacecore/source/transferpopupwindow.lua:
OpenURL( GameData.URLs.URL_ACCOUNT_MANAGEMENT )
