Minion Beta! - Help us test our new AddOn updater. Get it now!
Download
(44 Kb)
Download
Updated: 05-24-09 02:03 PM
Pictures
File Info
Updated:05-24-09 02:03 PM
Created:unknown
Downloads:6,290
Favorites:55
MD5:
TradeLinks  Popular! (More than 5000 hits)
Version: 3.1.2 - 9901a
by: Maldivia [More]
Simple addon, that can create custom trade-hyperlinks.

For instance can be used to create a small list of recipees you want to make, instead of linking all of them.

How to use:
Type /tradelinks or /tl to open the window.
Select the profession from the drop down menu
Check the recipees you want to include
Click Link, and a link will be written to your primary chat frame, and the profession window will pop up as if you clicked it.
To send the link to others, shift-click the link written to the chat frame.

To decode a trade-link, and dump a list of the spells in it:
/tldecode [trade link]

To see a list of trade-skills that's not in a link (ie, which skills you're missing):
/tlmissing [trade link]

If holding down shift while finding the recipees in the TradeLinks frame, information about the recipe will show in a tooltip. Shift-click on a recipe in the TradeLinks frame with the chat edit box open, will link that spell.

Known issues:
* Skills that do not create/enchant items, such as the new abilities you gain with professions (Milling, Decipher, Glyph Mastery for Inscription etc) will not show in the profession window that pops up.
* If no skills are selected that create/enchant items, the link generated will not work
* First Aid is weird...
* Mining is not included
* Creating links with recipees noone has, can disconnect you, since the items for those recipees are not loaded on the server. The same thing can happen if you use shift to view tooltips for such recipees.
9901a:
* Fixed bug with Purge in the library
9901:
* Added data files for build 9901 (3.1.2)
* Added function LibTradeLinks:GetSkillId(professionSpell)
* Added function LibTradeLinks:GetSpecializationSpells(skillId)
* Added function LibTradeLinks:GetSpecializationSpells(tradeLink, buildnumber)
9835:
* Added data files for build 9835 (3.1.1a)
9806:
* Added data files for build 9806 (3.1.1)
9767:
* Added data files for build 9767 (3.1.0)
* Added /tlmissing command
9551/9614:
* Fixed bug in decoder that for certain links could add spell not included in the link
* Added data files for build 9614 (0.1.0 PTR)
9551:
* Added data files for build 9551 (3.0.9)
9506:
* Added data files for build 9506 (3.0.8a)
9464:
* Added data files for build 9464 (3.0.8)
9183/9438:
* Added data files for build 9438 (0.0.8 PTR)
9183/9355:
* Added data files for build 9355 (0.0.8 PTR)
9183/9155:
* Added data files for build 9183 (3.0.3)
9056/9155:
* Added data files for build 9155
9056/9061 v2:
* Fixed support for decoding specialized professions
9056/9061:
* Added data files for build 9056 - release version of 3.0.2
* Supports dual data files, so it works on both live and beta
9061:
* Updated data files for build 9061
9038:
* Updated data files for build 9038
* Fixed typo in an assert
9014:
* Updated data files for build 9014
8982:
* Updated data files for build 8982
8970:
* Updated data files for build 8970
* Some initial code for turning the functionality into a library with BoP and black list support.
8905:
* Updated data files for build 8905
8885:
* Updated data files for build 8885
8820:
* Updated data files for build 8820
* Updated to the new encoding scheme of build 8820
8788:
* Updated data files for build 8788
8770-2:
* Added decode option: /tldecode [tradeLink]
Optional Files (0)


Archived Files (10)
File Name
Version
Size
Author
Date
3.1.2 - 9901
44kB
Maldivia
05-19-09 04:48 PM
3.1.1a - 9835
27kB
Maldivia
04-28-09 04:04 PM
3.1.1 - 9806
27kB
Maldivia
04-21-09 12:53 PM
3.1.0 - 9767
27kB
Maldivia
04-14-09 11:07 AM
9551/9614
26kB
Maldivia
02-25-09 03:27 PM
9551
26kB
Maldivia
02-10-09 12:35 PM
9506
26kB
Maldivia
01-27-09 11:02 AM
9464
26kB
Maldivia
01-20-09 10:16 AM
9183/9438
26kB
Maldivia
01-12-09 11:29 AM
9183/9355
26kB
Maldivia
12-13-08 08:37 AM


