> ## Documentation Index
> Fetch the complete documentation index at: https://docs.upio.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Usage

> API methods and properties for the seliware API

# Import

Import the seliware API into your project.

```csharp theme={null}
using SeliwareAPI;
```

# Initialization

Required to initialize the API before using any of the methods or properties.

```csharp theme={null}
Seliware.Initialize();
```

<Warning>
  You must initialize the API before using any of the methods or properties. It is recommended to call this function in the `Main` function found in the `Program.cs` file.
</Warning>

# Injection

Inject into the roblox process. This returns a string with the status of the injection. If the injection is successful, the return value will be `Success`.

```csharp theme={null}
Seliware.Inject();
```

<ParamField path="pid" type="int">
  The process id of the roblox process you want to inject into. If not provided, it will inject into the first roblox process found.
</ParamField>

<CardGroup cols={2}>
  <Card title="Detect if injected">
    To detect if the API is injected, you can use the `IsInjected` property.

    ```csharp theme={null}
    bool isInjected = Seliware.IsInjected();
    if (isInjected)
    {
        MessageBox.Show("Injected!");
    }
    ```
  </Card>

  <Card title="On Injection">
    Once the injection is successful, the `Injected` event will be fired.

    ```csharp theme={null}
    Seliware.Injected += delegate
    {
        MessageBox.Show("Successfully injected!");
    };
    ```
  </Card>
</CardGroup>

# Execution

Execute a script in the roblox process.

```csharp theme={null}
Seliware.Execute("print('Hello from the Seliware API!')");
```

<ParamField path="script" type="string" required>
  The script you want to execute in the roblox process.
</ParamField>

# Misc Methods

### Get Injected Processes

Get the count of all the roblox processes that the API is injected into.

```csharp theme={null}
int clientsCount = Seliware.GetClientsCount();
```

### Get Seliware Version

Get the version of the seliware API.

```csharp theme={null}
string version = Seliware.GetVersion();
```
