> For the complete documentation index, see [llms.txt](https://lmadactyl.js.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lmadactyl.js.org/client/utils.md).

# Utils

Utils methods

## Resource Usages

See the resources being used by your server

```javascript
const ptero = require('lmadactyl')
let result = await ptero.client.utils.resourceUsage("https://yourpanel.com", "apikey", "serverId")
console.log(result) //Object
```

| Parameter              | Value                                                     |
| ---------------------- | --------------------------------------------------------- |
| panelURL (Type STRING) | The link to your pterodactyl panel                        |
| apiKey (Type STRING)   | Type 1                                                    |
| serverId (Type STRING) | Your server ID. (<https://yourpanel.com/server/**id>\*\*) |

## Server Console Command.

Run a command in the console

```javascript
const ptero = require('lmadactyl')
let result = await ptero.client.utils.sendConsoleCommand("https://yourpanel.com", "apikey", "serverId", "help", true)
console.log(result) //If an error occurs when displaying the console information, it will return 204 (No content)
```

| Parameter              | Value                                                        |
| ---------------------- | ------------------------------------------------------------ |
| panelURL (Type STRING) | The link to your pterodactyl panel                           |
| apiKey (Type STRING)   | Type 1                                                       |
| command (Type STRING)  | The command you want to run in the console                   |
| serverId (Type STRING) | Your server ID. (<https://yourpanel.com/server/**id>\*\*)    |
| color (Type BOOLEAN)   | If you want to display console colors (Default value: false) |

## View logs

See your console.

```javascript
const ptero = require('lmadactyl')
let result = await ptero.client.utils.logs("https://yourpanel.com", "apikey", "serverId", true)
console.log(result) //If an error occurs when displaying the console information, it will return 204 (No content)
```

| Parameter                | Value                                                                                                                                            |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| panelURL (Type STRING)   | The link to your pterodactyl panel                                                                                                               |
| apiKey (Type STRING)     | Type 1                                                                                                                                           |
| serverId (Type STRING)   | Your server ID. (<https://yourpanel.com/server/**id>\*\*)                                                                                        |
| color (Type BOOLEAN)     | If you want to display console colors (Default value: false)                                                                                     |
| Timeout (Type NUMBER MS) | <p>Enter the time in milliseconds that the websocket connection will be cut off (Default value: 1000 (1 second)<br><br>(Max time: 3 minutes)</p> |

{% hint style="danger" %}
Do not set a high time as it can slow down your computer and increase the resource usage of the machine you are using.
{% endhint %}

## Send signal

Send signal to server

```javascript
const ptero = require('lmadactyl')
let result = await ptero.client.utils.sendSignal("https://yourpanel.com", "apikey", "serverId", "start")
console.log(result) //204
```

| Parameter              | Value                                                                                         |
| ---------------------- | --------------------------------------------------------------------------------------------- |
| panelURL (Type STRING) | The link to your pterodactyl panel                                                            |
| apiKey (Type STRING)   | Type 1                                                                                        |
| serverId (Type STRING) | Your server ID. (<https://yourpanel.com/server/**id>\*\*)                                     |
| signal (Type STRING)   | <p>Signal you want to send to the server<br><br>Valid signals: start, kill, stop, restart</p> |

## Server List

Lists all servers that are registered in the user's account

```javascript
const ptero = require('lmadactyl')
let result = await ptero.client.utils.serverList("https://yourpanel.com", "apikey")
console.log(result)
```

| Parameter              | Value                              |
| ---------------------- | ---------------------------------- |
| panelURL (Type STRING) | The link to your pterodactyl panel |
| apiKey (Type STRING)   | Type 1                             |
