The CronusMAX PLUS mainly outputs data to a console, however, it does receive data such as rumble and led states which we can read in GPC scripts. Below are the GPC commands related to this data
|
Function Name
|
Description
|
|
|
Overwrites the current value of a controller entry
|
|
|
Returns the current type of console connected to the output port
|
|
|
Disconnects and Reconnects the USB connection on the output port
|
|
|
Returns the PS4 authentication timeout state
|
|
|
Returns the current state of a specified LED
|
|
|
Returns the current vale of a rumble motor
|
 set_val
set_val overwrites the current value of a controller entry with the value that is specified in its second parameter. What this means is whatever the output is from the controller for the specified button/axis, the set_val command will overwrite that value with the value you specify.
It is mainly used in combos to set buttons in sequence, however, it can also be used in the main or user created function.
For example, if you were playing a shooter game and wished to create Hair Triggers. A combo would not be suitable for such a function as you would want the output constant for however long the triggers are held down. You could use the set_val command within the main section to achieve that function, like so;
|
main {
if(get_val(XB1_LT)) {
set_val(XB1_LT, 100);
}
if(get_val(XB1_RT)) {
set_val(XB1_RT, 100);
}
}
|
Syntax
set_val ( <identifier> );
Parameters
<identifier> : the identifier of a controller entry
|
 get_console
get_console returns a value in the form of a int which represents the type of console currently connected to the output port of the CronusMAX PLUS.
0 (zero) is returned if no console is connected and a value of 1, 2, 4 or 5 is returned if a console is connected, depending on the type of console connected.
To save you from remembering which value relates to which type of controller, 4 constants have been created. They are;
|
Name
|
Description
|
Value
|
|
|
PlayStation 3
|
1
|
|
|
Xbox 360
|
2
|
|
|
PlayStation 4
|
4
|
|
|
Xbox One
|
5
|
Example of usage:
|
main {
if(get_console() == PIO_XB1) {
}
}
|
Syntax
get_console ( );
Parameters
None
Returns
A value which represents which type of console is currently connected.
|
 output_reconnection
output_reconnection forces the CronusMAX PLUS to electronically disconnect the output port from the console and then reconnect again. This function was mainly used to reset the authentication timeout on the PS4, however, it is redundant now as there is no timeout when using a USB HUB on Firmware 1.20 and above. It has been left in for legacy CronusMAX Users.
Example of usage:
|
main {
if(get_val(XB1_MENU) && event_press(XB1_XBOX)) {
output_reconnection();
set_val(XB1_XBOX, 0);
}
}
|
Syntax
output_reconnection ( );
Parameters
None
|
 ps4_authtimeout
ps4_authtimeout returns the authentications timeout status on the PS4 in the form of an int. As with output_reconnection, this function is redundant since Firmware 1.20 and above as Partial PS4 cross over support is no longer required. However, the function has not been removed as legacy CronusMAX users and those not using a USB Hub would still require it.
The main function of ps4_authtimeout is to enable you to script a warning when the CronusMAX PLUS is close to automatically disconnecting and reconnecting to the console when the authentication times out on a PS4. This could be achieved using a script from our online library;
|
int authcount;
int NOTIFY = 3;
main{
if(get_console() == PIO_PS4 && get_controller() != PIO_PS4){
authcount = ps4_authtimeout();
swap(1,27);
if(get_val(27) && get_val(5)) {
set_val(27, 0);
set_val(5, 0);
set_val(1, 100);
}
if(get_val(27)) {
if(event_press(19)){
output_reconnection();
}
set_val(19, 0);
}
if(authcount <= NOTIFY + 1) {
combo_run(notify);
}
}
}
combo notify{
set_rumble(RUMBLE_A, 100);
set_rumble(RUMBLE_B, 100);
wait(150);
reset_rumble();
wait(250*authcount);
}
|
Syntax
ps4_authtimeout ( );
Parameters
None
Returns
The PS4 authentication timeout status. This is a decedent count down with 1 being the last value returned before an Automatic Reconnection is performed by the CronusMAX PLUS.
|
 get_led
get_led returns a value in the form of an int which represents the current state of the chosen LED.
The LEDs range from 0 ~ 3. Four constants have been created to make it easier to remember which value is assigned to which LED;
|
Name
|
Description
|
Value
|
|
|
LED 1 / Xbox 360 Quadrant 1
|
0
|
|
|
LED 2 / Xbox 360 Quadrant 2
|
1
|
|
|
LED 3 / Xbox 360 Quadrant 3
|
2
|
|
|
LED 4 / Xbox 360 Quadrant 4
|
3
|
The return value from this function informs you of the current state of the selected LED. The function returns a value ranging from 0 ~ 3;
|
Return Value
|
Description
|
|
0
|
LED Off
|
|
1
|
LED On
|
|
2
|
LED Blinking Fast
|
|
3
|
LED Blinking Slowly
|
Example of usage:
|
main {
if(get_led(LED_2) == 1) {
}
}
|
Syntax
get_led ( <Led_Identifier> );
Parameters
<Led_Identifier> : The identifier of an LED
Returns
An int ranging from 0 ~ 3 which represents the current state
Click here for more information on LED states
|
 get_rumble
get_rumble returns the speed of the chosen rumble motor on the controller in the form of an int. The value returned can range from 0 ~ 100 which represents the speed in a percentage ( % ).
The rumble motors are numbered 0 ~ 3. To make it easier to remember which motor is which, four constants have been created;
|
Name
|
Description
|
Value
|
|
|
Strong Rumble Motor (Usually the Left Motor)
|
0
|
|
|
Weak Rumble Motor (Usually the Right Motor)
|
1
|
|
|
Right Trigger Motor (Xbox One controllers only)
|
2
|
|
|
Left Trigger Motor (Xbox One controllers only)
|
3
|
Example of usage:
|
main {
if(get_rumble(RUMBLE_A) > 50) {
}
}
|
Syntax
get_rumble ( <rumble_identifier> );
Parameters
<rumble_identifier> : the identifier of a Rumble Motor
Returns
An int ranging from 0 ~ 100 which represents the current speed of the chosen motor
Click here for more information on setting Rumble Motors
|
|