Download
(44Kb)
Download
Updated: 05-24-09 02:03 PM
Pictures
File Info
Updated:05-24-09 02:03 PM
Created:unknown
Downloads:7,587
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)


Post A Reply Comment Options
Unread 02-25-09, 03:30 PM  
Maldivia
A Deviate Faerie Dragon
AddOn Author - Click to view AddOns

Forum posts: 12
File comments: 31
Uploads: 5
Originally posted by galmok
Do you intend to distribute LibTradeLinks as a stand-alone library? Also, I'd like to include LibTradeLinks with GuildAds to help cut down on the storage needed (and communication needed). LibTradeLinks could assist with that. :-)
Was my plan, yes - never got around to it though

But feel free to include the lib in your addon if you like, until I find time to set it up as stand-alone.
Report comment to moderator  
Reply With Quote
Unread 02-27-09, 01:34 AM  
orionshock
A Wyrmkin Dreamwalker
 
orionshock's Avatar
AddOn Author - Click to view AddOns

Forum posts: 50
File comments: 72
Uploads: 4
Originally posted by galmok
Do you intend to distribute LibTradeLinks as a stand-alone library? Also, I'd like to include LibTradeLinks with GuildAds to help cut down on the storage needed (and communication needed). LibTradeLinks could assist with that. :-)

Coupled with LibPeriodicTable, it is possible to get item-ids from the enchant-ids provided by LibTradeLinks :-)
honestly it is. All you'd have to do is run a data miner on wowhead and cross reference it with the creating spell. Then include that lookup in the lib data. Then when it creates the spell table from decoding it, it could provide that id as the value instead of a 1. IMO best thing to do would be to get the resultant item's ID, and the Orange/Yellow/Green/Gray crafting levels for that item.

From that you can infer if the person can skill up off it or not.. But that's alot of data to ask for in this lib
Report comment to moderator  
Reply With Quote
Unread 04-19-09, 07:21 AM  
galmok
A Defias Bandit

Forum posts: 2
File comments: 55
Uploads: 0
What does purgeNonRecipe remove?

What does purgeNonRecipe actually remove from the tradelink table? Only items that are not valid anymore or also some valid items?
Report comment to moderator  
Reply With Quote
Unread 04-20-09, 05:19 AM  
Maldivia
A Deviate Faerie Dragon
AddOn Author - Click to view AddOns

Forum posts: 12
File comments: 31
Uploads: 5
Re: What does purgeNonRecipe remove?

Originally posted by galmok
What does purgeNonRecipe actually remove from the tradelink table? Only items that are not valid anymore or also some valid items?
The trade-link also contains the spells for the different skill-levels of the tradeskill (apprentice, expert, master, Potion Master, Elixir Master etc). the flag should remove those.
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. :-)
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.
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: 5
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).
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?
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.
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.
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: 5
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.
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.
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 ;-)
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: 5
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.
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?
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: