Download
(153 Kb)
Download
Updated: 02/28/20 02:09 PM
Pictures
File Info
Compatibility:
Harrowstorm (5.3.5)
Updated:02/28/20 02:09 PM
Created:10/26/18 04:58 PM
Monthly downloads:1,670
Total downloads:137,266
Favorites:64
MD5:
LibCraftText  Popular! (More than 5000 hits)
Version: 5.3.1
by: ziggr [More]
Are you an add-on developer who compares quest names against a list of strings to figure out which quest is a daily crafting writ? Master writ?

This is a library of localized strings for crafting quest recognition, and parser code that uses those strings to convert "Craft Normal Ancestor Silk Shoes" into { item=SHOES, material=ANCESTOR_SILK }

Example dump of tables from parsing some daily crafting writ quests, in EN English, DE German, and JA Japanese:


Lua Code:
  1. LibCraftText.DailyQuestNameToCraftingType("Enchanter Writ")
  2. ---> returns CRAFTING_TYPE_ENCHANTING
  3.  
  4. LibCraftText.ParseDailyCondition(CRAFTING_TYPE_ENCHANTING
  5.             , "Craft Superb Glyph of Health with Ta: 0/1")
  6. ---> returns table:
  7. {
  8.     essence = { name="Oko",    item_id=45831, ... }
  9.     potency = { name="Rejera", item_id=64509, ... }
  10.     aspect  = { name="Ta",     item_id=45850, ... }
  11. }
  12.  
  13. LibCraftText.ParseDailyCondition(CRAFTING_TYPE_CLOTHIER
  14.             , "Craft Normal Ancestor Silk Shoes: 0/1")
  15. ---> returns table:
  16. {
  17.     item     = { name="shoes",         mat_set_id=mat_lgt, pattern_index=3, ... }
  18.     material = { name="Ancestor Silk", mat_set_id=mat_lgt, level_index=10, ... }
  19. }
  20.  
  21. LibCraftText.ParseDailyCondition(CRAFTING_TYPE_ALCHEMY
  22.             , "Acquire Mudcrab Chitin: 3/3")
  23. ---> returns table:
  24. {
  25.     item    = { name = "Mudcrab Chitin", item_id=77591, ... }
  26. }
  27.  
  28. -- and if your ESO UI is set to DE German or some other supported
  29. -- language, then the name strings change, but the numbers don't:
  30.  
  31. LibCraftText.ParseDailyCondition(CRAFTING_TYPE_ALCHEMY
  32.             , "Besorgt etwas Schlammkrabbenchitin: 3/3")
  33. ---> returns table:
  34. {
  35.     item    = { name = "Schlammkrabbenchitin", item_id=77591, ... }
  36. }

GitHub repo at https://github.com/ziggr/ESO-LibCraftText.

Languages Supported
5.3.1 2020-02-28
  • LibStub purge

5.0.1 2019-05-05
  • Version and API bump.
  • ## IsLibrary: true so that Elsweyr can identify this as a library.

4.2.5 2018-11-25
  • Example2 code for daily writ quests
  • Example3 code for master writ quests
  • I finally caved in and added for EachCondition(quest_index) utility code for iterating over quest conditions. If I had to write that loop a dozen times, other folks probably will, too.
  • Also added ParseQuest(quest_index) to use that iterator on a quest and return a list of its parsed conditions.

4.2.4 2018-11-12
  • Example1 code
  • Full parse of all daily crafting conditions, returning results from
  • Giant tables of crafting items and materials.

4.2.3 2018-10-27
  • ES Spanish
  • RU Russian
  • JA Japanese
  • All daily and master crafting writ names translated.
  • Still missing Rolis dialog, will deal with later if/when I can get a
    guild hall's tables to actually work on PTS.

4.2.2 2018-10-27
  • DE German and FR French strings added for daily and master writ
    quest names.
  • Lots of behind-the-scenes automation to help collect translations from
    ESO client and use them to generate translation files. See GitHub repo
    for details.

4.2.1 2018-10-26
  • Initial release, en-english strings
Optional Files (0)


Archived Files (6)
File Name
Version
Size
Uploader
Date
5.0.1
152kB
ziggr
05/05/19 03:37 PM
4.2.5
152kB
ziggr
11/25/18 07:47 PM
4.2.4
92kB
ziggr
11/12/18 05:18 PM
4.2.3
10kB
ziggr
10/28/18 12:07 AM
4.2.2
5kB
ziggr
10/27/18 10:16 PM
4.2.1
4kB
ziggr
10/26/18 04:58 PM


Post A Reply Comment Options
Unread 01/02/23, 02:26 AM  
hotrockin

Forum posts: 0
File comments: 9
Uploads: 0
Name-Change

