# Codem Inventory

* Go to **codem-inventory/editable/serverexport.lua** add the following code at the end of the file:

```lua
AddEventHandler('inventory:refresh', function()
    local success, items = pcall(MySQL.query.await, 'SELECT * FROM av_items')
    if success and items and next(items) then
        local path = GetResourcePath('codem-inventory')
        for i = 1, #items do
            local item = items[i]
            if not Config.Itemlist[item['name']] then
                Config.Itemlist[item['name']] = {
                    name = item['name'],
                    label = item['label'] or item['name'],
                    weight = item['weight'] and tonumber(item['weight']) or 1000,
                    type = 'item',
                    image = item['name']..'.png',
                    unique = false,
                    useable = true,
                    shouldClose = true,
                    combinable = {},
                    description = item['description'] or ''
                }
                if item.image then
                    PerformHttpRequest(item.image, function (errorCode, resultData, resultHeaders)
                        if errorCode >= 200 and errorCode < 300 then
                            local image = assert(io.open(path..'/html/itemimages/'..item.name..'.png', "wb"))
                            image:write(resultData)
                            image:flush()
                            image:close()
                        end
                    end)
                end
            end
        end
    end
end)
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.av-scripts.com/laptop-pack-v3/business/installation/inventories/codem-inventory.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