Post A Reply Comment Options
Unread 05-21-09, 09:28 AM  
galmok
A Defias Bandit

Forum posts: 2
File comments: 55
Uploads: 0
Got a question about the blacklist. It seems you have 1 blacklist for all professions. And the blacklist seems to hold both spell-id's and enchant-id's, right? If so, isn't there a risk of blacklisting an enchant X that is not supposed to be blacklisted when you want to blacklist spell X?
galmok is offline Report comment to moderator  
Reply With Quote
Unread 05-20-09, 05:57 PM  
galmok
A Defias Bandit

Forum posts: 2
File comments: 55
Uploads: 0
The :Purge function doesn't work as intended. The Blacklist table is accessed without providing a build-number and hence nothing is purged(!) Also, as the Blacklist table isn't exposed, I can't purge the tables myself. Could you _please_ hurry a solution through here. :-)
galmok is offline Report comment to moderator  
Reply With Quote
Unread 05-20-09, 12:41 PM  
galmok
A Defias Bandit

Forum posts: 2
File comments: 55
Uploads: 0
Originally posted by Maldivia
Added the following functions with build 9901:
function LibTradeLinks:GetSkillId(professionSpell)
Gets the skillId for the specified profession spell.
For instance lib:GetSkillId(26801) returns 197 (= LibTradeLinks.SKILL_TAILORING)

function LibTradeLinks:GetSpecializationSpells(skillId)
Returns a table containing all the profession spells for the specified skillId

function LibTradeLinks:GetSpecializationSpells(tradeLink, buildnumber)
Returns a table containing all the profession spells contained in the specified tradeLink. If buildnumber is specified, and information for that build is available, that data is used to parse.
Hmm I may be missing something, but how do I get the skillId from a tradelink with these functions? Do I still have to use:

Code:
local spells, skillId = lib:Decode(tradeskillLink);
If so, then I am back to creating a huge amount of garbage (throwing away the spells table).

Hmm is the professionSpell the value embedded in the tradeLink? If so, then I have what I need I think. :-P
Last edited by galmok : 05-20-09 at 12:42 PM.
galmok is offline Report comment to moderator  
Reply With Quote
Unread 05-19-09, 04:51 PM  
Maldivia
A Deviate Faerie Dragon
AddOn Author - Click to view AddOns

Forum posts: 12
File comments: 31
Uploads: 8
Originally posted by galmok
Cool. Would this allow me to see which profession specialization a player has by passing the trade link?
Added the following functions with build 9901:
function LibTradeLinks:GetSkillId(professionSpell)
Gets the skillId for the specified profession spell.
For instance lib:GetSkillId(26801) returns 197 (= LibTradeLinks.SKILL_TAILORING)

function LibTradeLinks:GetSpecializationSpells(skillId)
Returns a table containing all the profession spells for the specified skillId

function LibTradeLinks:GetSpecializationSpells(tradeLink, buildnumber)
Returns a table containing all the profession spells contained in the specified tradeLink. If buildnumber is specified, and information for that build is available, that data is used to parse.
Maldivia is offline Report comment to moderator  
Reply With Quote
Unread 05-11-09, 10:44 AM  
galmok
A Defias Bandit

Forum posts: 2
File comments: 55
Uploads: 0
Originally posted by Maldivia
I'll try to add a lib:GetSpecializationSpells(skillId) and a lib:GetSkillId(professionSpell) for next version, since I already have that data stored
Cool. Would this allow me to see which profession specialization a player has by passing the trade link?
galmok is offline Report comment to moderator  
Reply With Quote
Unread 05-08-09, 03:09 PM  
Maldivia
A Deviate Faerie Dragon
AddOn Author - Click to view AddOns

Forum posts: 12
File comments: 31
Uploads: 8
Originally posted by galmok
Consider this yet another request to make LibTradeLinks expose more information ;-)
I'll try to add a lib:GetSpecializationSpells(skillId) and a lib:GetSkillId(professionSpell) for next version, since I already have that data stored
Last edited by Maldivia : 05-08-09 at 03:10 PM.
Maldivia is offline Report comment to moderator  
Reply With Quote
Unread 05-08-09, 06:38 AM  
galmok
A Defias Bandit

