Thread Tools Display Modes
09/18/20, 10:44 AM   #1
gimmy77
 
gimmy77's Avatar
Join Date: Apr 2019
Posts: 8
Question LibAlchemy error LUA

Hi guys, i receive this error many times, for example when i view my inventory or random. Any idea? Thanks.

Code:
user:/AddOns/LibAlchemy/LibAlchemy.lua:172: operator + is not supported for number + nil
stack traceback:
user:/AddOns/LibAlchemy/LibAlchemy.lua:172: in function 'LibAlchemy:getCraftingCost'
|caaaaaa<Locals> self = [table:1]{}, reagentsTable = [table:2]{1 = 150670}, itemLink = "|H0:item:76827:30:3:0:0:0:0:0:...", mainID = 76827, solvent = 3, CP = 27, result = -nan(ind), type = 2 </Locals>|r
user:/AddOns/AlchemyTooltips/AlchemyTooltips.lua:239: in function 'checkPotion'
|caaaaaa<Locals> itemLink = "|H0:item:76827:30:3:0:0:0:0:0:...", id = 132608, mainID = 76827, effect1 = "RavageHealth", effect2 = "RavageStamina", calculation = 2, BestCombination = [table:2] </Locals>|r
user:/AddOns/AlchemyTooltips/AlchemyTooltips.lua:305: in function 'SetBagItem'
|caaaaaa<Locals> self = ud </Locals>|r
EsoUI/Ingame/Inventory/InventorySlot.lua:2043: in function '(anonymous)'
|caaaaaa<Locals> inventorySlot = ud, bag = 1, index = 91 </Locals>|r
EsoUI/Ingame/Utility/ZO_SlotUtil.lua:14: in function 'RunHandlers'
|caaaaaa<Locals> handlerTable = [table:3]{}, slot = ud, handlers = [table:4]{}, i = 1 </Locals>|r
EsoUI/Ingame/Inventory/InventorySlot.lua:2404: in function 'ZO_InventorySlot_OnMouseEnter'
|caaaaaa<Locals> inventorySlot = ud, buttonPart = ud, listPart = ud </Locals>|r
(tail call): ?
(tail call): ?
ZO_StackSplitSource_MouseEnter:3: in function '(main chunk)'
|caaaaaa<Locals> self = ud </Locals>|r
  Reply With Quote
09/18/20, 11:04 AM   #2
Rhyono
AddOn Author - Click to view addons
Join Date: Sep 2016
Posts: 659
You should ask on the addon: https://www.esoui.com/downloads/info....html#comments
  Reply With Quote
09/19/20, 06:54 AM   #3
Hyperioxes
 
Hyperioxes's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2020
Posts: 6
Can you specify which items are causing this error?
  Reply With Quote
09/19/20, 08:54 AM   #4
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
Seems to be a poison.

More details how I noticed it:
The error messages says itemId "76827" in the itemLink "|H0:item:76827:30:3:0:0:0:0:0:...", so the link should be something like this:
Code:
|H1:item:76827:30:3:0:0:0:0:0:0:0:0:0:0:0:1:0:0:1:0:0:0|h|h
Posted it into the chat box ingame and I got:
Damage Health Poison I
  Reply With Quote
09/19/20, 03:48 PM   #5
Hyperioxes
 
Hyperioxes's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2020
Posts: 6
I crafted that poison (or similar one at least, as the one in your item link has no effects on it when you check its tooltip, so I just crafted one with ravage health effect) and it isn't causing any errors for me. Also judging from where the error occured it has something to do with solvents. Instead of extracting solvent's price from a table it extracts nil so first I assumed there was some solvent I missed but I crafted poison and potion with every possible solvent and it didn't cause me any bugs. I'm assuming it could be some bug related to pricing addons but I'm using TTC and MM and even though Master Merchant is missing prices for some solvents it isn't causing any bugs, can't check for ATT.
  Reply With Quote
09/19/20, 04:05 PM   #6
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
Maybe it's due to different character setup where not all solvents are known or not all alchemy levels etc. were unlocked already.
You could add a ~= nil check to prevent the error message and instead send a message with the information you need to the chat and let users send this message to you.
Or use LibDebugLogger in your addon to log those errors to the SavedVariables and let them send you teh file or uplaod them at sirinsidiators LibDebugLogger online viewer: https://sir.insidi.at/or/logviewer/
  Reply With Quote
09/21/20, 05:54 AM   #7
gimmy77
 
gimmy77's Avatar
Join Date: Apr 2019
Posts: 8
Red face

Originally Posted by Baertram View Post
Maybe it's due to different character setup where not all solvents are known or not all alchemy levels etc. were unlocked already.
You could add a ~= nil check to prevent the error message and instead send a message with the information you need to the chat and let users send this message to you.
Or use LibDebugLogger in your addon to log those errors to the SavedVariables and let them send you teh file or uplaod them at sirinsidiators LibDebugLogger online viewer: https://sir.insidi.at/or/logviewer/
Thanks guys for all, i try the debug logger.
  Reply With Quote
