> For the complete documentation index, see [llms.txt](https://guide.cronuszen.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guide.cronuszen.com/gpcscripting/gpc-script-guide/gpc-developer-guide/functions/internal-functions.md).

# Internal Functions

### BIT Functions

| **Function** | **Description**                  |
| ------------ | -------------------------------- |
| set\_bit     | Sets one Bit.                    |
| clear\_bit   | Clears one Bit.                  |
| test\_bit    | Tests a Bit.                     |
| set\_bits    | Stores a value into a Bit Index. |
| get\_bits    | Gets a value from the Bit Index. |

Internal functions for Bit Functions can be found here: [Bit Functions](/gpcscripting/gpc-script-guide/gpc-developer-guide/functions/internal-functions/bit-functions.md)

***

### Combo Functions

| **Function**            | **Description**                                           |
| ----------------------- | --------------------------------------------------------- |
| combo\_run              | Runs a combo.                                             |
| combo\_running          | Checks if a combo is running.                             |
| combo\_stop             | Stops a running combo.                                    |
| combo\_restart          | Restarts a running combo.                                 |
| combo\_suspend          | Suspends (pauses) a combo.                                |
| combo\_suspended        | Checks if a combo is in the suspended state.              |
| combo\_current\_step    | keywords returning the current step.                      |
| combo\_step\_time\_left | the time left of the currently executed step.             |
| combo\_stop\_all        | Stops all combos.                                         |
| combo\_suspend\_all     | Suspends (pauses) all combos.                             |
| combo\_resume           | Resumes the suspended combo or the already running combo. |
| combo\_resume\_all      | Resumes all suspended combos.                             |

Internal functions for Combo Functions can be found here: [Combo Functions](/gpcscripting/gpc-script-guide/gpc-developer-guide/functions/internal-functions/combo-functions.md)

***

### Math Functions

| **Function** | **Description**                                                                                                                                                                                                                                                            |
| ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| abs          | Returns an absolute value of a number.                                                                                                                                                                                                                                     |
| inv          | Returns the inverse value of a number.                                                                                                                                                                                                                                     |
| pow          | Raise and value to the specified power.                                                                                                                                                                                                                                    |
| isqrt        | Calculates an integer square root.                                                                                                                                                                                                                                         |
| random       | Generates a random value between the specified range.                                                                                                                                                                                                                      |
| clamp        | The clamp() function clamps a value between an upper and lower bound. clamp() enables selecting a middle value within a range of values between a defined minimum and maximum. It takes three parameters: a minimum value, a preferred value, and a maximum allowed value. |
| min          | Gets the minimum of two values.                                                                                                                                                                                                                                            |
| max          | Gets the maximum of two values.                                                                                                                                                                                                                                            |

Internal functions for Math Functions can be found here: [Math Functions](/gpcscripting/gpc-script-guide/gpc-developer-guide/functions/internal-functions/math-functions.md)

***

### Device Functions

| **Function**    | **Description**                                                                            |
| --------------- | ------------------------------------------------------------------------------------------ |
| get\_rtime      | Returns the elapsed time between main iterations in milliseconds                           |
| get\_slot       | Returns the active slot number.                                                            |
| load\_slot      | Loads a specified slot.                                                                    |
| get\_ctrlbutton | Returns the identifier of the controller button.                                           |
| vm\_tctrl       | Sets the vm timeout for the next iteration.                                                |
| set\_polar      | Sets the stick output at a given angle and radius with a high resolution value.            |
| get\_polar      | Retrieves the current angle or radius of either the left or right analog stick.            |
| get\_ipolar     | Retrieves the current unmodified angle or radius of either the left or right analog stick. |
| set\_rgb        | Sets the LED on the ZEN to the supplied RGB color.                                         |
| set\_hsb        | Sets the LED on the ZEN to the supplied HSB color.                                         |
| get\_info       | Detects the state of the MK Profile in use.                                                |

Internal functions for Device Functions can be found here: [Device Functions](/gpcscripting/gpc-script-guide/gpc-developer-guide/functions/internal-functions/device-functions.md)

***

### LED Display Functions

| **Function** | **Description**                                                     |
| ------------ | ------------------------------------------------------------------- |
| pixel\_oled  | Draws a pixel on the OLED display.                                  |
| line\_oled   | Draws a line on the OLED display.                                   |
| rect\_oled   | Draws a rectangle on the OLED display.                              |
| circle\_oled | Draws a circle on the OLED display.                                 |
| putc\_oled   | Puts a character into the string buffer for puts\_oled.             |
| puts\_oled   | Draws the characters supplied using putc\_oled on the OLED display. |
| cls\_oled    | Sets the entire OLED display to a single color.                     |
| print        | Draws a string on the OLED display.                                 |

Internal functions for OLED Display Functions can be found here: [OLED Display Functions](/gpcscripting/gpc-script-guide/gpc-developer-guide/functions/internal-functions/oled-display-functions.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://guide.cronuszen.com/gpcscripting/gpc-script-guide/gpc-developer-guide/functions/internal-functions.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.
