RuleVariables - arkayenro/arkinventory GitHub Wiki
Rule Variables (30708 or higher required)
the rule environment is restricted, it has no access to anything except what i code in. ie you cannot access any Lua functions, just basic operators and the rule functions.
the rule variables are a collection of item properties added to the rule environment that you can access directly when writing your own rule formula. they allow you greater flexibility when writing your formulas.
at the moment there is only one variable available in the rule environment;
i
(table, the items properties)
i.class
(string, object class)i.q
(number, quality)i.name
(string)i.h
(string, hyperlink)i.loc_id
(number, ai window location id)i.bag_id
(number, ai window bag id)i.slot_id
(number, ai slot id)i.ab
(boolean, is accountbound)i.sb
(boolean, is soulbound)i.count
(number)i.r
(boolean, can be read)i.age
(number, seconds since 1900 or something)i.fav
(boolean, is flagged as favourite pets/mount)i.bp
(boolean, is battlepet)i.wp
(boolean, is wild pet)i.osd
(table, see below)i.info
(table, see below)
i.osd
(the object string broken down into its individual components)
i.osd[1..n]
(table, each component of the itemstring, can be numeric or string depending on what it is)i.osd.h
(string, clean itemstring)i.osd.id
(number)i.osd.slottype
(number)
(for an item)
i.osd.h2
(string, internal version of h)i.osd.enchantid
(number)i.osd.gemid[1..4]
(table of number)i.osd.suffixid
(number)i.osd.suffixfactor
(number)i.osd.uniqueid
(number)i.osd.linklevel
(number, noteosd[10]
is reset to 0)i.osd.specid
(number, noteosd[11]
is reset to 0)i.osd.upgradeid
i.osd.sourceid
(number, noteosd[13]
is reset to 0)i.osd.bonusids[id1=true,...,idN=true]
(table of boolean, is nil if no bonus ids)i.osd.upgradelevel
(number)
the remainder (typically the relic weapon gem ids) can only be accessed via their numeric entries. using these may be problematic as the number of properties an item has is not consistent across all of them
(for a keystone)
i.osd.instance
(number, instance id of the dungeon)i.osd.level
(number, mythic+ level)i.osd.status
(number, 1 = active, 2 = depleted)i.osd.bonusids[id1=true,...,idN=true]
(table of boolean, is nil if no affix ids, affix id is the key)
(for a battlepet)
i.osd.species
(number)i.osd.level
(number)i.osd.rarity
(number, pet rarity)i.osd.maxhealth
(number)i.osd.power
(number)i.osd.speed
(number)i.osd.guid
(string)
i.info
(in game information about the object)
i.info.class
(string)i.info.id
(number)i.info.name
(string)i.info.q
(number)i.info.ilvl
(number)i.info.itemtype
(string)i.info.itemtypeid
(number)i.info.itemsubtype
(string)i.info.itemsubtypeid
(number)i.info.stacksize
(number)i.info.equiploc
(string)i.info.texture
(string)i.info.vendorprice
(number, -1 = unsellable)i.info.expansion
(number, 0 = classic, 1 = bc, 2 = wrath, 3 = cata, 4 = pandaria, 5 = draenor, 6 = legion, 7 = bfa, 8 = sl, 9 = df, 10 = ww)i.info.craft
(boolean, is the item a crafting reagent or not)
examples
any item that you can equip, and has a bonus id of 512 (timewarped)
i.info.class == "item" and i.info.equiploc ~= "" and i.osd.bonusid[512]