Forum posts: 2
File comments: 55
Uploads: 0
Originally posted by galmok
Ok. I guess I can maintain a table converting your skillIds to my skillIds (I call them your skillIds because I can't find any in-game reference to them).

Would it be possible to expose the profession s p e c i a l i s a t i o n (if there is any)? The specialisation word is apparently not allowed on this forum...
Hmm I think I'll stick to my version of the skillName check because it is much faster and generates much less garbage than calling libecode(tradeskillLink) all the time. :-/

It seems a bit over the top constructing a whole table full of enchant ids and then just throw them away. Consider this yet another request to make LibTradeLinks expose more information ;-)
galmok is offline Report comment to moderator  
Reply With Quote
Unread 05-07-09, 11:15 AM  
galmok
A Defias Bandit

Forum posts: 2
File comments: 55
Uploads: 0
Originally posted by Maldivia
The Decode method returns the skillId as the second return value:
Code:
local spells, skillId = lib:Decode(tradeskillLink);
local skillName = lib:GetSkillName(skillId);
if skillId == lib.SKILL_TAILORING then
   -- this is a tailoring link
end
The skillIds are the internal IDs Blizzard use and are static, for instance 197 is Tailoring. Most online DB sites use these values as well, example: http://www.wowhead.com/?spells=11.197 for a list of all tailoring skills.
Ok. I guess I can maintain a table converting your skillIds to my skillIds (I call them your skillIds because I can't find any in-game reference to them).

Would it be possible to expose the profession s p e c i a l i s a t i o n (if there is any)? The specialisation word is apparently not allowed on this forum...
Last edited by galmok : 05-07-09 at 11:16 AM.
galmok is offline Report comment to moderator  
Reply With Quote
Unread 05-05-09, 03:30 AM  
Maldivia
A Deviate Faerie Dragon
AddOn Author - Click to view AddOns

Forum posts: 12
File comments: 31
Uploads: 8
I have a situation where I need the base profession name of the tradelink. LibTradeLinks has all the information, but doesn't expose it. :-/
The Decode method returns the skillId as the second return value:
Code:
local spells, skillId = lib:Decode(tradeskillLink);
local skillName = lib:GetSkillName(skillId);
if skillId == lib.SKILL_TAILORING then
   -- this is a tailoring link
end
The skillIds are the internal IDs Blizzard use and are static, for instance 197 is Tailoring. Most online DB sites use these values as well, example: http://www.wowhead.com/?spells=11.197 for a list of all tailoring skills.
Last edited by Maldivia : 05-05-09 at 03:30 AM.
Maldivia is offline Report comment to moderator  
Reply With Quote
Unread 05-03-09, 05:59 AM  
galmok
A Defias Bandit

Forum posts: 2
File comments: 55
Uploads: 0
Originally posted by galmok
I have a situation where I need the base profession name of the tradelink. LibTradeLinks has all the information, but doesn't expose it. :-/

E.g. with a tailoring tradelink, it can have "Tailoring" or "Mooncloth Tailoring" or something else, but I would like to have them all decoded to "Tailoring".

You offer a "GetSkillName" but no way to map from a tradelink profession id to your internal skill id.

Also, is there any logic to your allSkills table? The skill ids have somewhat strange numbers. Can I rely on them to be static or will they change over time?

Edit: Also, would it be possible to get the profession specialization from a tradelink?
Currently I use code like this to see if a trade link matches a profession. Input to function is skillName, e.g. "Tailoring", and tradeLink, e.g. "trade:45542:x:x:xxxxxx":

Code:
	local LTLFunc = LibStub("LibTradeLinks-1.0")
	local allSkills = LTLFunc:GetSkillIds()
	if skillName and playerName and allSkills then
		local start, _, professionID = string.find(tradeLink, "trade:([0-9]+):.*");
		if professionID then
			professionID = tonumber(professionID)
			-- find the LTL-skillId with which the professionID matches
			for _, skillId in pairs(allSkills) do
				local Data = LTLFunc:GetData(skillId)
				if Data then
					-- very big assumption: First entry is the spell id of the profession (not true for mining but has no effect here).
					if GetSpellInfo(Data[1]) == skillName then
						return itemLink, skillName
					end
				end
			end
		end
	end
Not exactly a realiable method depending on what happens with the LibTradeLinks data... :-P
Last edited by galmok : 05-03-09 at 06:01 AM.
galmok is offline Report comment to moderator  
Reply With Quote
Unread 05-03-09, 03:44 AM  
galmok
A Defias Bandit

Forum posts: 2
File comments: 55
Uploads: 0
I have a situation where I need the base profession name of the tradelink. LibTradeLinks has all the information, but doesn't expose it. :-/

E.g. with a tailoring tradelink, it can have "Tailoring" or "Mooncloth Tailoring" or something else, but I would like to have them all decoded to "Tailoring".

You offer a "GetSkillName" but no way to map from a tradelink profession id to your internal skill id.

Also, is there any logic to your allSkills table? The skill ids have somewhat strange numbers. Can I rely on them to be static or will they change over time?

Edit: Also, would it be possible to get the profession specialization from a tradelink?
Last edited by galmok : 05-03-09 at 03:50 AM.
galmok is offline Report comment to moderator  
Reply With Quote
Unread 04-30-09, 08:57 AM  
galmok
A Defias Bandit

Forum posts: 2
File comments: 55
Uploads: 0
Originally posted by Maldivia
In cases like this (from 3.1.1 to 3.1.1a), where nothing has changed, then yes - it's a bit harsh to require an update for it to work again. The problem is, it's impossible in game to check if the old data set is still valid or not, and if the data is not valid the results from encoding/decoding tradelinks can range from a simple recipe missing, to almost everything being wrong. While the latter might be the extreme, it's none the less the reason for the harsh update policy.

But, I am working on a version of the library that contains data for the last few build and an option to specify which build-number a tradelink should be decoded with. That way, users of the library can opt to use older data and warn the users themselves (also enabled them, if they save the link directly, to convert from old build to current).
But would anyone use the old data you plan on including? The supplied old data would only be used if old trade-links were stored and had to be decoded.

Do you have any information that Blizzard changes what a single bit decodes to? If the links are generally stable, I see little harm in using old data for new server builds.

I am curious as to how you find out what a specific bit decodes to. Do you simply create trade links with only 1 bit in and activate the link to see the item/enchant that can be crafted?
galmok is offline Report comment to moderator  
Reply With Quote
Unread 04-29-09, 01:52 PM  
Maldivia
A Deviate Faerie Dragon
AddOn Author - Click to view AddOns

Forum posts: 12
File comments: 31
Uploads: 8
Originally posted by galmok
I just made a diff against the previous version and the only thing that you changed was the version number. Preventing parsing of tradelinks completely just because a new server build arrives is a bit too harsh. Printing a warning if an old LibTradeSkill was used would be plenty useful and would in most cases allow good use of LibTradeLinks, even when not upgraded.
In cases like this (from 3.1.1 to 3.1.1a), where nothing has changed, then yes - it's a bit harsh to require an update for it to work again. The problem is, it's impossible in game to check if the old data set is still valid or not, and if the data is not valid the results from encoding/decoding tradelinks can range from a simple recipe missing, to almost everything being wrong. While the latter might be the extreme, it's none the less the reason for the harsh update policy.

But, I am working on a version of the library that contains data for the last few build and an option to specify which build-number a tradelink should be decoded with. That way, users of the library can opt to use older data and warn the users themselves (also enabled them, if they save the link directly, to convert from old build to current).
Maldivia is offline Report comment to moderator  
Reply With Quote
Unread 04-29-09, 12:10 PM  
galmok
A Defias Bandit

Forum posts: 2
File comments: 55
Uploads: 0
Originally posted by galmok
I notice that LibTradeSkill fails to decode trade: links for each server patch. Is there any reason for that? Could you perhaps provide a fall back to the library currently loaded, even when it is out of date? I don't know if Blizzard introduces new codes in the tradelink that LibTradeLink has no chance of guessing the purpose of, but please make an attempt. :-)
I just made a diff against the previous version and the only thing that you changed was the version number. Preventing parsing of tradelinks completely just because a new server build arrives is a bit too harsh. Printing a warning if an old LibTradeSkill was used would be plenty useful and would in most cases allow good use of LibTradeLinks, even when not upgraded.
galmok is offline Report comment to moderator  
Reply With Quote
Unread 04-29-09, 12:01 PM  
galmok
A Defias Bandit

Forum posts: 2
File comments: 55
Uploads: 0
I notice that LibTradeSkill fails to decode trade: links for each server patch. Is there any reason for that? Could you perhaps provide a fall back to the library currently loaded, even when it is out of date? I don't know if Blizzard introduces new codes in the tradelink that LibTradeLink has no chance of guessing the purpose of, but please make an attempt. :-)
galmok is offline Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: