arkayenro / arkinventory

A World of Warcraft Inventory mod for Retail, Burning Crusade, and Classic
108 stars 14 forks source link

[BUG] i.osd.bonusid throws error #1794

Closed Jabberie closed 1 year ago

Jabberie commented 1 year ago

What version number you are using? v31016 [Dragonflight]

What game client are you playing? Retail, Wrath, Classic / Live, PTR, Beta Retail Live

What language is the game client set to? EN

Describe the bug Attemption to use i.osd.bonusid in a rule Error [01:28:36] ArkInventory: ERROR> ...rface/AddOns/ArkInventoryRules/ArkInventoryRules.lua:267: [string "return( i.info.class == "item" and i.info.e..."]:1: attempt to index field 'bonusid' (a nil value)

To Reproduce Steps to reproduce the behaviour, if possible: use the following example from the wiki in a rule i.info.class == "item" and i.info.equiploc ~= "" and i.osd.bonusid[512]

Screenshots If applicable, add screenshots to help explain your problem. image

Additional context Add any other context about the problem here. I am not very experiences creating rules so it's completely possible I'm doing it wrong. I'm attempting to categorise 10.1 items into their base upgrade path (explorer, adventurer,.., hero) by checking the bonus ids on the item. I have worked out the ids already, just need the rule now. Thanks in advance.

arkayenro commented 1 year ago

everything in the bags is an item so no point checking that equip and bonusid already have functions so no need to access the osd values

equip() and bonus(123,456)

https://github.com/arkayenro/arkinventory/wiki/RuleFunction_EquipLocation https://github.com/arkayenro/arkinventory/wiki/RuleFunction_Bonus

Jabberie commented 1 year ago

Aah right, thanks for that.

The code above is in the WIKI, I guess I just had to keep looking. :)

Jabberie commented 1 year ago

Got this working great. For anyone interested:

Explorer - Item level 376 to 398 equip() and bonus(9294, 9295, 9296, 9297, 9298, 9299, 9300, 9301)

Adventurer - Item level 389 to 411 equip() and bonus(9302, 9303, 9304, 9305, 9306, 9307, 9308, 9309)

Veteran - Item level 402 to 424 equip() and bonus(9313, 9314, 9315, 9316, 9317, 9318, 9319, 9320)

Champion - Item level 415 to 437 equip() and bonus(9321, 9322, 9323, 9324, 9325, 9327, 9328, 9329)

Hero - Item level 428 to 441 equip() and bonus(9330, 9331, 9332, 9333, 9334, 9435, 9448, 9439, 9449, 9440, 9450, 9441, 9451, 9442, 9447)

I'm not 100% on the hero gear just yet but it should work.