> ## 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.

# Custom Console Progressbar

> Print with style in the developer console

This utility allows you to create loading spinners in the developer console with a custom icon and color.

<Info>
  **Prerequisite** You should have a executor that supports accessing CoreGui.
</Info>

## API

### Simple Usage

the `custom_console_progressbar` takes in the following arguments:

<ParamField path="message" type="String" required>
  The message that is going to be printed (concatinated with the progress bar)
</ParamField>

#### Examples

```lua progressbar_message_arg.lua theme={null}
local console = loadstring(game:HttpGet("https://raw.githubusercontent.com/notpoiu/Scripts/main/utils/console/main.lua"))()

local message = console.custom_console_progressbar("[MSHUB]: Authenticating...")
```

### Advanced Usage

**HOWEVER**, it is possible to use a table as args and get more control.
You can use a table with the following fields:

<ParamField path="msg" type="String" required>
  The message that is going to be printed (concatinated with the progress bar)
</ParamField>

<ParamField path="img" type="String">
  The image that is going to be displayed as the icon. Defaults to ""
</ParamField>

<ParamField path="clr" type="Color3">
  The color of the message, Defaults to Color3.fromRGB(255, 255, 255)
</ParamField>

<ParamField path="length" type="Number">
  The maximum length of the progress bar, Defaults to 10
</ParamField>

#### Examples

```lua progressbar_table_args.lua theme={null}
local console = loadstring(game:HttpGet("https://raw.githubusercontent.com/notpoiu/Scripts/main/utils/console/main.lua"))()

local message = console.custom_console_progressbar({
    msg = "[MSHUB]: Authenticating...",
    img = "",
    clr = Color3.fromRGB(255, 0, 0),
    length = 10
})
```

### Progressbar Manipulation

the `custom_console_progressbar` function returns a table with the following fields:

<ResponseField name="message.update_message_with_progress" type="function">
  <Expandable title="properties">
    <ResponseField name="message" type="string" required>
      The message that is going to be updated (concatinated with the progress bar)
    </ResponseField>

    <ResponseField name="progress_index" type="Number">
      The behaviour of this function defaults to not incrementing the progress bar when this function is called. If you want to increment the progress bar, you can pass in the new index of the progress.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="message.update_progress" type="function">
  <Expandable title="properties">
    <ResponseField name="index" type="Number" required>
      The new index of the progress bar
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="message.update_message" type="function">
  <Expandable title="properties">
    <ResponseField name="message" type="String" required>
      The new message that is going to be printed (without the progress bar)
    </ResponseField>

    <ResponseField name="image" type="String">
      a rbxassetid:// image that will be displayed as the icon. Defaults to ""
    </ResponseField>

    <ResponseField name="color" type="Color3">
      The color of the message, Defaults to Color3.fromRGB(255, 255, 255)
    </ResponseField>
  </Expandable>
</ResponseField>

#### Examples

<CodeGroup>
  ```lua simple.lua theme={null}
  local console = loadstring(game:HttpGet("https://raw.githubusercontent.com/notpoiu/Scripts/main/utils/console/main.lua"))()
  local message = console.custom_console_progressbar("[MSHUB]: Authenticating...")

  for i = 1, 10 do
      message.update_progress(i)
      task.wait(.05)
  end

  message.update_message("[MSHUB]: Authenticated!", "rbxasset://textures/AudioDiscovery/done.png", Color3.fromRGB(51, 255, 85))
  ```

  ```lua advanced_console_options.lua theme={null}
  local console = loadstring(game:HttpGet("https://raw.githubusercontent.com/notpoiu/Scripts/main/utils/console/main.lua"))()
  local message = console.custom_console_progressbar({
      msg = "[MSHUB]: Authenticating...",
      img = "",
      clr = Color3.fromRGB(255, 255, 255),
      length = 25
  })

  for i = 1, 25 do
      message.update_progress(i)
      task.wait(.05)
  end

  message.update_message("[MSHUB]: Authenticated!", "rbxasset://textures/AudioDiscovery/done.png", Color3.fromRGB(51, 255, 85))
  ```

  ```lua updating_progress_message.lua theme={null}
  local console = loadstring(game:HttpGet("https://raw.githubusercontent.com/notpoiu/Scripts/main/utils/console/main.lua"))()
  local message = console.custom_console_progressbar("[MSHUB]: Authenticating...")

  for i = 1, 10 do
      message.update_message_with_progress("[MSHUB]: Passing Checkpoint " .. i, i)
      task.wait(.05)
  end

  message.update_message("[MSHUB]: Authenticated!", "rbxasset://textures/AudioDiscovery/done.png", Color3.fromRGB(51, 255, 85))
  ```
</CodeGroup>
