# Console Functions

| **Function Name**    | **Description**                                                      |
| -------------------- | -------------------------------------------------------------------- |
| get\_console         | Gets which console is currently connected.                           |
| set\_val             | Sets the output value to send to the console.                        |
| block\_all\_inputs   | Blocks all output from being sent to the console this cycle of main. |
| ps4\_authtimeout     | Check if ps4 authentication is timed out.                            |
| output\_reconnection | Check the output if reconnected.                                     |
| output\_protocol     | Sets Output protocol.                                                |
| get\_led             | Returns the current state of a specified LED.                        |
| get\_rumble          | Returns the current value of a rumble motor.                         |

***

### get\_console

get\_console returns a value that represents the console the Cronus Zen is currently connected to.

Syntax

get\_console();

Parameters

None

Returns

A value representing the console type (e.g., PS4, XB1, SWITCH, etc.).

***

### set\_val

set\_val sets the output value of a controller entry (button or axis) to be sent to the console. This is the most commonly used function in GPC scripting.

Code-Snippet

```
main {
    // Sets the value of XB1_RT to 100 (fully pressed)
    set_val(XB1_RT, 100);
}
```

Syntax

set\_val( \<identifier>, \<value> );

Parameters

\<identifier> : The controller entry identifier (e.g., XB1\_RT, PS4\_R2).

\<value> : The value to set, ranging from -100 to 100.

Returns

Nothing

***

### block\_all\_inputs

block\_all\_inputs prevents any data from being sent to the console for the current iteration of the main loop.

Syntax

block\_all\_inputs();

Parameters

None

Returns

Nothing

***

### ps4\_authtimeout

ps4\_authtimeout checks if the PS4 authentication has timed out. This is primarily used when using controllers that require periodic re-authentication on the PS4.

Syntax

ps4\_authtimeout();

Parameters

None

Returns

TRUE if the authentication has timed out, FALSE otherwise.

***

### output\_reconnection

output\_reconnection checks the status of the output connection to the console.

Syntax

output\_reconnection();

Parameters

None

Returns

Returns the status of the reconnection process.

***

### output\_protocol

output\_protocol sets the output protocol for the Cronus Zen to communicate with the console.

Syntax

output\_protocol( \<protocol> );

Parameters

\<protocol> : The protocol constant (e.g., PROTOCOL\_PS4, PROTOCOL\_XB1).

Returns

Nothing

***

### get\_led

get\_led returns the current state (on/off/brightness) of a specified LED on the controller.

Syntax

get\_led( \<led\_id> );

Parameters

\<led\_id> : The identifier for the LED.

Returns

The current value/state of the LED.

***

### get\_rumble

get\_rumble returns the current strength value of a specific rumble motor as sent by the console.

Syntax

get\_rumble( \<rumble\_id> );

Parameters

\<rumble\_id> : The identifier for the rumble motor (e.g., RUMBLE\_A, RUMBLE\_B).

Returns

The current rumble value (0 to 100).


---

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