Hello,
there is a mistake in the LibCraftText, de.lua since an update. In Line 406 the rune-name is not anymore "abschirmens", now it is "abstreifung". In Line 402 it is "waffenkostenminderung" instead of "fähigkeitenkostenminderung".
Last edited by hotrockin : 03/05/23 at 02:24 PM.
Report comment to moderator  
Reply With Quote
Unread 09/02/20, 07:42 PM  
ziggr
 
ziggr's Avatar
AddOn Author - Click to view AddOns

Forum posts: 27
File comments: 275
Uploads: 10
Re: Thoughts?

No idea. Line 357 lands in the middle of a multi-line statement, shouldn't even be part of a stack trace. The only nil dereference I can think of would be if LibCraftText or LibCraftText.MATERIAL would be nil, but that makes no sense.

Lua Code:
  1. 352 function Daily.ParseConditionGlyph(cond_text)
  2. 353     local self = LibCraftText
  3. 354     local m    = LibCraftText.MATERIAL -- for less typing
  4. 355     local ESSENCE_LIST = {
  5. 356                            m.DENI    -- stamina
  6. 357                          , m.MAKKO   -- magicka    <-- HERE ???
  7. 358                          , m.OKO     -- health
  8. 359                          }
  9. 360     local lang    = self.CurrLang()
  10. 361     local potency = self.ParseEnchantingPotency(cond_text)
  11. ...     ...

I also skimmed through 2 years of git history on this file, and line 357 never seems to be something that would cause that error. So I doubt it's caused by an old version of LibCraftText unless it's a really old version in which case, uh, maybe run Minion and update all add-ons at least once per year? But I doubt that's it.

--Z

Originally Posted by Argusus
I had someone report this error to me. Do you have any suggestions for a work around? I can't seem to reproduced this error.

Code:
user:/AddOns/LibCraftText/LibCraftText_Internal.lua:357: attempt to index a nil value
stack traceback:
user:/AddOns/LibCraftText/LibCraftText_Internal.lua:357: in function 'Daily.ParseConditionGlyph'
|caaaaaa<Locals> cond_text = "Craft Superb Glyph of Stamina ...", self = [table:1]{} </Locals>|r
(tail call): ?
Report comment to moderator  
Reply With Quote
Unread 09/01/20, 09:32 PM  
Argusus
AddOn Author - Click to view AddOns

Forum posts: 120
File comments: 113
Uploads: 2
Thoughts?

I had someone report this error to me. Do you have any suggestions for a work around? I can't seem to reproduced this error.

user:/AddOns/LibCraftText/LibCraftText_Internal.lua:357: attempt to index a nil value
stack traceback:
user:/AddOns/LibCraftText/LibCraftText_Internal.lua:357: in function 'Daily.ParseConditionGlyph'
|caaaaaa<Locals> cond_text = "Craft Superb Glyph of Stamina ...", self = [table:1]{} </Locals>|r
(tail call): ?
(tail call): ?
(tail call): ?
user:/AddOns/CraftingWritAssistant/CraftingWritAssistant.lua:471: in function 'BindEnchantingDetails'
|caaaaaa<Locals> craftingType = 3, journalStepText = "Craft Superb Glyph of Stamina ..." </Locals>|r
user:/AddOns/CraftingWritAssistant/CraftingWritAssistant.lua:933: in function 'CraftingWritAssistant.BindWindow'
|caaaaaa<Locals> craftingType = 3, journalIndex = 19, numberOfWritQuests = 7, isMasterQuest = F, isCraftingWritTypeValid = T, hasCraftingTypeActiveWrit = T, isFoundWritNameSearch = F, writName = "Enchanter Writ", writIcon = "/esoui/art/inventory/inventory...", currentStepInfo = "Craft Superb Glyph of Stamina ..." </Locals>|r
user:/AddOns/CraftingWritAssistant/CraftingWritAssistant.lua:973: in function 'CraftingWritAssistant.CraftingStationEnter'
|caaaaaa<Locals> eventCode = 131527, craftingType = 3, sameStation = F, hasThisCraftQuestType = T </Locals>|r
Report comment to moderator  
Reply With Quote
Unread 05/05/19, 08:29 PM  
ziggr
 
ziggr's Avatar
AddOn Author - Click to view AddOns

Forum posts: 27
File comments: 275
Uploads: 10
Originally Posted by Dolgubon
Hey, I'm actually no longer (mostly) using lookup tables for daily writs. Instead, I'm using DoesItemLinkFulfillJournalQuestCondition and doing some loops. So that's an option too.
Clever. A short list of <100 or even <1000 possible matching itemLinks would be far more reliable than regexes and string matching. And perhaps more importantly, immune to the kind of bugs we see in the FR translation where the quest text asks for Spider Silk when it requires Kresh, or fails to specify Oak.

I don't actually use LibCraftText within WritWorthy for writ parsing, or anything, really. I do use LibCraftText for some private add-ons to drive daily writs and Rolis.
Report comment to moderator  
Reply With Quote
Unread 05/05/19, 08:00 PM  
Dolgubon
 
Dolgubon's Avatar
AddOn Author - Click to view AddOns

