In a previous post here: http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=12569 Nick showed me how to sort my table by adding keys or extract information. What I am trying to do now is match a particular word from a string of words in a table. Here is my current table.
Looking at the above table "flags" contains a lot of information. I would like to match the word "precious" so the script prints only the item(s) that have this keyword. For now a simple, true/false would work. Does lua provide a statement that allows this sort of data matching?
equipinform = {
["468263929"] = {
level=1,
weight=1,
wearloc="sleeping",
details_captured=true,
stats = {},
owner="Strazor",
objectid="12569898",
flags="glow, hum, magic, held, nopurge, burn-proof, nolocate, solidified, resonated, illuminated, v3, precious",
itemtype="Furniture",
container_id="worn",
resists = {},
name="V3 Trivia Sleeping Bag",
score="0",
},
["965742031"] = {
level=41,
weight=0,
wearloc="neck",
details_captured=true,
stats = {
damageroll=29,
luck=2,
moves=-30,
wisdom=2,
intelligence=2,
hitroll=1,
hitpoints=25,
},
owner="",
objectid="125689755",
flags="unique, glow, hum, magic, held, burn-proof, solidified, illuminated, v3, searchable",
itemtype="Armor",
container_id="worn",
resists = {},
name="(>Asura's Azurite Pearl<)",
score="205",
}
} -- end of equipinform
tprint (equipinform)
Looking at the above table "flags" contains a lot of information. I would like to match the word "precious" so the script prints only the item(s) that have this keyword. For now a simple, true/false would work. Does lua provide a statement that allows this sort of data matching?