# Script Integrations

If you want to use your own server scripts, the original documentation points to these integration locations:

* Inventory: `modules/inventory/server.lua`
* Target: `modules/target/client.lua`
* Notify, progressbar, skillbar, and helper functions: `modules/utils/client.lua`
* Server-side helper functions: `modules/utils/server.lua`

## Inventory Integration

File: `modules/inventory/server.lua`

Use this file if your server does not match the default inventory logic.

This usually means adapting:

* Give item
* Remove item
* Check item
* Count item

Basic example:

```lua
function Inventory.giveItem(source, itemName, count)
    return exports['my_inventory']:AddItem(source, itemName, count)
end
```

## Target Integration

File: `modules/target/client.lua`

If you use a custom target system, adapt your zone and interaction logic here.

This usually includes:

* Adding zones
* Removing zones
* Adding entity interactions
* Removing entity interactions

## Notify, Progressbar, Skillbar

File: `modules/utils/client.lua`

Most custom integrations happen here.

Common changes:

* Replace notify logic
* Replace progressbar logic
* Replace skillcheck logic
* Replace any helper functions used during job flow

Notify example:

```lua
function Utils.notify(title, type, duration, description)
    exports['my_notify']:Send({
        title = title,
        description = description,
        type = type,
        duration = duration
    })
end
```

Progressbar example:

```lua
function Utils.progressBar(data)
    return exports['my_progressbar']:Progress(data)
end
```

## Server-Side Helpers

File: `modules/utils/server.lua`

Use this file if your server needs custom server-side helper behavior.

Common examples:

* Progress or reward helper logic
* Server-side notifications
* Shared job utilities

## Safest Way To Integrate

Use this order:

1. Read the existing function and keep the same input/output behavior.
2. Replace only the integration-specific lines with your own export or event.
3. Do not change return types unless you know the script expects it.
4. Test the full job flow in game.

{% hint style="success" %}
If your server already uses the same common inventory, target, and utility stack expected by the resource, you may only need small changes or no changes at all.
{% endhint %}


---

# 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.0resmon.org/0resmon/0r-resources/0r-excavatorjob/integrations.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.