Forum posts: 408
File comments: 885
Uploads: 21
Hey, I'm actually no longer (mostly) using lookup tables for daily writs. Instead, I'm using DoesItemLinkFulfillJournalQuestCondition and doing some loops. So that's an option too.
Report comment to moderator  
Reply With Quote
Unread 10/28/18, 03:19 AM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4912
File comments: 5990
Uploads: 78
Thanks Ziggr. This will make addon development for the writ stuff easier to support all the given languages!
I hope the devs will find it if they start a project
Report comment to moderator  
Reply With Quote
Unread 10/28/18, 12:16 AM  
ziggr
 
ziggr's Avatar
AddOn Author - Click to view AddOns

Forum posts: 27
File comments: 275
Uploads: 10
6 languages supported

EN DE FR ES RU JA

All official and unofficial translations now supported. I've got the daily and master crafting quest titles for the above six languages.

IT Italian: the translation project hasn't gotten to crafting writs yet, neither daily nor master, so the language file for that is a placeholder for now, filled with EN English strings.

If any translation changes out from under me and breaks this library, let me know and I'll update the library.


Still haven't gotten to Rolis dialog yet. Maybe tomorrow. Maybe not. Depends on how ornery the crafting tables are on PTS.

--Z

PS: the GitHub repo has all the fancy-schmancy automation that I use to scrape translations from the current ESO client and merge them into a database that I use to generate all the language files. Here's the database file.
Lua Code:
  1. LANG_DB = {
  2.   [ 1] = {
  3.              key = "$DAILY_AL"
  4.          ,   en  = "Alchemist Writ"
  5.          ,   de  = "Alchemistenschrieb"
  6.          ,   fr  = "Commande d'alchimie"
  7.          ,   es  = "Encargo de alquimia"
  8.          ,   ru  = "Заказ алхимику"
  9.          ,   ja  = "錬金術師の依頼"
  10.          }
  11. , [ 2] = {
  12.              key = "$DAILY_BS"
  13.          ,   en  = "Blacksmith Writ"
  14.          ,   de  = "Schmiedeschrieb"
  15.          ,   fr  = "Commande de forge"
  16.          ,   es  = "Encargo de herrería"
  17.          ,   ru  = "Заказ кузнецу"
  18.          ,   ja  = "鍛冶師の依頼"
  19.          }
  20. ...
  21. , [23] = {
  22.              key = "$MASTER_WEAPON"
  23.          ,   en  = "A Masterful Weapon"
  24.          ,   de  = "Eine meisterhafte Waffe"
  25.          ,   fr  = "Une arme magistrale"
  26.          ,   es  = "Un arma magistral"
  27.          ,   ru  = "Искусное оружие"
  28.          ,   ja  = "優れた武器"
  29.          }
  30. ...
Report comment to moderator  
Reply With Quote
Unread 10/26/18, 10:27 PM  
ziggr
 
ziggr's Avatar
AddOn Author - Click to view AddOns

Forum posts: 27
File comments: 275
Uploads: 10
Re: Nice lib!

Originally Posted by Phinix
This is a really good idea, kudos.
What will ultimately be required for this to be relevant however is contacting the authors/maintainers of each community language pack (Spanish, Italian, Russian, Japanese) and convincing them to adopt this library as the standard for translating these select writ strings within their mods...
Kudos from Phinix? I'll be insufferably chuffed for days. Thanks!

Good idea about the community language packs. I'll wait until there's a bigger motivation than "Some of Zig's add-ons use it" before pestering them. But I'm adding it as a todo so that I don't forget about it if/when this library gains traction.
Report comment to moderator  
Reply With Quote
Unread 10/26/18, 06:14 PM  
Phinix
 
Phinix's Avatar
AddOn Author - Click to view AddOns

Forum posts: 186
File comments: 1779
Uploads: 32
Nice lib!

This is a really good idea, kudos.

ESO has only three 'official' language modes: English, French, and German. Any other client language relies on 3rd party language pack addons. These translations are created by the community and subject to change, and in some cases there might be multiple different language packs (Japanese for example) to choose from. If an addon looking to track writs doesn't see exactly the right text in the quest name or status, which could be likely with custom translations, then the entire writ tracking functionality of that addon will not work when using that language pack.

Having a library to standardize the text strings used by writ quests to indicate requirements or completion status within each of these community language pack addons would greatly ease the work of other addon authors having to download each custom language pack in turn and find the string (if any) assigned to these values manually (and each time the language packs are updated in perpetuity).

What will ultimately be required for this to be relevant however is contacting the authors/maintainers of each community language pack (Spanish, Italian, Russian, Japanese) and convincing them to adopt this library as the standard for translating these select writ strings within their mods, providing any corrections as needed. That way any addon tracking writ quests could simply and reliably do so in any supported language with minimal additional and repeated upkeep work otherwise required to ensure text string matching didn't break over time and language addon updates.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: