Script name: Moonlight Data Script: items = {rift = {}, room = {}, inv = {}} items.properties = { m = "denizen", f = "filled", W = "wearable", w = "worn", c = "container", e = "edible", g = "groupable", r = "riftable", t = "takeable", } items.setproperties = function (location, id) items[location][id].properties = {} for k, v in pairs (items.properties) do if string.match(items[location][id].attrib, k) then items[location][id].properties[v] = true end -- if end -- if if items[location][id].properties.container then items[location][id].contents = function () return items["rep"..id] end end -- if end -- if Script name: GetItemsList Registered Event Handler: gmcp.Char.Items.List Script: GetItemsList = function () local x = gmcp.Char.Items.List items[x.location] = {} for k, v in ipairs (x.items) do items[x.location][v.id] = {} items[x.location][v.id].name = v.name if v.attrib then items[x.location][v.id].attrib = v.attrib items.setproperties (x.location, v.id) if items[x.location][v.id].properties.container then sendGMCP ("Char.Items.Contents " .. v.id) end -- if end -- if end -- for GMCPTargetting () moonlightUIUpdateRoom () end -- func Script name: GetItemsAdd Registered Event Handler: gmcp.Char.Items.Add Script: GetItemsAdd = function () local x = gmcp.Char.Items.Add if not items[x.location] then items[x.location] = {} end items[x.location][x.item.id] = {} items[x.location][x.item.id].name = x.item.name if x.item.attrib then items[x.location][x.item.id].attrib = x.item.attrib items.setproperties (x.location, x.item.id) if items[x.location][x.item.id].properties.container then sendGMCP ("Char.Items.Contents " .. x.item.id) end -- if end -- if GMCPTargetting () moonlightUIUpdateRoom () end -- func Script name: GetItemsRemove Registered Event Handler: gmcp.Char.Items.Add Script: GetItemsRemove = function () local x = gmcp.Char.Items.Remove if not items[x.location] then items[x.location] = {} end items[x.location][x.item.id] = nil if items["rep"..x.item.id] then items["rep"..x.item.id] = nil end GMCPTargetting () moonlightUIUpdateRoom () end -- func