09/23/20, 11:29 AM   #8
Hyperioxes
 
Hyperioxes's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2020
Posts: 6
It's super weird. All solvents' prices are saved like:
Lua Code:
  1. --Solvents
  2.     LibAlchemy.solvents[3][1] = LibPrice.ItemLinkToPriceGold("|H0:item:883:30:1:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0|h|h") --Natural Water
  3.     LibAlchemy.solvents[3][2] = LibPrice.ItemLinkToPriceGold("|H0:item:75357:30:1:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0|h|h") --Grease
  4.     LibAlchemy.solvents[10][1] = LibPrice.ItemLinkToPriceGold("|H0:item:1187:30:1:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0|h|h")
  5.     LibAlchemy.solvents[10][2] = LibPrice.ItemLinkToPriceGold("|H0:item:75358:30:1:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0|h|h")
  6.     LibAlchemy.solvents[20][1] = LibPrice.ItemLinkToPriceGold("|H0:item:4570:30:1:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0|h|h")
  7.     LibAlchemy.solvents[20][2] = LibPrice.ItemLinkToPriceGold("|H0:item:75359:30:1:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0|h|h")
  8.     LibAlchemy.solvents[30][1] = LibPrice.ItemLinkToPriceGold("|H0:item:23265:30:1:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0|h|h")
  9.     LibAlchemy.solvents[30][2] = LibPrice.ItemLinkToPriceGold("|H0:item:75360:30:1:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0|h|h")
  10.     LibAlchemy.solvents[40][1] = LibPrice.ItemLinkToPriceGold("|H0:item:23266:30:1:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0|h|h")
  11.     LibAlchemy.solvents[40][2] = LibPrice.ItemLinkToPriceGold("|H0:item:75361:30:1:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0|h|h")
  12.     LibAlchemy.solvents["CP"][75][1] = LibPrice.ItemLinkToPriceGold("|H0:item:23267:30:1:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0|h|h")
  13.     LibAlchemy.solvents["CP"][75][2] = LibPrice.ItemLinkToPriceGold("|H0:item:75362:30:1:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0|h|h")
  14.     LibAlchemy.solvents["CP"][79][1] = LibPrice.ItemLinkToPriceGold("|H0:item:23268:30:1:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0|h|h")
  15.     LibAlchemy.solvents["CP"][79][2] = LibPrice.ItemLinkToPriceGold("|H0:item:75363:30:1:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0|h|h")
  16.     LibAlchemy.solvents["CP"][84][1] = LibPrice.ItemLinkToPriceGold("|H0:item:64500:30:1:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0|h|h")
  17.     LibAlchemy.solvents["CP"][84][2] = LibPrice.ItemLinkToPriceGold("|H0:item:75364:30:1:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0|h|h")
  18.     LibAlchemy.solvents["CP"][258][1] = LibPrice.ItemLinkToPriceGold("|H0:item:64501:30:1:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0|h|h") --Lorkhan Tears
  19.     LibAlchemy.solvents["CP"][258][2] = LibPrice.ItemLinkToPriceGold("|H0:item:75365:30:1:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0|h|h") --Alkahest

I turned off all trading addons, and used /script to check values of all of those. The first two of them (Grease and Natural Water) returned nil, while all the others returned 1. I have no idea why does that happen, I'll look into LibPrice when I have more free time, as for now I'm just gonna add exceptions to these 2 in LibAlchemy and AlchemyTooltips

Lua Code:
  1. LibAlchemy.solvents[3][1] = LibPrice.ItemLinkToPriceGold("|H0:item:883:30:1:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0|h|h") or 0--Natural Water
  2. LibAlchemy.solvents[3][2] = LibPrice.ItemLinkToPriceGold("|H0:item:75357:30:1:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0|h|h") or 0--Grease
  Reply With Quote
09/23/20, 12:00 PM   #9
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
If the return value is nil the library most probably cannot find any data of these items, whereever it reads them from (MM, TTC data?).

A hint about the itemlinks.
Instead of redundantly re-using the same itemlink, where only the itemId changes, you could use string.format as a function.


Current:
Lua Code:
  1. var1 = "|H0:item:883:30:1:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0|h|h"
  2. var2 = "|H0:item:12345:30:1:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0|h|h"
  3. var3 = "|H0:item:99999:30:1:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0|h|h"

New:
Lua Code:
  1. local function buildItemLinkForItemId(itemId)
  2.  return string.format("|H0:item:%d:30:1:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0|h|h", tonumber(itemId))
  3. )
  4. end
  5.  
  6. var1 = buildItemLinkForItemId(883)
  7. var2 = buildItemLinkForItemId(12345)
  8. var3 = buildItemLinkForItemId("99999")
  Reply With Quote

ESOUI » AddOns » AddOn Help/Support » LibAlchemy error LUA

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off