<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3ACreateHyperLink</id>
	<title>API:CreateHyperLink - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3ACreateHyperLink"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:CreateHyperLink&amp;action=history"/>
	<updated>2026-10-17T14:22:24Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.returnofreckoning.com/index.php?title=API:CreateHyperLink&amp;diff=30266&amp;oldid=prev</id>
		<title>Maintenance script: UI Lua API import (WAR 1.4.8)</title>
		<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:CreateHyperLink&amp;diff=30266&amp;oldid=prev"/>
		<updated>2026-10-16T19:41:50Z</updated>

		<summary type="html">&lt;p&gt;UI Lua API import (WAR 1.4.8)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{LuaApi|group=Interface}}&lt;br /&gt;
Builds the markup for a clickable link that can be put into chat or label text.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
link = CreateHyperLink(data, text, color, color2)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
;data : &amp;lt;code&amp;gt;wstring&amp;lt;/code&amp;gt; – The link&amp;#039;s data string, for example &amp;lt;code&amp;gt;L&amp;quot;PLAYER:&amp;quot;..name&amp;lt;/code&amp;gt;. The stock UI starts it with a tag that tells what kind of link it is.&lt;br /&gt;
;text : &amp;lt;code&amp;gt;wstring&amp;lt;/code&amp;gt; – The text shown for the link.&lt;br /&gt;
;color : &amp;lt;code&amp;gt;number-table&amp;lt;/code&amp;gt; – Colour of the link as &amp;lt;code&amp;gt;{r, g, b}&amp;lt;/code&amp;gt; on a 0–255 scale, or &amp;lt;code&amp;gt;{}&amp;lt;/code&amp;gt; for no colour.&lt;br /&gt;
;color2 : &amp;lt;code&amp;gt;number-table&amp;lt;/code&amp;gt; – A second colour in the same form, or &amp;lt;code&amp;gt;{}&amp;lt;/code&amp;gt;. The stock UI always passes &amp;lt;code&amp;gt;{}&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
;link : &amp;lt;code&amp;gt;wstring&amp;lt;/code&amp;gt; – The markup, for example &amp;lt;code&amp;gt;&amp;amp;lt;LINK data=&amp;quot;PLAYER:Name&amp;quot; text=&amp;quot;Name&amp;quot; color=&amp;quot;255,255,255&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* The result has the form &amp;lt;code&amp;gt;&amp;amp;lt;LINK data=&amp;quot;&amp;#039;&amp;#039;data&amp;#039;&amp;#039;&amp;quot; text=&amp;quot;&amp;#039;&amp;#039;text&amp;#039;&amp;#039;&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;. Each colour table adds a &amp;lt;code&amp;gt;color=&amp;quot;r,g,b&amp;quot;&amp;lt;/code&amp;gt; attribute before the closing &amp;lt;code&amp;gt;&amp;amp;gt;&amp;lt;/code&amp;gt;; with both tables filled the markup has two &amp;lt;code&amp;gt;color&amp;lt;/code&amp;gt; attributes.&lt;br /&gt;
* A colour table is used only if it has at least three entries; only the first three are read. Each value is clamped to 0–255 and written as a whole number.&lt;br /&gt;
* &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt; are copied as they are. Quotes or &amp;lt;code&amp;gt;&amp;amp;gt;&amp;lt;/code&amp;gt; characters in them are not escaped.&lt;br /&gt;
* &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt; must be wide strings. Passing a plain Lua string raises an &amp;#039;&amp;#039;Invalid Parameters&amp;#039;&amp;#039; error.&lt;br /&gt;
* The function needs at least four arguments and only reads the last four.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
None besides the &amp;#039;&amp;#039;Invalid Parameters&amp;#039;&amp;#039; argument check.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Inserting an item link into the chat input, from &amp;lt;code&amp;gt;ea_chatwindow/source/chathyperlinking.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
local data  = ITEM_TAG..itemData.uniqueID&lt;br /&gt;
local text  = L&amp;quot;[&amp;quot;..itemData.name..L&amp;quot;]&amp;quot;&lt;br /&gt;
local color = DataUtils.GetItemRarityColor(itemData)&lt;br /&gt;
&lt;br /&gt;
local link  = CreateHyperLink( data, text, {color.r,color.g,color.b}, {} )&lt;br /&gt;
&lt;br /&gt;
EA_ChatWindow.InsertText( link )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A player link without a colour, from &amp;lt;code&amp;gt;ea_guildwindow/source/guildwindowtabrecruitsearch.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
local text = CreateHyperLink( L&amp;quot;PLAYER:&amp;quot;..name, name, {}, {} )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:TextEditBoxInsertText|TextEditBoxInsertText]]&lt;br /&gt;
* [[API:LabelSetLinkColor|LabelSetLinkColor]]&lt;br /&gt;
* [[API:LabelSetIgnoreFormattingTags|LabelSetIgnoreFormattingTags]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>