# Configuration

## <mark style="color:yellow;">**Available Minigames**</mark>

### Circuit Minigame

**Game ID**: `circuit`

A puzzle-based minigame where players must complete electrical circuits by connecting nodes and paths.

<figure><img src="/files/90JuHxBQFwzkgB2YgZLl" alt=""><figcaption></figcaption></figure>

***

### Enigma Minigame

**Game ID**: `enigma`

A sequence-based decryption challenge where players must decode encrypted patterns within a time limit.

<figure><img src="/files/w9RKqkOrW0BZZNhzugFP" alt=""><figcaption></figcaption></figure>

***

### Morse Code Minigame

**Game ID**: `morse`

A communication-based challenge where players must decode morse code messages using dots and dashes.

<figure><img src="/files/6GOjk8V4exQSwnijPaC3" alt=""><figcaption></figcaption></figure>

***

### Bruteforce Minigame

**Game ID**: `bruteforce`

A password cracking simulation where players must break through security systems using various techniques.

<figure><img src="/files/bvdARaiEji0e0b5QeDnv" alt=""><figcaption></figcaption></figure>

***

### Tuning Minigame

**Game ID**: `tuning`

A frequency-based minigame where players must tune into the correct frequency or signal.

<figure><img src="/files/leMFHh7BEpQ87lyUkF0e" alt=""><figcaption></figcaption></figure>

***

## <mark style="color:yellow;">**Command Configuration**</mark>

```lua
Config.CommandEnabled = true
```

* **Description**: Controls whether the test command for minigames is enabled or disabled.
* **Default**: `true`
* **Usage**: When enabled, allows the use of `/startMinigame` command for testing purposes.

***

## <mark style="color:yellow;">**Command Usage**</mark>

When `Config.CommandEnabled` is set to `true`, you can use the following command:

```
/startMinigame [minigame] [time]
```

**Parameters:**

* **minigame**: The type of minigame to start
  * Available options: `circuit`, `enigma`, `morse`, `bruteforce`, `tuning`
* **time**: Time limit in seconds (default: 60)

**Examples:**

```
/startMinigame circuit 60
/startMinigame enigma 45
/startMinigame morse 30
```

***

## <mark style="color:yellow;">**Export Function**</mark>

```lua
local result = exports['devhub_hackingMinigames']:startMinigame(minigame, time)
```

* **Description**: Programmatically start a minigame from another resource.
* **Parameters**:
  * `minigame` (string): The minigame type to start
  * `time` (number): Time limit in seconds
* **Returns**: Boolean indicating success or failure of the minigame
* **Example Usage**:

```lua
local success = exports['devhub_hackingMinigames']:startMinigame("circuit", 60)
if success then
    print("Player successfully completed the minigame!")
else
    print("Player failed the minigame.")
end
```

***

## <mark style="color:yellow;">**Integration**</mark>

To integrate these minigames into your scripts:

1. **Basic Integration**:

```lua
local result = exports['devhub_hackingMinigames']:startMinigame("circuit", 45)
if result then
    -- Player succeeded
    -- Grant rewards, continue mission, etc.
else
    -- Player failed
    -- Handle failure, retry option, etc.
end
```

2. **Advanced Integration EXAMPLE**:

```lua
-- Before starting a heist hacking sequence
if PlayerHasHackingDevice() then
    local minigameType = GetRandomMinigame() -- Your custom function
    local timeLimit = CalculateTimeLimit() -- Based on player skill, etc.
    
    local success = exports['devhub_hackingMinigames']:startMinigame(minigameType, timeLimit)
    
    if success then
        TriggerEvent('heist:hackingSuccess')
    else
        TriggerEvent('heist:hackingFailed')
    end
end
```

***

## <mark style="color:yellow;">**Sound Configuration**</mark>

<mark style="color:$primary;">**Path: html/config.js**</mark>

```lua
window.config = {
    soundVolume: 0.5,
};
```

* **Description**: Controls the volume level for minigame sound effects.
* **Range**: 0.0 to 1.0 (0% to 100%)
* **Default**: 0.5 (50%)

***


---

# 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.devhub.gg/hacking-minigames-1/configuration.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.
