LibTourist-3.0
LibTourist is a library that provides information about zones, instances, transports and more.
For zones, instances, complexes (like Caverns of Time), arenas and battlegrounds, LibTourist can provide level range, faction, size, location and connections with other zones, as well as instance group sizes, instance entrance portal coordinates and battle pet level ranges, if applicable. LibTourist supports localization.
Color-coding for level ranges and zone names is available.
Relationships between continents, zones and instances can be provided, i.e. which instances are located in a specific complex, in which continent resides a zone and so on. In addition, a large number of iterations is available allowing addons to browse through subsets of the zone data.
The library contains information about connections between zones, including transports like zeppelins, boats and portals. These connections can be used to calculate a route between two zones. LibTourist can also be used for distance calculations between coordinates.
Furthermore, LibTourist can provide data about flight nodes and gathering profession skills (Mining, Herbalism, Skinning).
An extensive API allows the addon developer to query LibTourist in many ways.
See the API Reference page for detailed information.
NOTE: LibTourist should not be installed separately as it does not add anything to the game on its own. LibTourist is not an addon but a library, to be referenced and used by addons (like ZoneInfo 2).
WoW Cataclysm Classic:
Please refer to the LibTourist Classic (Cataclysm) page for the Cataclysm Classic version of LibTourist.
WoW Classic Era:
Please refer to the LibTourist Classic Era page for the Classic Era version of LibTourist.
Oh... but I found a way to open the profession panel... you need to use the OnUpdate handler to do it and it is more than 1 step,,, but it works
something like the following and the delays between each stage are requires as too much faster throws errors... It does work though and even supports Skillet lol
Just set your OnUpdate handler to the initDataOnUpdate and you get your data... and the bonus is that I found the data updates afterwards without having to re-open the panel... So you skill up and the data is up to date... I guess if I am going to share how to do this I should come up with a way to check if it has been done so every addon that needs the info doesn't do it... or you get 10 addons opening and closing the professions panel. I guess the best way would be to query the persons professions, check one against the skill line data and see if they match. If they do then no need to open the panel. Guess I will have to work that into my addon... but anyways here is the opening code I use
In reply to billtopia:
Hi billtopia,
Thank you for sharing this! I will definitely give it a try.
Currently LibTourist only features methods that query the profession data, there is no functionality that pushes data or updates. It's something to consider for the future but at the moment all I need is a profession journal to be opened once to make the skill levels available in the API.
It doesn't matter which addon does that, and a whole bunch of addons flapping the professions panel is indeed undesirable... So, a way to check whether the API has been populated would be nice.
Unfortunately, there is no difference between data returned by an unpopulated API and data returned for a skill the character does not possess. In both cases 0 is returned for the three skill level variables, and all other data is available. Sigh, that's so Blizzard... Another fun fact: the API is not populated when you open the Archaeology panel.
Anyway, you said:
Can you elaborate that? As far as I know there's only one source of skill levels (skillLevel, maxSkillLevel and skillModifier) so how does that tell us if the API has been populated with skill level values?
I'd think the only way would be to check all skill lines until you find a skill level greater than 0, assuming the character has at least one profession. If you find one, the panel has been opened...
One other thing... is it necessary to use OnUpdate or can a Ticker be used as well? Previously I used a TickerCallBack for the procedure to call OpenTradeSkill and CloseTradeSkill (and mute/unmute the sound effects).
In reply to Odica_Jaedenar:
Well you first will have to call
the return values are index positions that only really apply to the following command.
using the indexes returned from the first function. That will return the data for the highest (by expansion) trained skills. You can compare the data that way.
You could also do an event handler for TRADE_SKILL_SHOW to stop your opening of the Professions Frame if the event fires before you open the Professions Frame...
I suppose you could use a ticker with a coroutine or something... It doesn't need to be done in an OnUpdate but it is an easy way to do it if you happen to already have a frame... I also did it by frames instead of by time as it is an easier method than by time. Time would require some sort of control variable and more work (although not much more) where frames is just if it is a specific frame count for each step...
In reply to billtopia:
Interesting... If I use skillLine from
...as input for...
then professionInfo.skillLevel often does not match skillLevel returned by GetProfessionInfo when the API has been populated.
The skillLine ID returned by GetProfessionInfo is that of the base skill line, but the skillLevel it returns is the level for the current expansion skill line... Weird.
Nevertheless, if GetProfessionInfo returns a skillLevel > 0 and GetProfessionInfoBySkillLineID returns 0, we know the API has not yet been polulated and the panel should be opened.
Hi. I`m not sure where is problem, but after latest library update I begun to get error:
Message: .../FishingBuddy/Libs/LibTourist-3.0/LibTourist-3.0.lua:2573: bad argument #1 to 'pairs' (table expected, got nil)
Time: Fri Nov 18 17:51:38 2022
Count: 1
Stack: .../FishingBuddy/Libs/LibTourist-3.0/LibTourist-3.0.lua:2573: bad argument #1 to 'pairs' (table expected, got nil)
[string "=[C]"]: in function `pairs'
[string "@Interface/AddOns/FishingBuddy/Libs/LibTourist-3.0/LibTourist-3.0.lua"]:2573: in function `CreateLocalizedZoneNameLookups'
[string "@Interface/AddOns/FishingBuddy/Libs/LibTourist-3.0/LibTourist-3.0.lua"]:4474: in main chunk
Locals: (*temporary) = nil
(*temporary) = "table expected, got nil"
= <function> defined =[C]:-1
P.S. I was trying delete Cash folder. No luck... Author of FishingBuddy is telling, that it isn`t his mistake... I`m playing on RU Locale server. Excuse me, please...May be You can help.
In reply to BloodyFess:
Hi BloodyFess,
I thought I fixed this bug in LibTourist but somehow the fix did not make it into the release. I'll reapply the fix and create a new release of LibTourist.
UPDATE:
The issue should be fixed in the latest release of LibTourist:
WoW-10.0.2-release1
Keep an eye on new (beta) releases of FishingBuddy, the fixed version of LibTourist should be included in the next FB release.
Regards,
Odica
Can we see what phase of the map we're in? Wowhead shows the phases in the maps with the NPC pins, so I was looking for an addon with this info!
In reply to Pyrefox:
Such information could be valuable for LibTourist so I looked into it...
I've been digging in the database (at wow.tools) to figure out how phasing is implemented and if a phase can be identified. There is a 'Phase' table but a phase is just an ID, it has no name or description. There are 15,000 (!) phase IDs of which 33 are used for 14 UIMaps in total. So I can compile a short list of 14 areas that have more than one phase but that list seems to be incomplete. For example, Uldum is on the list, but the Vale of Eternal Blossoms is not. Confusing.
The other part of the problem is how to detect which phase is the currently active one. For this I've been digging through the WoW API but haven't found what I'm looking for, yet.
In reply to Odica_Jaedenar:
Thanks for the reply!
Yeah, from what I've seen in wowhead, it's only a number... they didn't name the phases. But just having a little discrete line with it showing should be enough if used along with the database.
Hope you manage to find a way to fetch that info! :)
Any ideas why the twitch app won't seem to register that I updated this addon (or that it just doesn't update correctly)? The version twitch say I have are the alpha r238 and the latest are 8.3-beta2, and it appears to be the same r238 when I try to download the beta2 version from this page.
In reply to DarkLimpan:
Hi there,
I am not familiar with the Twitch updater so I am not sure how it compares versions.
But, LibTourist-3.0 is under SVN and when under SVN the way to create a beta release is to tag an existing release (in this case alpha r238) "as beta". So, the files in r238 and 8.3-beta2 are indeed equal. The same file has effectively been released twice, once as alpha and once as beta. In other words: Twitch is right, you already have the latest version.
I will remove r238 from the release list to avoid others from running into the same issue.
Hope this answers your question,
best regards,
Odica
In reply to Odica_Jaedenar:
Hi again.
I just tried to have the twitch updater do it again and when I refresh, it tells me r238-alpha is installed and beta2 is available in the main window. But when I click its page in the app, r238 is gone from the list (as you removed it) and beta2 is not installed. It's like it doesn't register the update or something? It's just going in a loop.
In reply to DarkLimpan:
Please be aware that LibTourist is not an addon, it's a library that can provide data for other addons. There is no need to install it separately because LibTourist in itself does not add anything to WoW. Instead, it is used by other addons and included in their install packages if required.
The only reason for downloading LibTourist separately, is if you are an addon developer and want to use the functionalities of LibTourist in one of your addons. Even then, there is no need to install LibTourist as an addon, as it is supposed to be used as a part of the source code of the addon you're developing.
In other words: you might as well uninstall it.
An example of an addon that uses LibTourist as data provider is ZoneInfo 2, which requires LibTourist to function. If you install ZoneInfo, the latest version of LibTourist will come along with it.
Hope this helps :-)
Odica
In reply to Odica_Jaedenar:
I understand now. I do have addons that use this lib (iLocation for example), I just didn't know I didn't need to have it installed seperately. XD
In reply to DarkLimpan:
You're welcome ;-)
Yes: https://www.wowace.com/projects/libtourist-classic
Any version of this for Classic floating around yet?
In reply to mytwobits:
Not yet but we're working on it.
In reply to Odica_Jaedenar:
I have not messed with addons/lua in a few years. Did the api for IterateRecommendedInstantces/Zones change at all since 6.0?
Was taking a quick stab at adding back in fishing and changing the zone levels, but the basic display seems to also no longer work.
In reply to mytwobits:
Hi, I have tested IterateRecommendedZones and IterateRecommendedInstances and both still work. The API didn't change since 6.0 but the behavior has changed because zone levels are now scaled (within certain ranges). Therefore, the function now returns the names of the zones that scale exactly to the player's current level.
I am not sure what you mean by 'basic display'. Are you referring to an addon that uses LibTourist as a library?