# Table of Contents - [Welcome | Cronus GPC Documentation](#welcome-cronus-gpc-documentation) - [GPC Explained | Cronus GPC Documentation](#gpc-explained-cronus-gpc-documentation) - [Basic Syntax | Cronus GPC Documentation](#basic-syntax-cronus-gpc-documentation) - [What's New with Zen? | Cronus GPC Documentation](#what-s-new-with-zen-cronus-gpc-documentation) - [Definitions | Cronus GPC Documentation](#definitions-cronus-gpc-documentation) - [A Simple Tutorial | Cronus GPC Documentation](#a-simple-tutorial-cronus-gpc-documentation) - [Style Guide | Cronus GPC Documentation](#style-guide-cronus-gpc-documentation) - [Data Section | Cronus GPC Documentation](#data-section-cronus-gpc-documentation) - [Basic GPC Structure | Cronus GPC Documentation](#basic-gpc-structure-cronus-gpc-documentation) - [Main Section | Cronus GPC Documentation](#main-section-cronus-gpc-documentation) - [Constants | Cronus GPC Documentation](#constants-cronus-gpc-documentation) - [Variables | Cronus GPC Documentation](#variables-cronus-gpc-documentation) - [Remapping | Cronus GPC Documentation](#remapping-cronus-gpc-documentation) - [Init Section | Cronus GPC Documentation](#init-section-cronus-gpc-documentation) - [OLED | Cronus GPC Documentation](#oled-cronus-gpc-documentation) - [Combo Section | Cronus GPC Documentation](#combo-section-cronus-gpc-documentation) - [Zen | Cronus GPC Documentation](#zen-cronus-gpc-documentation) - [User Created Functions | Cronus GPC Documentation](#user-created-functions-cronus-gpc-documentation) - [Identifiers | Cronus GPC Documentation](#identifiers-cronus-gpc-documentation) - [Keyboard | Cronus GPC Documentation](#keyboard-cronus-gpc-documentation) - [Misc | Cronus GPC Documentation](#misc-cronus-gpc-documentation) - [Flow Control | Cronus GPC Documentation](#flow-control-cronus-gpc-documentation) - [PIO | Cronus GPC Documentation](#pio-cronus-gpc-documentation) - [Polar | Cronus GPC Documentation](#polar-cronus-gpc-documentation) - [G27 | Cronus GPC Documentation](#g27-cronus-gpc-documentation) - [Persistent Memory | Cronus GPC Documentation](#persistent-memory-cronus-gpc-documentation) - [Trace | Cronus GPC Documentation](#trace-cronus-gpc-documentation) - [Rumble | Cronus GPC Documentation](#rumble-cronus-gpc-documentation) - [DF GT | Cronus GPC Documentation](#df-gt-cronus-gpc-documentation) - [Controller | Cronus GPC Documentation](#controller-cronus-gpc-documentation) - [Racing Wheel | Cronus GPC Documentation](#racing-wheel-cronus-gpc-documentation) - [G29 | Cronus GPC Documentation](#g29-cronus-gpc-documentation) - [Bit Functions | Cronus GPC Documentation](#bit-functions-cronus-gpc-documentation) - [Rumble Functions | Cronus GPC Documentation](#rumble-functions-cronus-gpc-documentation) - [LED | Cronus GPC Documentation](#led-cronus-gpc-documentation) - [DF | Cronus GPC Documentation](#df-cronus-gpc-documentation) - [DF Pro | Cronus GPC Documentation](#df-pro-cronus-gpc-documentation) - [Controller Functions | Cronus GPC Documentation](#controller-functions-cronus-gpc-documentation) - [G25 | Cronus GPC Documentation](#g25-cronus-gpc-documentation) - [#1 | Cronus GPC Documentation](#-1-cronus-gpc-documentation) - [Internal Functions | Cronus GPC Documentation](#internal-functions-cronus-gpc-documentation) - [Console Functions | Cronus GPC Documentation](#console-functions-cronus-gpc-documentation) - [XBox 360 | Cronus GPC Documentation](#xbox-360-cronus-gpc-documentation) - [Operator Types | Cronus GPC Documentation](#operator-types-cronus-gpc-documentation) - [Xbox One | Cronus GPC Documentation](#xbox-one-cronus-gpc-documentation) - [Keyboard Functions | Cronus GPC Documentation](#keyboard-functions-cronus-gpc-documentation) - [Nintendo Switch | Cronus GPC Documentation](#nintendo-switch-cronus-gpc-documentation) - [Nintendo WII | Cronus GPC Documentation](#nintendo-wii-cronus-gpc-documentation) - [Core Console Functions | Cronus GPC Documentation](#core-console-functions-cronus-gpc-documentation) - [Device Functions | Cronus GPC Documentation](#device-functions-cronus-gpc-documentation) - [Math Functions | Cronus GPC Documentation](#math-functions-cronus-gpc-documentation) - [PS4 | Cronus GPC Documentation](#ps4-cronus-gpc-documentation) - [OLED Display Functions | Cronus GPC Documentation](#oled-display-functions-cronus-gpc-documentation) - [PS3 | Cronus GPC Documentation](#ps3-cronus-gpc-documentation) - [Core Keyboard Functions | Cronus GPC Documentation](#core-keyboard-functions-cronus-gpc-documentation) - [LED Functions | Cronus GPC Documentation](#led-functions-cronus-gpc-documentation) - [Memory | Cronus GPC Documentation](#memory-cronus-gpc-documentation) - [Combo Functions | Cronus GPC Documentation](#combo-functions-cronus-gpc-documentation) - [ASCII Constants | Cronus GPC Documentation](#ascii-constants-cronus-gpc-documentation) - [Keyboard | Cronus GPC Documentation](#keyboard-cronus-gpc-documentation) - [Core Controller Functions | Cronus GPC Documentation](#core-controller-functions-cronus-gpc-documentation) --- # Welcome | Cronus GPC Documentation circle-info **IMPORTANT** This documentation is in the process of being updated as the Zen firmware is still undergoing changes to its core system with many new features. If you have any further questions you can post to the [script section of the Zen Communityarrow-up-right](https://cronusmax.com/forums/forumdisplay.php/381-Zen-Compiler-GPC-Scripts) . I also welcome all feedback with regards to the manual - perhaps I've described something incorrectly or you have some information you feel would benefit the community? or even something as trivial as a typo - let us know! Thank you for reading. _Charlie / MaxADMIN Cronus Community Admin_ _CronusMAX and Cronus Zen are Registered Trademarks © 2013-2020 Collective Minds Gaming Company, Inc._ _"PlayStation", "PlayStation 3", "PlayStation 4", "DualShock" are registered trademarks of Sony Computer Entertainment. "Xbox", “Xbox 360” and "Xbox One" are registered trademarks of Microsoft Inc. "Nintendo", "Switch", “Wii” and "Wii U" are registered trademarks of Nintendo Co., Ltd. All trademarks, service marks, trade names, product names, screen captures, game images and logos used herein are for identification purposes only and are the property of their respective owners.Any rights not expressly granted herein are reserved._ [NextGPC Explainedchevron-right](https://gpc.cronusmax.com/introduction/gpc-explained) Last updated 5 years ago Was this helpful? Was this helpful? --- # GPC Explained | Cronus GPC Documentation GPC is the scripting language used by the Cronus Zen and CronusMAX game controller protocol converters, and is widely recognized as the definitive scripting language for gaming mods and macros. Its commands have been designed to be self explanatory so anyone from a novice to expert programmer is able to pick it up quickly. The basic syntax of GPC has been borrowed from C language and the basic structure and keywords will be familiar to those whom have programmed in C before. GPC is simply a human readable version of the code used by the Cronus, which actually uses a bytecode system. Whenever you program, build or compile a GPC script, the compiler built in to the Zen Studio or Cronus Pro software, converts the script in to bytecode prior to being sent to the Cronus device. Bytecode is an instruction set for the virtual machine (VM or software interpreter) which the Cronus runs. Inputs for controllers are sent to the VM which then modifies them according to the instructions set in the bytecode. This modified output is then sent to the console. The Virtual Machine is a hypothetical computer and its functions and architecture has been optimized specifically for the task of modifying and outputting game controller commands to a video game console. The Cronus VM is a stack machine and has been optimized so it is able to send data to a console without delay. Providing the CPU load is kept below 80%, the Cronus CPU is able to carry out all the tasks assigned to it without delaying the output to the console. Part of the optimization process means error checks by the VM are kept to a minimum and to only what is necessary. This means it is important the programmer has a good understanding of the limitations and fundamentals of GPC when developing scripts. [PreviousWelcomechevron-left](https://gpc.cronusmax.com/) [NextWhat's New with Zen?chevron-right](https://gpc.cronusmax.com/introduction/whats-new) Last updated 6 years ago Was this helpful? Was this helpful? --- # Basic Syntax | Cronus GPC Documentation Copy define Cronus = 120; int ZEN = 100; main { if (get_val(XB1_A)) { combo_run(jump); } } combo jump { set_val(XB1_A, 100); wait(Cronus); set_val(XB1_A, 0); wait(ZEN); } [hashtag](https://gpc.cronusmax.com/basic-syntax#instruction-separation) Instruction Separation ---------------------------------------------------------------------------------------------------- As in C, GPC requires instructions to be terminated with a semicolon at the end of each statement. However, the closing tag of a block code automatically implies a semicolon, so a semicolon is not needed when terminating the last line of a GPC block. Copy main { sensitivity(XB1_LY, NOT_USE, 80); a = b * ( c + 20 ) } circle-info Although the semicolon is not required in the final line of a block, it is considered good practice to use one so it is not missed should you expand on the code at a later date. [hashtag](https://gpc.cronusmax.com/basic-syntax#nesting-code) Nesting Code -------------------------------------------------------------------------------- Nesting code, or creating a logic block, binds code together. A Block starts with a `{` and end with a `}`. What this does is nest the code with the `{` and `}` meaning that the code is only executed when the statement before it is active. circle-info In this example, Blocks 2 & 3 are ignored unless Block 1 is active. So if the R2 button is not pressed, nothing happens. If R2 is pressed, then the CronusMAX looks at Block 2. If L2 is pressed, it will run the combo RAPID\_FIRE\_ADS and ignore Block 3. However, if L2 is not pressed, it will ignore Block 2 and instead execute the code in Block 3 and then run combo RAPID\_FIRE. Nesting is implied if you only have one line of code after a statement. As in this example; When compiled, the line `combo_run(RAPID_FIRE);` will automatically be nested within the `if` statement. If you wish for more than one line of code to only be executed when the statement before them is active, then you must use `{` and `}`. [hashtag](https://gpc.cronusmax.com/basic-syntax#commenting-code) Commenting Code -------------------------------------------------------------------------------------- A comment is text which is ignored by the compiler. Comments are usually used to annotate code for future reference or to add notes for others looking at the code. However, they can also be used to make certain lines of code inactive to aid when debugging scripts. If you have programmed in C before then GPC comments will be familiar to you as it uses the same style. There are two types of comments, the Single Line Comment and the Multi Line Comment. #### [hashtag](https://gpc.cronusmax.com/basic-syntax#single-line-comment) Single Line Comment The `//` (two slashes) characters creates a single line comment and can be followed by any sequence of character. A new line terminates this form of comment. As shown below #### [hashtag](https://gpc.cronusmax.com/basic-syntax#multi-line-comment) Multi Line Comment The / (slash, asterisk) characters starts a multi line comment and can also be follow by any sequence of characters. The multi line comment terminates when the first / (asterisk, slash) is found. As shown below As the comment terminates when a \*/ (asterisk, slash) is found, this style of commenting cannot be nested. As shown below [PreviousWhat's New with Zen?chevron-left](https://gpc.cronusmax.com/introduction/whats-new) [NextA Simple Tutorialchevron-right](https://gpc.cronusmax.com/a-simple-tutorial) Last updated 5 years ago Was this helpful? * [Instruction Separation](https://gpc.cronusmax.com/basic-syntax#instruction-separation) * [Nesting Code](https://gpc.cronusmax.com/basic-syntax#nesting-code) * [Commenting Code](https://gpc.cronusmax.com/basic-syntax#commenting-code) Was this helpful? Copy main { //Main Start if(get_val(PS4_R2)) { //Block 1 Start if(get_val(PS4_L2)) { //Block 2 Start combo_run(RAPID_FIRE_ADS); } //Block 2 End else { //Block 3 Start combo_run(RAPID_FIRE); } //Block 3 End } //Block 1 End } //Main End Copy main { if(get_val(XB1_RT) > 95) combo_run(RAPID_FIRE); } Copy main { // A single line comment if(get_val(XB1_RT) > 95) // Another single line comment combo_run(RAPID_FIRE); } Copy main { /* A multi line comment if(get_val(XB1_RT) > 95) combo_run(RAPID_FIRE); */ } Copy main { /* A multi line comment if(get_val(XB1_RT) > 95) combo_run(RAPID_FIRE); /*This will cause a problem*/ */ } --- # What's New with Zen? | Cronus GPC Documentation [hashtag](https://gpc.cronusmax.com/introduction/whats-new#keyboard-functions) Keyboard Functions ------------------------------------------------------------------------------------------------------ Function Description [get\_keyboard](https://gpc.cronusmax.com/functions-and-commands/keyboard-functions/core-keyboard-functions#get_keyboard) Checks if a chosen keyboard key is held down [get\_modifiers](https://gpc.cronusmax.com/functions-and-commands/keyboard-functions/core-keyboard-functions#get_modifiers) Checks if a chosen keyboard modifier is held down (ALT, SHIFT,CTRL, etc.) [hashtag](https://gpc.cronusmax.com/introduction/whats-new#oled-display-functions) OLED Display Functions -------------------------------------------------------------------------------------------------------------- Function Description printf Draws a defined string onto the OLED screen circle\_oled Draws a chosen set of pixels that will create a circular shape on the OLED screen line\_oled Draws a line of pixels in any direction on the OLED screen pixel\_oled Draws a pixel on the OLED screen cls\_oled Clears the OLED screen putc\_oled Places a single ASCII character at a position on the OLED screen puts\_oled Draws the text on the OLED screen rect\_oled Draws a square shape on the OLED screen [hashtag](https://gpc.cronusmax.com/introduction/whats-new#controller-functions) Controller Functions ---------------------------------------------------------------------------------------------------------- Function Description set\_polar Moves the analog stick based on a given radius and angle (currently RS only) set\_remapper Remaps controller buttons on-the-fly within the `main` function get\_ival Gets the input value of a button to check if it has been modified by the script. [hashtag](https://gpc.cronusmax.com/introduction/whats-new#device-functions) Device Functions -------------------------------------------------------------------------------------------------- Function Description save\_eeprom Saves the current eeprom/SPVAR settings set\_hsb Choose from a HSB (Hue (tint), saturation (absorbance), brightness (lightness)) colour pallete to display on the LED Lights set\_rgb Choose from a RGB (Red, Green, Blue) colour pallete to display on the LED Lights [hashtag](https://gpc.cronusmax.com/introduction/whats-new#math-functions) Math Functions ---------------------------------------------------------------------------------------------- Function Description random Returns a random number between min and max range [PreviousGPC Explainedchevron-left](https://gpc.cronusmax.com/introduction/gpc-explained) [NextBasic Syntaxchevron-right](https://gpc.cronusmax.com/basic-syntax) Last updated 6 years ago Was this helpful? * [Keyboard Functions](https://gpc.cronusmax.com/introduction/whats-new#keyboard-functions) * [OLED Display Functions](https://gpc.cronusmax.com/introduction/whats-new#oled-display-functions) * [Controller Functions](https://gpc.cronusmax.com/introduction/whats-new#controller-functions) * [Device Functions](https://gpc.cronusmax.com/introduction/whats-new#device-functions) * [Math Functions](https://gpc.cronusmax.com/introduction/whats-new#math-functions) Was this helpful? --- # Definitions | Cronus GPC Documentation The sole purpose of a definition is assign a value to a word and therefore make a script easier for a human to read. They do not use utilize any bytecode space in a script as they are not sent to the Cronus Zen. When a script is compiled the words are changed to their assigned value. ### [hashtag](https://gpc.cronusmax.com/definitions#syntax) Syntax Copy define = ; Copy : The name of the constant : The value assigned to the constant circle-info Only Integer values can be assigned to the value of a constant. Once a word is defined and given a value, that word can be used anywhere in the script where a value is valid, as shown below; Copy define my_value = 50; int myvar; main { set_val(XB1_RT, my_value); myvar = my_value; if(myvar >= my_value) { } if(get_val(XB1_LT) > my_value) { } } A **define** is a static value and therefore cannot be changed during run time, as shown below; If you wish to assign a value to a word and change its value during run-time, you would use a [variable](https://gpc.cronusmax.com/variables) instead of a **define**. [PreviousBasic GPC Structurechevron-left](https://gpc.cronusmax.com/basic-gpc-structure) [NextData Sectionchevron-right](https://gpc.cronusmax.com/data-section) Last updated 6 years ago Was this helpful? Was this helpful? Copy define my_value = 50; main { my_value = 70; } --- # A Simple Tutorial | Cronus GPC Documentation [hashtag](https://gpc.cronusmax.com/a-simple-tutorial#step-1) Step 1 ------------------------------------------------------------------------- Load Zen Studio and click File > New > Empty File ![](https://gpc.cronusmax.com/~gitbook/image?url=https%3A%2F%2F1445201306-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-legacy-files%2Fo%2Fassets%252F-LuT3mr_GU9LrnSDmVx9%252F-LuU6tkA5RqsjPjaJsm-%252F-LuUB63_YNJfhiJqpjz7%252F112545bc840715fbeeadc16af3d0eb35.png%3Falt%3Dmedia%26token%3Db536ad4e-720b-4ea0-a7d4-1251fbf76379&width=768&dpr=3&quality=100&sign=86f08d21&sv=2) [hashtag](https://gpc.cronusmax.com/a-simple-tutorial#step-2) Step 2 ------------------------------------------------------------------------- Copy and paste the following code into the GPC code editor within Zen Studio. [hashtag](https://gpc.cronusmax.com/a-simple-tutorial#step-3) Step 3 ------------------------------------------------------------------------- Compile the code to check for errors. To do this, either press **F7** on your keyboard or go to the Compiler drop-down menu in Zen Studio and select compile: ![](https://gpc.cronusmax.com/~gitbook/image?url=https%3A%2F%2F1445201306-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-legacy-files%2Fo%2Fassets%252F-LuT3mr_GU9LrnSDmVx9%252F-LuUBbKPWnPhF2kcGUgI%252F-LuUCVwQ8xsQbTF2kp7K%252F61bf7d6f7c516e443315902167988ba7.png%3Falt%3Dmedia%26token%3D21302528-839f-4f46-b6d4-eecccc5d8784&width=768&dpr=3&quality=100&sign=c97151a8&sv=2) The Output window below the GPC editor should give you this message; If your Cronus Zen is connected via the PROG USB port and you have a controller connected, you can see this script in action by using the Build and Run option. This is accessed by either pressing **F5** or selecting Build and Run in the Compiler drop-down menu. This function will compile the code and then send it to your Cronus Zen so you can test it. [hashtag](https://gpc.cronusmax.com/a-simple-tutorial#script-breakdown) Script Breakdown --------------------------------------------------------------------------------------------- What this script does is run the combo named RAPID\_FIRE whenever the right trigger has a value or is pressed. If the Right Trigger is still held when the combo ends, it will be run again. To analyse how the Cronus Zen is told how to do this we must first break the script down into its two sections, the _**main**_ and _**combo**_ sections. ### [hashtag](https://gpc.cronusmax.com/a-simple-tutorial#the-main-section) The Main Section circle-info As explained [here](https://gpc.cronusmax.com/basic-gpc-structure#gpc-main-section-mandatory) , the _**main**_ section is run in a loop by the Cronus Zen. The Virtual Machine in the Cronus Zen runs through the code in order and when it reaches the end of the code, data is sent to the console and then the Virtual Machine starts the next loop. circle-info The above code tells the Cronus Zen that if the statement is **TRUE,** run the nested code. In this case, if XB1\_RT (Right Trigger) has a value greater than 0 (Zero) so is pressed or not at rest. circle-info Above is the code nested within the _**if**_ statement. Nesting code creates a hierarchical structure. An open curly bracket ( { )starts the nesting and a closed curly bracket ( } ) ends it. By nesting code within the _**if**_ statement we are telling the Cronus Zen that we only wish for that code to be executed only when the _**if**_ statement is **TRUE**. ~More information on nesting code can be found here.~ circle-info This line simply tells the Cronus Zen to run the _**combo**_ named RAPID\_FIRE. It is important to note that if the Cronus Zen receives this instruction and the _**combo**_ is already running it will not do anything. It will only run the _**combo**_ again if it has finished. This means that if you hold down the Right Trigger with this code active, the Cronus Zen start the _**combo**_ and then run it again as soon as it has ended. Therefore running the _**combo**_ in an indefinite loop or until such time as the Right Trigger is released. ### [hashtag](https://gpc.cronusmax.com/a-simple-tutorial#the-combo-section) The Combo Section circle-info This is the _**combo**_ which the Cronus Zen is instructed to run when the Right Trigger is pressed. When run, a _**combo**_ runs through the code until it gets to a _**wait**_ statement. The _**wait**_ statement instructs _**combo**_ to execute the commands above it for a set amount of time which is expressed in milliseconds. circle-info These lines instruct the _**combo**_ to set the value of the Right Trigger to 100 (or fully pressed) for 40 milliseconds. circle-info Once the 40 milliseconds has passed, these lines instruct the _**combo**_ to set the Right Trigger to 0 (Release) for 30 milliseconds. Additional detail on how a combo operates can be found here. [hashtag](https://gpc.cronusmax.com/a-simple-tutorial#expanding-the-code) Expanding the Code ------------------------------------------------------------------------------------------------- Now that you understand how this script works, we will make it more complex and change when the _**combo**_ is run. Look at this line in the main section: and change it to: By introducing `&& !get_val(XB1_LT)` in to the _**if**_ statement we are telling the Cronus Zen to only run the combo if the Right Trigger has a value and the Left Trigger does not. `&&` means 'and' in GPC and `!` means not. So the _**if**_ statement now reads 'if Right Trigger has a value and Left Trigger does not'. Which means when using this code in game the Cronus Zen will only Rapid Fire your gun when you are not aiming down the sights. You can use the build and run function to see this code in action. [PreviousBasic Syntaxchevron-left](https://gpc.cronusmax.com/basic-syntax) [NextStyle Guidechevron-right](https://gpc.cronusmax.com/style-guide) Last updated 6 years ago Was this helpful? * [Step 1](https://gpc.cronusmax.com/a-simple-tutorial#step-1) * [Step 2](https://gpc.cronusmax.com/a-simple-tutorial#step-2) * [Step 3](https://gpc.cronusmax.com/a-simple-tutorial#step-3) * [Script Breakdown](https://gpc.cronusmax.com/a-simple-tutorial#script-breakdown) * [The Main Section](https://gpc.cronusmax.com/a-simple-tutorial#the-main-section) * [The Combo Section](https://gpc.cronusmax.com/a-simple-tutorial#the-combo-section) * [Expanding the Code](https://gpc.cronusmax.com/a-simple-tutorial#expanding-the-code) Was this helpful? Copy main{ if(get_val(XB1_RT)){ combo_run(RAPID_FIRE); } } combo RAPID_FIRE{ set_val(XB1_RT, 100); wait(40); set_val(XB1_RT, 0); wait(30); set_val(XB1_RT, 0); } Copy ------ GPC: Build started ------ 1: New* Compilation completed with 0 warning(s) Total byte size: 148 bytes (0.23%) Total variables used: 3 of which 3 are dedicated to combos (0.59%) Copy main{ if(get_val(XB1_RT)){ combo_run(RAPID_FIRE); } } Copy if (get_val(XB1_RT)) Copy { combo_run(RAPID_FIRE); } Copy combo_run(RAPID_FIRE); Copy combo RAPID_FIRE{ set_val(XB1_RT, 100); wait(40); set_val(XB1_RT, 0); wait(30); set_val(XB1_RT, 0); } Copy set_val(XB1_RT, 100); wait(40); Copy set_val(XB1_RT, 0); wait(30); Copy if(get_val(XB1_RT)){ Copy if(get_val(XB1_RT) && !get_val(XB1_LT)){ --- # Style Guide | Cronus GPC Documentation [hashtag](https://gpc.cronusmax.com/style-guide#opcode) opcode¹ ² ³ ------------------------------------------------------------------------ `opcode` sets one bit of a variable based on its bit index¹ ² ³ Copy opcode(a,5); #### [hashtag](https://gpc.cronusmax.com/style-guide#syntax) 🔴 **Syntax**¹ ² ³ `opcode( , );` #### [hashtag](https://gpc.cronusmax.com/style-guide#parameters) ⚪ **Parameters** : any defined variable. : index point of the bit to be set with a range of 0 to 15. #### [hashtag](https://gpc.cronusmax.com/style-guide#returns) 🔵 **Returns** Nothing [PreviousA Simple Tutorialchevron-left](https://gpc.cronusmax.com/a-simple-tutorial) [NextBasic GPC Structurechevron-right](https://gpc.cronusmax.com/basic-gpc-structure) Last updated 6 years ago Was this helpful? Was this helpful? --- # Data Section | Cronus GPC Documentation The **data** section is located at the first portion of the virtual address space within the GPC bytecode and contains static values which cannot be altered during run time. The main purpose for the **data** section is to store static information and the size of it is determined by the values within it. The static values can be accessed in a GPC through the use of an indexer and [definitions](https://gpc.cronusmax.com/definitions) can also be used if they are placed before the data section, as shown below. [Definitionschevron-right](https://gpc.cronusmax.com/definitions) Copy define myValue = 255; //Index No. 0 1 2 3 4 5 6 7 8 9 10 data ( 20, 42, 35, myValue, 1, 100, 0, 86, 255, 11, 2 ); int a, b, c; main { a = dbyte(3); //a = 255 b = dchar(3); //b = -1; c = dword(3); //c = 511; } [hashtag](https://gpc.cronusmax.com/data-section#functions) Functions -------------------------------------------------------------------------- The values placed within the data section are expressed in bytes (8 bit unsigned integer). The index is zero based. As you can see above, the first value is index point 0 (zero) and the 11th value would be index point 10. dbyte dchar dword ### [hashtag](https://gpc.cronusmax.com/data-section#dbyte-function) dbyte Function Copy a = dbyte(3); // a = 255 This function returns a byte value (8 bit unsigned integer) from the selected index within the array. **Syntax** `dbyte ( );` **Parameters** ` : The index of an element with the data section` ### [hashtag](https://gpc.cronusmax.com/data-section#dchar-function) dchar Function Copy b = dchar(3); // b = -1; This function returns a char value (8 bit signed integer) from the selected index within the array. **Syntax** `dchar ( );` **Parameters** ` : The index of an element with the data section` ### [hashtag](https://gpc.cronusmax.com/data-section#dword-function) dword Function Copy c = dword(3); // c = 511; This function returns a word value (16 bit signed integer) from the selected index within the array. **Syntax** `dword ( );` **Parameters** ` : The index of an element with the data section` [PreviousDefinitionschevron-left](https://gpc.cronusmax.com/definitions) [NextRemappingchevron-right](https://gpc.cronusmax.com/remapping) Last updated 6 years ago Was this helpful? Was this helpful? --- # Basic GPC Structure | Cronus GPC Documentation A GPC script can be split into sections. There can be a total of 8 different sections and, in any user made script, they should be laid out in the order shown in the example below. Only the **main** section is mandatory as it is the heart of any script and is run in a constant loop. Definitions Data Remapping Variables GPC Init GPC Main Combo Function ### [hashtag](https://gpc.cronusmax.com/basic-gpc-structure#definitions-section) Definitions Section Copy // Definitions Section (OPTIONAL) define zero = 0; define one = 1; define two = 2; The definition section is used to assign values to words thus creating a named constant. Definitions must be placed before the **main** section. In this example we define zero, one and two to the values 0, 1, 2 respectively. These are static values which cannot be altered during run time.So, should we use the word 'one' at any point in the script it is the same as typing the number 1. [Definitionschevron-right](https://gpc.cronusmax.com/definitions) ### [hashtag](https://gpc.cronusmax.com/basic-gpc-structure#data-section) Data Section Copy // Data Section (OPTIONAL) data (zero, one, two, 10, 128, 40); The data section is an array of bytes (8 bit unsigned integer) which is placed at the start of the Virtual Address Space in GPC bytecode. The values are read only and cannot be altered at run time.The user can access these values via the zero based data array. For example in this script we could do this to access the array: `example4 =` `**dbyte**``(4); //example4 = 128` [Data Sectionchevron-right](https://gpc.cronusmax.com/data-section) ### [hashtag](https://gpc.cronusmax.com/basic-gpc-structure#remapping-section) Remapping Section Copy // Remapping Section (OPTIONAL) remap XB1_LB -> XB1_RB; remap XB1_RB -> XB1_LB; In this section we can alter the behavior of the controls. In this example we are telling the Virtual Machine that an value assigned to the Left Bumper should be sent to the Right Bumper instead and vice versa. It is important to note that button remaps are applied once the main has finished and just before the output report is sent to the console. This means scripting should be programmed without considering the remapping. For example, if at some point in this script we were to set the Left Bumper to 100 like so: `set_val(XB1_LB, 100);` When the main procedure finishes, the output report would initially contain a value of 100 for the left bumper. When the remaps are processed, this value would then instead be assigned to the Right Bumper and the output report would be modified. When the final output report is sent to the console, it would contain a value of 100 for the Right Bumper instead of the Left. [Remappingchevron-right](https://gpc.cronusmax.com/remapping) ### [hashtag](https://gpc.cronusmax.com/basic-gpc-structure#variable-initialization-section) Variable Initialization Section This is where the user can create variables. A variable is a point in the stack memory where a value can be placed and they can only be created before the main or init sections. These variables are global and GPC and can be accessed at any point within the script. Variables are not static and can be altered during run time. If a variable is not assigned a value in this section, it is initialized with the value 0. Such as the variables example2 and example3 in this script. [Variableschevron-right](https://gpc.cronusmax.com/variables) ### [hashtag](https://gpc.cronusmax.com/basic-gpc-structure#gpc-initialization-section) GPC Initialization Section The **init** section is similar to the **main** with the exception that it is only run once when the script is loaded in to the virtual machine. It can run the same commands and functions as the **main** section such as combos and user created functions. It is generally used to populate variables/arrays and set up the script. In this example, if the Cronus Zen has a PS4 controller connected when the script is first loaded, example2 is assigned a value of 27. Otherwise it is assigned a value of 1. [Init Sectionchevron-right](https://gpc.cronusmax.com/init-section) ### [hashtag](https://gpc.cronusmax.com/basic-gpc-structure#gpc-main-section) GPC Main Section The **main** section is the heart and sole of any GPC script, all functions/combos are initailly executed from this function. It is the only mandatory section and every GPC must have one. Unlike **combos** and user created **functions**, a GPC may only have one **main** section. It is run in a loop. The Virtual Machine runs through the code in order and generates an output report as it goes. When the Virtual Machine gets to the end of the **main** section, the output report is then ready to be sent to the console. Once the console requests new data, the output report is sent and the **main** starts another run. As commands are run through in order, setting the value of a button in more than one place means that only the last command is sent. For example, in this script: A value of -100 will be sent to the console. The console will not see the LY axis set to 100 because the output report for that control is modified again before it is sent to the console. [Main Sectionchevron-right](https://gpc.cronusmax.com/main-section) ### [hashtag](https://gpc.cronusmax.com/basic-gpc-structure#combo-section) Combo Section A combo (which is short for Combination) is a function that will perform a set of instructions in order and for the amount of time assigned to the wait command directly after the commands. In this script, when the combo is run, it will set identifier 20 (X on an Xbox controller or Square on a PlayStation controller) to 100% (Fully pressed) for the time set in the variable example1 (10 milliseconds in this case) and then do nothing for 100 milliseconds. You can assign multiple commands before a single wait statement. For example, in the following combo, both the Left Bumper and Right Trigger will be pressed for 500 milliseconds (half a second) when the combo is run. It will then do nothing for 500 milliseconds. [Combo Sectionchevron-right](https://gpc.cronusmax.com/combo-section) ### [hashtag](https://gpc.cronusmax.com/basic-gpc-structure#function-section) Function Section A user created function is similar to the main section. Commands are processed in order and any GPC which is valid in the main section can be used here. Functions must be placed at the end of the of a GPC script. The main difference with functions is they are only run when called and can return a value. When a value is returned from a function, the function is terminated and any code beyond that point is not executed. GPC user functions are global, this means that can be called from the init, main and combo sections. A function can even be called from within another function. [User Created Functionschevron-right](https://gpc.cronusmax.com/functions) [hashtag](https://gpc.cronusmax.com/basic-gpc-structure#putting-it-all-together) Putting it all together ------------------------------------------------------------------------------------------------------------- Copy // Definitions Section (OPTIONAL) define zero = 0; define one = 1; define two = 2; // Data Section (OPTIONAL) data (zero, one, two, 10, 128, 40); // Remapping Section (OPTIONAL) remap XB1_LB -> XB1_RB; remap XB1_RB -> XB1_LB; // Variable Initialization Section (OPTIONAL) int example1 = 10; int example2, example3; int example4 = 17; // GPC Initialization Section (OPTIONAL) init { if(get_controller() == PIO_PS4){ example2 = 27; } else { example2 = 1; } } // GPC Main Section (MANDATORY) main { if(example_function()){ if(get_val(example3)){ combo_run(testing); } } } // Combo Section (Optional) combo testing{ set_val(20, 100); wait(example1); wait(100); } // Function Section (Optional) function example_function(){ if(get_val(example2)){ example3 = 18; return 1; } else if(get_val(example4)){ example3 = 19; return 1; } return 0; } [PreviousStyle Guidechevron-left](https://gpc.cronusmax.com/style-guide) [NextDefinitionschevron-right](https://gpc.cronusmax.com/definitions) Last updated 6 years ago Was this helpful? Was this helpful? Copy // Variable Initialization Section (OPTIONAL) int example1 = 10; int example2, example3; int example4 = 17; Copy // GPC Initialization Section (OPTIONAL) init { if(get_controller() == PIO_PS4){ example2 = 27; } else { example2 = 1; } } Copy // GPC Main Section (MANDATORY) main { if(example_function()){ if(get_val(example3)){ combo_run(testing); } } } Copy main { set_val(XB1_LY, 100); set_val(XB1_LY, -100); } Copy // Combo Section (Optional) combo testing{ set_val(20, 100); wait(example1); wait(100); } Copy combo LB_AND_RT { set_val(XB1_LB, 100); set_val(XB1_RT, 100); wait (500); wait (500); } Copy // Function Section (Optional) function example_function(){ if(get_val(example2)){ example3 = 18; return 1; } else if(get_val(example4)){ example3 = 19; return 1; } return 0; } --- # Main Section | Cronus GPC Documentation The **main** section is the heart and sole of any GPC script. It is run in a constant loop and any code executed during run time can be traced back to it. Therefore, the main section is mandatory and a GPC script is not valid without one. Just as with any nested code, the **main** section start and finish points are denoted with a `{` or `}` respectively, like so; Copy main { //Main Start } When the main section reaches the End point, the output report to the console is created, any [remapsarrow-up-right](https://cronusmax.com/manual/remapping.htm) are evaluated and the report is sent to the console. The main section is then restarted from the beginning. Code within the **main** section is executed in the order it is written. It is important to remember this when building your own GPC scripts as the output report to the console is created at the end of the **main** section, so it is possible to create code which would cancel each other out and result in a different output to the console than you expected. For example; Copy int press_lt; main{ if(get_val(XB1_RT)){ press_lt = TRUE; } press_lt = FALSE; if(press_lt) { set_val(XB1_LT, 100); } } circle-info As you can see above, the variable 'press\_lt' is set to TRUE when the RT/R2 button is pressed but is immediately set to FALSE in the next line of code. Therefore the`**if**``(press_lt)` statement will always be FALSE and the code nested within the if statement will never be executed. However, if we were to move the code around, then we would get the expected output; If RT/R2 is pressed then `press_lt` is set to TRUE after it has been set to FALSE, the `**if**``(press_lt)` statement will see that it is TRUE and the nested code will be run. If RT/R2 isn't being pressed then 'press\_lt' is not set to TRUE after is has been set to FALSE and the nested code is not run. If `press_lt = FALSE;` was nested within an **else** statement, which is a better way to do it, then it could be placed after the `press_lt = TRUE;` line, like so; The above code will operate as expected because the **else** statement will only be TRUE if RT/R2 is not being pressed. Therefore, 'press\_lt' is only set to false when RT/R2 is not pressed. So, as you can see in the above examples, it is important to remember that code is executed in the order it is written and simply moving the placement of a line can have a significant effect of the output to the console. [PreviousInit Sectionchevron-left](https://gpc.cronusmax.com/init-section) [NextCombo Sectionchevron-right](https://gpc.cronusmax.com/combo-section) Last updated 6 years ago Was this helpful? Was this helpful? Copy int press_lt; main{ press_lt = FALSE; if(get_val(XB1_RT)){ press_lt = TRUE; } if(press_lt) { set_val(XB1_LT, 100); } } Copy int press_lt; main{ if(get_val(XB1_RT)){ press_lt = TRUE; } else { press_lt = FALSE; } if(press_lt) { set_val(XB1_LT, 100); } } --- # Constants | Cronus GPC Documentation [Zenchevron-right](https://gpc.cronusmax.com/constants/zen) [Keyboardchevron-right](https://gpc.cronusmax.com/constants/keyboard-and-mouse) [Controllerchevron-right](https://gpc.cronusmax.com/constants/controller-constants) [Racing Wheelchevron-right](https://gpc.cronusmax.com/constants/racing-wheel) [Tracechevron-right](https://gpc.cronusmax.com/constants/trace) [Memorychevron-right](https://gpc.cronusmax.com/constants/memory) [Miscchevron-right](https://gpc.cronusmax.com/constants/misc) [PreviousUser Created Functionschevron-left](https://gpc.cronusmax.com/functions) [NextZenchevron-right](https://gpc.cronusmax.com/constants/zen) Last updated 4 years ago Was this helpful? Was this helpful? --- # Variables | Cronus GPC Documentation All variables in GPC are 16 bit signed integers. An integer (from the Latin 'integer' which means 'whole') is a number which can be written without a fractional component. For example, 0, 20, 128 and -1000 are all integers while 4.2, 5.6 or -110.9 are not. Therefore, GPC **does not support fractions** and will round down any decimal to a zero. Meaning 3.4 would become 3. 16 bit signed means the variables can store an integer ranging from -32768 to +32767 The following sections on variables can be found within this page; Declaring Variables Boolean Variables Arrays Accessing any variable via an array ### [hashtag](https://gpc.cronusmax.com/variables#declaring-variables-1) Declaring Variables A variable is a place where data can be stored in the Virtual Machines memory. A variables name can start with either an underscore ( \_ ) or a letter and can be followed by any combination of letters, digits or underscores. They are however case sensitive, so cronuszen, CronusZen and CRONUSZEN would specify three different variables. Variables defined this way in GPC are global, this means they can accessed and modified within the **init** or **main** sections as well as a **combo** or **function**. Only variables assigned to user created functions are local. Details of how variables operate within user functions can be found here. Global variables must be declared before the **main** or **init** sections and therefore cannot be declared after or in either of those sections. As shown below; Copy int myVar = 100, MYVar; int MYVAR = -40; init { int incorrect; //This will cause an error } int Incorrect; //This will also cause an error main { int INCORRECT; //This will again cause an error } circle-info Variables are always assigned a value. If no value is assigned when they are declared, then they are initialized with a value of 0 (zero). The value assigned to a variable can be altered during runtime, as shown below; ### [hashtag](https://gpc.cronusmax.com/variables#boolean-variables-1) Boolean Variables Unlike other programming languages, such as C# for example, GPC does not require a separate variable type for Boolean values. The integers in GPC have been designed to support Boolean expressions. The keywords TRUE and FALSE have been assigned the values 1 and 0 respectively as shown in the example below; circle-info You can therefore use integers in your code to create a toggle switch which enables or disables sections of code, like so; circle-info As seen in the above example, a variable will return TRUE in an if statement if it has any value other than 0 (zero). You can however use operators should you wish for your nested code to only be active if a variable is a certain value; ### [hashtag](https://gpc.cronusmax.com/variables#arrays-1) Arrays An array is a method for creating multiple variables in a single command. Arrays are 0 (zero) based so creating a 5 dimensional array will create 5 variables which can be accessed with the indexes 0 through 4, as shown below: circle-info Arrays are assigned a value of 0 (zero) when initialized and cannot be assigned a different value before the **init** section. They are also global and can be assigned a value or modified at any point during run time in your script, like so: ### [hashtag](https://gpc.cronusmax.com/variables#accessing-any-variable-via-an-array-1) Accessing any variable via an array When a script is compiled, all global variables are placed within an array. You can therefore use an array call to access subsequent variables from a variable which has not be initialized as an array, as shown below: [PreviousRemappingchevron-left](https://gpc.cronusmax.com/remapping) [NextInit Sectionchevron-right](https://gpc.cronusmax.com/init-section) Last updated 6 years ago Was this helpful? Was this helpful? Copy int myVar = 100, MYVar; // myVar initial value is 100, MYVar initial value is 0 int MYVAR = -40; // MYVAR initial value is -40 main { MYVar = myVAR - MYVAR; // MYVar value is now 60 } Copy int myvar, MYVAR; main { myvar = TRUE; //myvar = 1 MYVAR = FALSE; //MYVAR = 0; } Copy int myvar; main { if(event_press(XB360_A)) { //If A / Cross is pressed on the controller myvar = !myvar; //myvar equals not myvar. So if myvar is TRUE or has a value it will be made FALSE / assigned the value of 0 (zero) //If myvar is FALSE or has a value of 0 (zero) it will be made TRUE / assigned the value of 1 } if(myvar) { //If myvar has a value other than 0 (zero) //Do something } } Copy int myvar; main { if(event_press(XB360_A)) { //If A / Cross is pressed on the controller myvar = myvar + 1; //myvar equals myvar plus 1. } if(event_press(XB360_X)) { //If X / Square is pressed on the controller myvar = myvar - 1; //myvar equals myvar minus 1. } if(myvar == 2) { //If mvar has a value of 2. //Do something } if(myvar >= 4) { //If mvar has a value of greater than or equal to 4. //Do something } if(myvar < 2) { //If mvar has a value less than 2. //Do something } } Copy int myvar[5]; main { //int myvar[5] creates 5 variables myvar[0]; //1st Variable myvar[1]; //2nd Variable myvar[2]; //3rd Variable myvar[3]; //4th Variable myvar[4]; //5th Variable } Copy int myvar[5]; init { myvar[0] = 20; //myvar[0] equals 20 myvar[1] = 10; //myvar[1] equals 10 } main { myvar[2] = myvar[0] + myvar[1]; //myvar[2] equals 30 (20 + 10) myvar[3] = 15; //myvar[3] equals 15 myvar[4] = add_two_variables(myvar[2], myvar[3]); //myvar[4] equals 45 (30 + 15) } function add_two_variables(_1st_variable, _2nd_variable) { return _1st_variable + _2nd_variable; } Copy int myvar; int _1st = 10; int _2nd = 20; int _3rd = 30; int _4th = 40, _5th = 50; int var_to_place_value_into; main { var_to_place_value_into = myvar[1]; //var_to_place_value_into equals 10 (_1st) var_to_place_value_into = myvar[2]; //var_to_place_value_into equals 20 (_2nd) var_to_place_value_into = (myvar[4] + myvar[5]) - myvar[3]; //var_to_place_value_into equals 60 ((40 + 50) - 30) var_to_place_value_into = _2nd[1]; //var_to_place_value_into equars 30 (_3rd) } --- # Remapping | Cronus GPC Documentation Remappings are defined at the beginning of a script and must be done before the main procedure. They cannot be executed during run time. Command Name Description [remap](https://gpc.cronusmax.com/remapping#remap) Assigns the value of the controller input to the output [unmap](https://gpc.cronusmax.com/remapping#unmap) Disconnects an input from the output report [hashtag](https://gpc.cronusmax.com/remapping#remap) remap --------------------------------------------------------------- `remap` assigns the value of the input identifier to the output identifier Copy remap PS4_CROSS -> PS4_SQUARE; circle-exclamation Although you define remaps at the beginning of a script, the Virtual Machine does not execute the remaps until the main second has finished the current iteration. This means that any scripting operations on the remapped entries for inputs should be programmed for the original buttons and without considering the remapped item. #### [hashtag](https://gpc.cronusmax.com/remapping#syntax) 🔴 **Syntax** `remap < input_identifier > -> < output_identifier >;` #### [hashtag](https://gpc.cronusmax.com/remapping#parameters) ⚪ **Parameters** : any defined variable. : index point of the bit to be set with a range of 0 to 15. #### [hashtag](https://gpc.cronusmax.com/remapping#returns) 🔵 **Returns** Nothing [hashtag](https://gpc.cronusmax.com/remapping#unmap) unmap --------------------------------------------------------------- `unmap` disconnects an input from the output report. This means that although the Virtual Machine can still see the value of the button/axis on the input report, it will not pass its value onto the console in the output report. You can therefore still use an unmapped button to run code or start combos in your GPC script without worrying about its original function being sent to the console. #### [hashtag](https://gpc.cronusmax.com/remapping#syntax-1) 🔴 **Syntax** `unmap ;` #### [hashtag](https://gpc.cronusmax.com/remapping#parameters-1) ⚪ **Parameters** : any defined variable. #### [hashtag](https://gpc.cronusmax.com/remapping#returns-1) 🔵 **Returns** Nothing [PreviousData Sectionchevron-left](https://gpc.cronusmax.com/data-section) [NextVariableschevron-right](https://gpc.cronusmax.com/variables) Last updated 6 years ago Was this helpful? * [remap](https://gpc.cronusmax.com/remapping#remap) * [unmap](https://gpc.cronusmax.com/remapping#unmap) Was this helpful? Copy unmap PS4_TRIANGLE; // unmaps the PS4_TRIANGLE identifier; unmap ALL_REMAPS; // unmaps all controller identifiers which have been remapped; --- # Init Section | Cronus GPC Documentation The initialization or **init** section of a GPC is identical to the **main** section other than it is not run in a loop. The **init** section is run once before the first iteration of the **main** section when a script is first loaded and can run any **combo** or call any **function**. You can even modify the value of variables within it, just as you would in the **main** section. The init section is used to setup your script. For example, say you wished to use the same Rapid Fire script on a PlayStation 3 and Xbox One but your PlayStation 3 game uses the bumper to shoot where as your Xbox One game uses the trigger, you could use the init section to automatically adjust your script on when it is loaded as shown in the following example; Copy int FIRE_BTN; init { if(get_console() == PIO_PS3) { //If connected to a PS3 when loaded FIRE_BTN = 3; //3 = LB/L1 } else { //If connected to any other console FIRE_BTN = 4; //4 = RT/R1 } } main { if(get_val(FIRE_BTN)) { combo_run(Rapid_Fire); } } combo Rapid_Fire { set_val(FIRE_BTN, 100); wait(50); set_val(FIRE_BTN, 0); wait(40); set_val(FIRE_BTN, 0); } The **init** section is very useful when you are using persistent variables as you do not want to constantly recall the values stored in them during run time. Information on Persistent Variables and how they can be recalled in the **init** section can be found here. [PreviousVariableschevron-left](https://gpc.cronusmax.com/variables) [NextMain Sectionchevron-right](https://gpc.cronusmax.com/main-section) Last updated 6 years ago Was this helpful? Was this helpful? --- # OLED | Cronus GPC Documentation Name Description Value Zen Plus OLED\_WHITE The White color constant 1 ✔️ ❌ OLED\_BLACK The Black color constant 0 ✔️ ❌ OLED\_WIDTH The width of the OLED in pixels 128 ✔️ ❌ OLED\_HEIGHT The height of the OLED in pixels 64 ✔️ ❌ ### [hashtag](https://gpc.cronusmax.com/constants/zen/oled-constants#oled-font-constants) OLED Font constants Name Description Value Zen Plus OLED\_FONT\_SMALL Small font 0 ✔️ ❌ OLED\_FONT\_MEDIUM Medium font 1 ✔️ ❌ OLED\_FONT\_LARGE Large font 2 ✔️ ❌ OLED\_FONT\_SMALL\_WIDTH Width of each character for the small font 7 ✔️ ❌ OLED\_FONT\_MEDIUM\_WIDTH Width of each character for the medium font 11 ✔️ ❌ OLED\_FONT\_LARGE\_WIDTH Width of each character for the large font 16 ✔️ ❌ OLED\_FONT\_SMALL\_HEIGHT Height of each character for the small font 10 ✔️ ❌ OLED\_FONT\_MEDIUM\_HEIGHT Height of each character for the medium font 18 ✔️ ❌ OLED\_FONT\_LARGE\_HEIGHT Height of each character for the large font 26 ✔️ ❌ [PreviousZenchevron-left](https://gpc.cronusmax.com/constants/zen) [NextASCII Constantschevron-right](https://gpc.cronusmax.com/constants/zen/ascii) Last updated 5 years ago Was this helpful? Was this helpful? --- # Combo Section | Cronus GPC Documentation A **combo** (short for combination) is a combination of pre-programmed instructions which are executed in sequence. Just like the [main](https://gpc.cronusmax.com/main-section) section, commands within a combo are performed in the order they are written. You can run any code you can run in the main section within a **combo** such as calling functions or setting variables, although this is generally unnecessary and usually results in nothing more than a waste of stack memory and byte-code space. A **combo** is ideal suited to setting the output of a button for a specific length of time which is done using the **wait** command, a command that is unique to combos and cannot be used elsewhere. Just as with [variables](https://gpc.cronusmax.com/variables) , a combos name can start with either an underscore ( \_ ) or a letter and can be followed by any combination of letters, digits or underscores. Copy main { if (event_press(XB1_A) { combo_run(mycombo); } if (event_press(XB1_B) { if(combo_running(mycombo)) { combo_stop(mycombo); } } if (event_press(XB1_X) { combo_restart(mycombo); } } combo mycombo { set_val(XB1_A, 100); wait(200); wait(4000); set_val(XB1_B, 100); wait(200); wait(4000); set_val(XB1_X, 100); wait(200); wait(4000); set_val(XB1_Y, 100); wait(200); wait(4000); set_val(XB1_LB, 100); wait(200); wait(4000); call(mycombo2); } combo mycombo2 { set_val(XB1_RB,100); wait(100); wait(2000); } [Combo Functionschevron-right](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions) [PreviousMain Sectionchevron-left](https://gpc.cronusmax.com/main-section) [NextUser Created Functionschevron-right](https://gpc.cronusmax.com/functions) Last updated 4 years ago Was this helpful? Was this helpful? --- # Zen | Cronus GPC Documentation [OLEDchevron-right](https://gpc.cronusmax.com/constants/zen/oled-constants) [ASCII Constantschevron-right](https://gpc.cronusmax.com/constants/zen/ascii) [PIOchevron-right](https://gpc.cronusmax.com/constants/zen/pio) [PreviousConstantschevron-left](https://gpc.cronusmax.com/constants) [NextOLEDchevron-right](https://gpc.cronusmax.com/constants/zen/oled-constants) Last updated 4 years ago Was this helpful? Was this helpful? --- # User Created Functions | Cronus GPC Documentation ### [hashtag](https://gpc.cronusmax.com/functions#user-created-functions) User Created Functions As well as having a significant number of built in functions, GPC allows the user to create their own custom functions. A **function** can run any code valid in the **main** section and code is also executed in the order it is written. Copy main { if (get_val(PS4_CROSS)) { // If we get a value other than 0 from A / CROSS... if (myfunction(10,20) == 30) { // If myfunction returns a value of 30 combo_run(mycombo); // run combo mycombo } else if (myfunction(10, 20) == -10) { // If myfunction returns a value of -10 combo_stop(mycombo); // stop mycombo if it is running } } } combo mycombo { set_val(PS4_TRIANGLE, 100); wait(1000); wait(1000); } function myfunction(_1stvalue, _2ndvalue) { // myfunction start if (get_val(PS4_CIRCLE)) { // If we get a value other than 0 from B / Circle... return _1stvalue + _2ndvalue; // return '_1stvalue' plus '_2ndvalue' } return _1stvalue - _2ndvalue; // other '_1stvalue' - '_2ndvalue' } Calling a Function Function Name and Declaration Function Parameters Returning from a Function ### [hashtag](https://gpc.cronusmax.com/functions#calling-a-function-1) **Calling a Function** To call (or run) a **function**, you simply type its name and put any parameters it requires in between ( and ). When a **function** is called, the code within it is executed and the **return** value is sent back to where it was called from. User functions are what is known as global scope, this means they can be called from the **init**, **main** and **combo** sections. They can even be called from within another **function**, however, GPC does not support recursive calls of functions. This means a **function** cannot be called from within itself. ### [hashtag](https://gpc.cronusmax.com/functions#function-name-and-declaration-1) **Function Name and Declaration** To declare a **function** type **function** followed by a name and (). Within the brackets () you place the names of any parameters you would like the function to have, if any. Function names and parameters follow the same rules as a [variable](https://gpc.cronusmax.com/variables) , they can start with either an underscore ( \_ ) or a letter and can be followed by any combination of letters, digits or underscores. Functions must be declared last in a GPC script though, after the [**main**](https://gpc.cronusmax.com/main-section) and any [**combo**](https://gpc.cronusmax.com/combo-section) section. **Syntax** `function ( );` **Parameters** ` : Optional parameters. You can use as many as you wish or none at all. Each one must be separated with a comma (,)` ### [hashtag](https://gpc.cronusmax.com/functions#function-parameters-1) **Function Parameters** Function parameters can be thought of like local variables as they cannot be accessed outside of the function they are defined within. A value can be passed to them and they can be used within the function just like a variable could. As GPC only supports the one data type (16bit Integers) you do not need to specify the data type of parameters within a function and the name of a parameter follows the same rules as a function or variable, they can start with either an underscore ( \_ ) or a letter and can be followed by any combination of letters, digits or underscores. Function parameters are optional. You are not required to have any at all. The example above is perfectly valid. ### [hashtag](https://gpc.cronusmax.com/functions#returning-from-a-function-1) **Returning from a function** **return** is a command unique to functions. It is not mandatory for each user **function** to have a **return** value though. If there is no **return** in a **function**, then 0 (zero) will be automatically returned. You can have multiple **return** points within a **function**. Once the first **return** command is executed, the **function** returns a value to where is was called and the **function** is terminated. The code beyond that point in the **function** will not be run. Returning a value is one of the single most useful commands within a function as it can be used as a boolean value to enable or disable sections of code, to set parameters in other functions or to set a variable to a desired value. In the following example, you will see a couple of uses for the **return** command; ### [hashtag](https://gpc.cronusmax.com/functions#putting-it-all-together) Putting it all together When the GPC script is first loaded, the two variables **RF\_HOLD** and **RF\_NULL** are created with a value of 40 and 30 respectively. The main section then starts its first iteration (run). When it gets to the line below the myfunction() function is executed. The code in 'myfunction()' is then run. If XB1\_VIEW is **not** being pressed, the code nested in the statement: is ignored as the **if** statement is FALSE. So the next line executed in the **function** is: at which point the value of 1 is returned to the statement; Thus making the above statement TRUE and the code; is executed. The main section carries on until it reaches its end point and loops. However, if XB1\_VIEW is being held when 'myfunction()' is executed, then the following code is run; As you can see, if XB1\_A or XB1\_B are not also held down, the code set a few buttons to 0, writes the value of our two variables to TRACE values and then most importantly, reaches the line: at which point a value of 0 is returned to the statement; making it FALSE, so the code; which is nested within that statement is ignored and not executed. If XB1\_VIEW and XB1\_A are both held when 'myfunction()' is executed, then the following line of code is reached and run; what the above line means is the variable RF\_HOLD equals the return value of the **function** 'adjust\_speed' or you could say the **return** value from 'adjust\_speed' is stored in RF\_HOLD. So lets take a look at how that **function** returns a value. As you can see above, four values are being sent to the **function** 'adjust\_speed'. The value of RF\_HOLD, 10, 1000 and 10. So lets take a look at the declaration of the **function** 'adjust\_speed'; **function** 'adjust\_speed' requires 4 arguments, the variable to be adjusted, the minimum value you want it to be, the maximum value you wish for it to be and how much to adjust it by each increment. To manipulate the variable, the function executes the following code; In the first part of this code, if XB1\_RB is pressed and the variable value passed to the **function** is less than the maximum value allowed, the value passed in the forth parameter (10 in this case) is added to the value of var. The value of var is the returned to where the **function** is called. Therefore making RF\_HOLD equal 10 more than it did before. If XB1\_LB is pressed and the variable value passed to the **function** is greater than the minimum value allowed, the value passed in the forth parameter is subtracted from the value of var. The value of var is the returned to where the **function** is called. Therefore making RF\_HOLD equal 10 less than it did before. An identical process is carried out if XB1\_VIEW and XB1\_B are pressed when 'myfunction()' is executed with the exception being that RF\_NULL is adjusted rather than RF\_HOLD. [PreviousCombo Sectionchevron-left](https://gpc.cronusmax.com/combo-section) [NextConstantschevron-right](https://gpc.cronusmax.com/constants) Last updated 6 years ago Was this helpful? Was this helpful? Copy myfunction(10,20); Copy function myfunction() {} Copy function myfunction() {} Copy int RF_HOLD = 40; int RF_NULL = 30; main { if(myfunction()) { if(get_val(XB1_RT)) { combo_run(Rapid_Fire); } } } combo Rapid_Fire { set_val(XB1_RT, 100); wait(RF_HOLD); set_val(XB1_RT, 0); wait(RF_NULL); set_val(XB1_RT, 0); } function myfunction() { if(get_val(XB1_VIEW)) { if(get_val(XB1_A)) RF_HOLD = adjust_speed(RF_HOLD, 10, 1000, 10); if(get_val(XB1_B)) RF_NULL = adjust_speed(RF_NULL, 10, 1000, 10); set_val(XB1_A, 0); set_val(XB1_B, 0); set_val(XB1_LB, 0); set_val(XB1_RB, 0); set_val(XB1_VIEW, 0); set_val(TRACE_1, RF_HOLD / 10); set_val(TRACE_2, RF_NULL / 10); return 0; } return 1; } function adjust_speed(var, min_value, max_value, adjustment_increment) { if(event_press(XB1_RB) && var < max_value) var = var + adjustment_increment; if(event_press(XB1_LB) && var > min_value) var = var - adjustment_increment; return var; } Copy if(myfunction()) { Copy if(get_val(XB1_VIEW)) { //If we get a value from View other than 0 Copy return 1; //If we do not get a value from View, return 1 Copy if(myfunction()) { Copy if(get_val(XB1_RT)) { //If we get a value from RT / R2 other than 0 combo_run(Rapid_Fire); //Run combo Rapid_Fire } Copy if(get_val(XB1_A)) RF_HOLD = adjust_speed(RF_HOLD, 10, 1000, 10); if(get_val(XB1_B)) RF_NULL = adjust_speed(RF_NULL, 10, 1000, 10); set_val(XB1_A, 0); set_val(XB1_B, 0); set_val(XB1_LB, 0); set_val(XB1_RB, 0); set_val(XB1_VIEW, 0); set_val(TRACE_1, RF_HOLD / 10); set_val(TRACE_2, RF_NULL / 10); return 0; //Return 0 Copy return 0; //Return 0 Copy if(myfunction()) { Copy if(get_val(XB1_RT)) { //If we get a value from RT / R2 other than 0 combo_run(Rapid_Fire); //Run combo Rapid_Fire } Copy RF_HOLD = adjust_speed(RF_HOLD, 10, 1000, 10); Copy function adjust_speed(var, min_value, max_value, adjustment_increment) { Copy if(event_press(XB1_RB) && var < max_value) var = var + adjustment_increment; if(event_press(XB1_LB) && var > min_value) var = var - adjustment_increment; return var; --- # Identifiers | Cronus GPC Documentation [Constantschevron-right](https://gpc.cronusmax.com/constants) [PreviousOperator Typeschevron-left](https://gpc.cronusmax.com/operator-types) [NextInternal Functionschevron-right](https://gpc.cronusmax.com/functions-and-commands/internal-functions) Last updated 4 years ago Was this helpful? Was this helpful? --- # Keyboard | Cronus GPC Documentation [Keyboardchevron-right](https://gpc.cronusmax.com/constants/keyboard-and-mouse/keyboard-constants) [PreviousPIOchevron-left](https://gpc.cronusmax.com/constants/zen/pio) [NextKeyboardchevron-right](https://gpc.cronusmax.com/constants/keyboard-and-mouse/keyboard-constants) Last updated 4 years ago Was this helpful? Was this helpful? --- # Misc | Cronus GPC Documentation Name Value Zen Plus ALL\_REMAPS \-1 ✔️ ✔️ FALSE 0 ✔️ ✔️ TRUE 1 ✔️ ✔️ NOT\_USE 0 ✔️ ✔️ DZ\_CIRCLE 101 ✔️ ✔️ [PreviousMemorychevron-left](https://gpc.cronusmax.com/constants/memory) [NextFlow Controlchevron-right](https://gpc.cronusmax.com/flow-control) Last updated 6 years ago Was this helpful? Was this helpful? --- # Flow Control | Cronus GPC Documentation ![](https://gpc.cronusmax.com/~gitbook/image?url=https%3A%2F%2F1445201306-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-legacy-files%2Fo%2Fassets%252F-LuT3mr_GU9LrnSDmVx9%252F-LuVFpGoidy0JAbB4qoG%252F-LuVKXXaRyjQH4VoC8dQ%252Ftempsnip.png%3Falt%3Dmedia%26token%3D295e8580-f978-416d-994f-156d2eab65e7&width=768&dpr=3&quality=100&sign=c14add33&sv=2) Command Description Zen Plus if Executes a block of code if the condition is met ✔️ ✔️ else Executes a block of code if the previous if condition is not met ✔️ ✔️ else if Executes a block of code if the previous if condition is not met but the current condition is met ✔️ ✔️ while A loop that runs while a condition is met ✔️ ✔️ do while A loop that runs at least once ✔️ ✔️ for A loop that runs a set amount of times ✔️ ✔️ break Breaks out early while in a loop ✔️ ✔️ if else else if while do while for break The **if** command is one of the single most useful tools for your GPC scripting needs. It allows you to control when certain blocks of code are run and it takes any expression, function or code which returns or has a value. It can also be used in the **init**, **main**, **combo** and **function** sections of your code. The **if** command works by evaluating the expression within it to its boolean value. An expression is anything which has a value. Such as a function call which returns a value, a variable, a mathematical sum. literal values and comparisons. In computer programming languages, a Boolean is a data type with only the two possible values, TRUE or FALSE. In GPC, FALSE means 0 and TRUE is a value other than 0 be it a negative or positive value. If the expression placed within an **if** commands brackets is TRUE, then the code nested within it is executed, as shown below Should you wish to execute a different block of code when an **if** command does not return TRUE then you would use the **else** command. An **else** command must have an **if** command preceding it. The code block contained within an **else** command will be executed if the expression in the **if** statement returns FALSE, as shown below **else if** is a combination of **else** and **if**. Just like the **else** command it allows for a different block of code to be executed when the statement within the if command returns FALSE. However, it will only execute the code block when the statement within its parameter returns TRUE. For example, if you were playing a first person shooter game and wished for rapid fire to be disabled when you aim down the sights but wanted the Cronus Zen to automatically hold breath in the game to steady your aim while aiming down the sights, the following code would do this for you ~**NOTE:**~ ~Example below is more of a how it works, needs to be updated with one reflecting above text!~ The operation of the **while** command is straight forward, it will execute code nested within it until the expression contained in its parameter is no longer TRUE do while is similar to while in that it runs a block of code while a condition is true, the difference is that it executes the block at least once, see below for an example The **for** loop can be used to run a block of code for a set amount of times, the syntax for using it is as follows: **for (** < initalizer > ; < condition > ; < increment >) See the below example for how it could be used The **break** command is used to end a loop early based on a condition, see below for an example [PreviousMiscchevron-left](https://gpc.cronusmax.com/constants/misc) [NextPersistent Memorychevron-right](https://gpc.cronusmax.com/persistent-variables) Last updated 6 years ago Was this helpful? Was this helpful? Copy main { if (TRUE) { // This will always run as the condition above is always true } if (FALSE) { // This will never run as the condition above is never true } } Copy main { if (FALSE) { // This will never run as the condition above is never true } else { // This will run as the result of the previous condition never // is true } } Copy main { if (FALSE) { // This will never run as the condition above is never true } else if (TRUE) { // This will run as the result of the previous condition never // is true but the condition here is always true } } Copy int a; main { while (a < 10) { // Do something while a is less than 10 } } Copy int a = 0; main { while (a != 0) { // This will never execute as a is already 0 } do { // This will be executed once, then the condition will be checked // to see if we should run the block again } while (a != 0); } Copy int a; main { for (a = 0; a < 10; a++) { // Whatever you put here will be run 10 times } } Copy int a; main { while (TRUE) { if (a == 0) { // We want to end the loop if the variable a has a value of 0 break; } } } --- # PIO | Cronus GPC Documentation Name Value Zen Plus PIO\_NONE 0 ✔️ ✔️ PIO\_AUTO 0 ✔️ ✔️ PIO\_PS3 1 ✔️ ✔️ PIO\_XB360 2 ✔️ ✔️ PIO\_WII 3 ✔️ ✔️ PIO\_PS4 4 ✔️ ✔️ PIO\_XB1 5 ✔️ ✔️ [PreviousASCII Constantschevron-left](https://gpc.cronusmax.com/constants/zen/ascii) [NextKeyboardchevron-right](https://gpc.cronusmax.com/constants/keyboard-and-mouse) Last updated 4 years ago Was this helpful? Was this helpful? --- # Polar | Cronus GPC Documentation Name Description Value Zen Plus POLAR\_RS set\_polar identifier for the right stick 2 ✔️ ❌ POLAR\_LS set\_polar identifier for the left stick 4 ✔️ ❌ POLAR\_RX get/set\_val identifier for the right stick X axis 44 ✔️ ❌ POLAR\_RY get/set\_val identifier for the right stick Y axis 45 ✔️ ❌ POLAR\_LX get/set\_val identifier for the left stick X axis 46 ✔️ ❌ POLAR\_LY get/set\_val identifier for the left stick Y axis 47 ✔️ ❌ [PreviousControllerchevron-left](https://gpc.cronusmax.com/constants/controller-constants) [NextLEDchevron-right](https://gpc.cronusmax.com/constants/controller-constants/controller-led-constants) Last updated 5 years ago Was this helpful? Was this helpful? --- # G27 | Cronus GPC Documentation circle-info Please note that scripting is not currently functional for wheels. These are used for testing. Name Value G27\_PS 0 G27\_SELECT 1 G27\_START 2 G27\_RPADDLE 3 G27\_R2 4 G27\_R3 5 G27\_LPADDLE 6 G27\_L2 7 G27\_L3 8 G27\_GAS 9 G27\_CLUTCH 10 G27\_STEERING 11 G27\_BRAKE 12 G27\_UP 13 G27\_DOWN 14 G27\_LEFT 15 G27\_RIGHT 16 G27\_TRIANGLE 17 G27\_CIRCLE 18 G27\_CROSS 19 G27\_SQUARE 20 G27\_SHIFT 21 G27\_L4 22 G27\_L5 23 G27\_R4 24 G27\_R5 25 **\-- Values Range --** ( 0 | 100 ) means 0 or 100 ( 0 ~ 100 ) means any value between 0 and 100 ( -100 ~ 100 ) means any value between -100 and 100 Accelerometers: 25% represents 1G; 100% == 4G [PreviousG29chevron-left](https://gpc.cronusmax.com/constants/racing-wheel/g29) [NextG25chevron-right](https://gpc.cronusmax.com/constants/racing-wheel/g25) Last updated 4 years ago Was this helpful? Was this helpful? --- # Persistent Memory | Cronus GPC Documentation triangle-exclamation It is important to remember that each time this function is called, data is read from the EEPROM on the Cronus. The life of an EEPROM is typically rated in the amount of read/write cycles that can be performed and although the EEPROM in the Cronus is rated for 1000's of these, you should still ensure that this function is NOT going to called in every iteration of the main loop. Never use it at the base level of the main and always ensure it is nested within an if statement which will only return TRUE for one iteration, such as event\_press. Persistence in programming means a state which remains after the process that created it has ended. For example a word processor or paint application achieves this by saving the document to a file. The Cronus does this by writing variable values to its EEPROM (Electrically Erasable Programmable Read-Only Memory). This allows you to save the value of a variable so it can be recalled the next time the script is loaded. circle-info ![](https://gpc.cronusmax.com/~gitbook/image?url=https%3A%2F%2F1445201306-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-legacy-files%2Fo%2Fassets%252F-LuT3mr_GU9LrnSDmVx9%252F-LxeE9uE3S6kTkfhUNj6%252F-LxeEoPje405rVx8Oir8%252Fcompare_cmp.png%3Falt%3Dmedia%26token%3Dd8dbb490-c6da-40dd-aedb-f5c48c02ff30&width=40&dpr=3&quality=100&sign=539439a4&sv=2)There are a total of 160 persistent variables on the CronusMax Plus (16 Global Variables and 144 Private Variables) circle-info ![](https://gpc.cronusmax.com/~gitbook/image?url=https%3A%2F%2F1445201306-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-legacy-files%2Fo%2Fassets%252F-LuT3mr_GU9LrnSDmVx9%252F-LxeE9uE3S6kTkfhUNj6%252F-LxeExU9uYb1OoF_X8cJ%252Fcompare_zen.png%3Falt%3Dmedia%26token%3D1c5d8d7c-96b0-48d6-9e0d-d0b014c6f6ed&width=40&dpr=3&quality=100&sign=fb5909d9&sv=2) There are a total of 528 persistent variables on the Cronus Zen (16 Global Variables and 512 Private Variable) Persistent Variables, _or PVAR_, can be accessed and set from any slot. They are generally used to pass values between scripts. 16 constants have been created for use with the get and set commands for persistent variables, they are: PVAR\_1 PVAR\_2 PVAR\_3 PVAR\_4 PVAR\_5 PVAR\_6 PVAR\_7 PVAR\_8 PVAR\_9 PVAR\_10 PVAR\_11 PVAR\_12 PVAR\_13 PVAR\_14 PVAR\_15 PVAR\_16 Slot Persistent Variables, _or SPVAR_, are private to a specific memory slot. Each of the memory slots has 16 private variables (64 for Cronus Zen), which are used to save specific values for one script. For example, Cronus Zen Slot 1 has 64 private variables which no other Slot can access, you cannot read or set the value of Slot 1's variables from Slot 4, and setting the private variables in Slot 1 will not have any effect on the private variables in any other slot. Constants have been created for use with the get and set commands for persistent variables, they are: SPVAR\_1 SPVAR\_2 SPVAR\_3 SPVAR\_4 SPVAR\_5 SPVAR\_6 SPVAR\_7 SPVAR\_8 SPVAR\_9 SPVAR\_10 SPVAR\_11 SPVAR\_12 SPVAR\_13 SPVAR\_14 SPVAR\_15 SPVAR\_16 circle-info Cronus Zen has an additional 48 private variables bringing the total to 64, the additional private variables constants are listed below. SPVAR\_17 SPVAR\_18 SPVAR\_19 SPVAR\_20 SPVAR\_21 SPVAR\_22 SPVAR\_23 SPVAR\_24 SPVAR\_25 SPVAR\_26 SPVAR\_27 SPVAR\_28 SPVAR\_29 SPVAR\_30 SPVAR\_31 SPVAR\_32 SPVAR\_33 SPVAR\_34 SPVAR\_35 SPVAR\_36 SPVAR\_37 SPVAR\_38 SPVAR\_39 SPVAR\_40 SPVAR\_41 SPVAR\_42 SPVAR\_43 SPVAR\_44 SPVAR\_45 SPVAR\_46 SPVAR\_47 SPVAR\_48 SPVAR\_49 SPVAR\_50 SPVAR\_51 SPVAR\_52 SPVAR\_53 SPVAR\_54 SPVAR\_55 SPVAR\_56 SPVAR\_57 SPVAR\_58 SPVAR\_59 SPVAR\_60 SPVAR\_61 SPVAR\_62 SPVAR\_63 SPVAR\_64 To retrieve the value stored in a persistent variable or to set the value of one, the following functions are available: Function Description Zen Plus [get\_pvar](https://gpc.cronusmax.com/persistent-variables#get_pvar) Returns the value stored within a persistent variable ✔️ ✔️ [set\_pvar](https://gpc.cronusmax.com/persistent-variables#set_pvar) Stores a value into a persistent variable ✔️ ✔️ [hashtag](https://gpc.cronusmax.com/persistent-variables#get_pvar) get\_pvar --------------------------------------------------------------------------------- `get_pvar` returns the value stored in a Persistent Variable while allowing you to specify the minimum and maximum permissible value and a default value should the value stored be outside of that range. The min, max and default parameters are mainly intended for when you are retrieving values from a Global variable, however, they must still be specified when reading the value of a private variable. ### [hashtag](https://gpc.cronusmax.com/persistent-variables#syntax) 🔴 **Syntax** `get_pvar ( , , , default_value> );` ### [hashtag](https://gpc.cronusmax.com/persistent-variables#parameters) ⚪ **Parameters** : A global or private persistent variable constant : The minimum permissible value : The maximum permissible value : The default value to return should the retrieved value be less then the min\_value or greater than the max\_value ### [hashtag](https://gpc.cronusmax.com/persistent-variables#returns) 🔵 **Returns** The stored value or the default value if the stored one is out of range [hashtag](https://gpc.cronusmax.com/persistent-variables#set_pvar) set\_pvar --------------------------------------------------------------------------------- `set_pvar` stores the specified value into a persistent variable. As GPC supports treating an _int_ as a _boolean value_, the `get_val` command can be used to see if a controller entry simply has a value. For example: #### [hashtag](https://gpc.cronusmax.com/persistent-variables#syntax-1) 🔴 **Syntax** `set_pvar ( , );` #### [hashtag](https://gpc.cronusmax.com/persistent-variables#parameters-1) ⚪ **Parameters** : A global or private persistent variable constant. : A value to be stored #### [hashtag](https://gpc.cronusmax.com/persistent-variables#returns-1) 🔵 **Returns** None [PreviousFlow Controlchevron-left](https://gpc.cronusmax.com/flow-control) [NextOperator Typeschevron-right](https://gpc.cronusmax.com/operator-types) Last updated 6 years ago Was this helpful? * [get\_pvar](https://gpc.cronusmax.com/persistent-variables#get_pvar) * [🔴 Syntax](https://gpc.cronusmax.com/persistent-variables#syntax) * [⚪ Parameters](https://gpc.cronusmax.com/persistent-variables#parameters) * [🔵 Returns](https://gpc.cronusmax.com/persistent-variables#returns) * [set\_pvar](https://gpc.cronusmax.com/persistent-variables#set_pvar) Was this helpful? Copy int a, b , c; init { a = get_pvar(SPVAR_1, 0, 10, 5); b = get_pvar(SPVAR_2, 20, 40, 30); c = get_pvar(PVAR_1, -30,400,100); } main { } Copy int a, b , c; init { a = get_pvar(SPVAR_1, 0, 10, 5); b = get_pvar(SPVAR_2, 20, 40, 30); c = get_pvar(PVAR_1, -30,400,100); } main { if(event_press(XB1_VIEW)){ set_pvar(SPVAR_1, a); set_pvar(SPVAR_2, b); set_pvar(PVAR_1, c); } } --- # Trace | Cronus GPC Documentation Name Value Zen Plus TRACE\_1 38 ✔️ ✔️ TRACE\_2 39 ✔️ ✔️ TRACE\_3 40 ✔️ ✔️ TRACE\_4 41 ✔️ ✔️ TRACE\_5 42 ✔️ ✔️ TRACE\_6 43 ✔️ ✔️ [PreviousDF Prochevron-left](https://gpc.cronusmax.com/constants/racing-wheel/dfpro) [NextMemorychevron-right](https://gpc.cronusmax.com/constants/memory) Last updated 6 years ago Was this helpful? Was this helpful? --- # Rumble | Cronus GPC Documentation Name Value Zen Plus RUMBLE\_A 0 ✔️ ✔️ RUMBLE\_B 1 ✔️ ✔️ RUMBLE\_RT 2 ✔️ ✔️ RUMBLE\_LT 3 ✔️ ✔️ [PreviousLEDchevron-left](https://gpc.cronusmax.com/constants/controller-constants/controller-led-constants) [NextPS3chevron-right](https://gpc.cronusmax.com/constants/controller-constants/ps3) Last updated 6 years ago Was this helpful? Was this helpful? --- # DF GT | Cronus GPC Documentation circle-info Please note that scripting is not currently functional for wheels. These are used for testing. Name Value DFGT\_PS 0 DFGT\_SELECT 1 DFGT\_START 2 DFGT\_RPADDLE 3 DFGT\_R2 4 DFGT\_R3 5 DFGT\_LPADDLE 6 DFGT\_L2 7 DFGT\_L3 8 DFGT\_GAS 9 DFGT\_STEERING 11 DFGT\_BRAKE 12 DFGT\_UP 13 DFGT\_DOWN 14 DFGT\_LEFT 15 DFGT\_RIGHT 16 DFGT\_TRIANGLE 17 DFGT\_CIRCLE 18 DFGT\_CROSS 19 DFGT\_SQUARE 20 DFGT\_UP\_ARROW 22 DFGT\_DOWN\_ARROW 23 DFGT\_DIAL\_CCW 24 DFGT\_DIAL\_CW 25 DFGT\_DIAL 26 **\-- Values Range --** ( 0 | 100 ) means 0 or 100 ( 0 ~ 100 ) means any value between 0 and 100 ( -100 ~ 100 ) means any value between -100 and 100 Accelerometers: 25% represents 1G; 100% == 4G [PreviousDFchevron-left](https://gpc.cronusmax.com/constants/racing-wheel/df) [NextDF Prochevron-right](https://gpc.cronusmax.com/constants/racing-wheel/dfpro) Last updated 4 years ago Was this helpful? Was this helpful? --- # Controller | Cronus GPC Documentation [Polarchevron-right](https://gpc.cronusmax.com/constants/controller-constants/polar) [LEDchevron-right](https://gpc.cronusmax.com/constants/controller-constants/controller-led-constants) [Rumblechevron-right](https://gpc.cronusmax.com/constants/controller-constants/rumble) [PS3chevron-right](https://gpc.cronusmax.com/constants/controller-constants/ps3) [PS4chevron-right](https://gpc.cronusmax.com/constants/controller-constants/controller-ps4-constants) [XBox 360chevron-right](https://gpc.cronusmax.com/constants/controller-constants/xbox-360) [Xbox Onechevron-right](https://gpc.cronusmax.com/constants/controller-constants/xbox-one) [Nintendo WIIchevron-right](https://gpc.cronusmax.com/constants/controller-constants/wii) [Nintendo Switchchevron-right](https://gpc.cronusmax.com/constants/controller-constants/switch) [PreviousKeyboardchevron-left](https://gpc.cronusmax.com/constants/keyboard-and-mouse/keyboard-constants) [NextPolarchevron-right](https://gpc.cronusmax.com/constants/controller-constants/polar) Last updated 4 years ago Was this helpful? Was this helpful? --- # Racing Wheel | Cronus GPC Documentation [G29chevron-right](https://gpc.cronusmax.com/constants/racing-wheel/g29) [G27chevron-right](https://gpc.cronusmax.com/constants/racing-wheel/g27) [G25chevron-right](https://gpc.cronusmax.com/constants/racing-wheel/g25) [DFchevron-right](https://gpc.cronusmax.com/constants/racing-wheel/df) [DF GTchevron-right](https://gpc.cronusmax.com/constants/racing-wheel/dfgt) [DF Prochevron-right](https://gpc.cronusmax.com/constants/racing-wheel/dfpro) [PreviousNintendo Switchchevron-left](https://gpc.cronusmax.com/constants/controller-constants/switch) [NextG29chevron-right](https://gpc.cronusmax.com/constants/racing-wheel/g29) Last updated 4 years ago Was this helpful? Was this helpful? --- # G29 | Cronus GPC Documentation circle-info Please note that scripting is not currently functional for wheels. These are used for testing. Name Value G29\_PS 0 G29\_SELECT 1 G29\_START 2 G29\_RPADDLE 3 G29\_R2 4 G29\_R3 5 G29\_LPADDLE 6 G29\_L2 7 G29\_L3 8 G29\_GAS 9 G29\_CLUTCH 10 G29\_STEERING 11 G29\_BRAKE 12 G29\_UP 13 G29\_DOWN 14 G29\_LEFT 15 G29\_RIGHT 16 G29\_TRIANGLE 17 G29\_CIRCLE 18 G29\_CROSS 19 G29\_SQUARE 20 G29\_SHIFT 21 G29\_UP\_ARROW 22 G29\_DOWN\_ARROW 23 G29\_DIAL\_CCW 24 G29\_DIAL\_CW 25 G29\_DIAL 26 **\-- Values Range --** ( 0 | 100 ) means 0 or 100 ( 0 ~ 100 ) means any value between 0 and 100 ( -100 ~ 100 ) means any value between -100 and 100 Accelerometers: 25% represents 1G; 100% == 4G [PreviousRacing Wheelchevron-left](https://gpc.cronusmax.com/constants/racing-wheel) [NextG27chevron-right](https://gpc.cronusmax.com/constants/racing-wheel/g27) Last updated 4 years ago Was this helpful? Was this helpful? --- # Bit Functions | Cronus GPC Documentation GPC allows you to manipulate the bits of a given variable. Bit operations are quite complicated, however, there is not really much call for them in the GPC environment and most users will never need them. Therefore, this section will assume you have an understanding of bits, bit masks, how they correlate with bytes and the binary system. Function Description Zen Plus [set\_bit](https://gpc.cronusmax.com/functions-and-commands/internal-functions/bit-operations#set_bit) Sets one Bit ✔️ ✔️ [clear\_bit](https://gpc.cronusmax.com/functions-and-commands/internal-functions/bit-operations#clear_bit) Clears one Bit ✔️ ✔️ [test\_bit](https://gpc.cronusmax.com/functions-and-commands/internal-functions/bit-operations#test_bit) Tests a Bit ✔️ ✔️ [set\_bits](https://gpc.cronusmax.com/functions-and-commands/internal-functions/bit-operations#set_bits) Stores a value into a Bit Index ✔️ ✔️ [get\_bits](https://gpc.cronusmax.com/functions-and-commands/internal-functions/bit-operations#get_bits) Gets a value from the Bit Index ✔️ ✔️ [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/bit-operations#set_bit) set\_bit ------------------------------------------------------------------------------------------------------------------- `set_bit` sets one bit of a variable based on its bit index Copy set_bit(a,5); #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/bit-operations#syntax) 🔴 **Syntax** `set_bit ( , );` #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/bit-operations#parameters) ⚪ **Parameters** : any defined variable. : index point of the bit to be set with a range of 0 to 15. #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/bit-operations#returns) 🔵 **Returns** Nothing [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/bit-operations#clear_bit) clear\_bit ----------------------------------------------------------------------------------------------------------------------- `clear_bit` clears one bit of a variable based on its bit index #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/bit-operations#syntax-1) 🔴 **Syntax** `clear_bit( , );` #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/bit-operations#parameters-1) ⚪ **Parameters** : any defined variable. : index point of the bit to be set with a range of 0 to 15. #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/bit-operations#returns-1) 🔵 **Returns** Nothing [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/bit-operations#test_bit) test\_bit --------------------------------------------------------------------------------------------------------------------- `test_bit` tests a bit index point in a variable to check if it is **TRUE** or **FALSE.** #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/bit-operations#syntax-2) 🔴 **Syntax** `test_bit( , );` #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/bit-operations#parameters-2) ⚪ **Parameters** : any defined variable. : index point of the bit to be set with a range of 0 to 15. #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/bit-operations#returns-2) 🔵 **Returns** **TRUE** if the bit is set, **FALSE** if it is not. [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/bit-operations#set_bits) set\_bits --------------------------------------------------------------------------------------------------------------------- `set_bits` stores a value into a variable based on its bit index and bit mask. #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/bit-operations#syntax-3) 🔴 **Syntax** `set_bits( , , , );` #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/bit-operations#parameters-3) ⚪ **Parameters** : any defined variable. : anything that has a value (constants, variables, functions, expressions, etc.) : index point of the bit to be set with a range of 0 to 15. : bit mask corresponding to the size, in bits, of the value to store (without shifting) #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/bit-operations#returns-3) 🔵 **Returns** Nothing [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/bit-operations#get_bits) get\_bits --------------------------------------------------------------------------------------------------------------------- `get_bits` extracts a value from a variable based on a bit index and bit mask #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/bit-operations#syntax-4) 🔴 **Syntax** `get_bits( , , );` #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/bit-operations#parameters-4) ⚪ **Parameters** : any defined variable. : index point of the bit to be set with a range of 0 to 15. : bit mask corresponding to the size, in bits, of the value to store (without shifting) #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/bit-operations#returns-4) 🔵 **Returns** Returns an _int_ value [PreviousInternal Functionschevron-left](https://gpc.cronusmax.com/functions-and-commands/internal-functions) [NextCombo Functionschevron-right](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions) Last updated 6 years ago Was this helpful? * [set\_bit](https://gpc.cronusmax.com/functions-and-commands/internal-functions/bit-operations#set_bit) * [clear\_bit](https://gpc.cronusmax.com/functions-and-commands/internal-functions/bit-operations#clear_bit) * [test\_bit](https://gpc.cronusmax.com/functions-and-commands/internal-functions/bit-operations#test_bit) * [set\_bits](https://gpc.cronusmax.com/functions-and-commands/internal-functions/bit-operations#set_bits) * [get\_bits](https://gpc.cronusmax.com/functions-and-commands/internal-functions/bit-operations#get_bits) Was this helpful? Copy clear_bit(a,5); Copy test_bit(b,2); Copy set_bits(c, 3, 4, 15); Copy get_bits(c, 4, 15); --- # Rumble Functions | Cronus GPC Documentation The Cronus allows you to completely control the Rumble Motors on your controller, including the Trigger Rumble motors on an Xbox One controller. Below are the GPC commands relating to these motors. Function Name Description Zen Plus [get\_rumble](https://gpc.cronusmax.com/functions-and-commands/controller-functions/rumble#get_rumble) Returns the current value of a Rumble Motor ✔️ ✔️ [set\_rumble](https://gpc.cronusmax.com/functions-and-commands/controller-functions/rumble#set_rumble) Sets the speed of a Rumble Motor ✔️ ️✔️ [block\_rumble](https://gpc.cronusmax.com/functions-and-commands/controller-functions/rumble#block_rumble) Blocks any rumble signals from the console ✔️ ✔️ [reset\_rumble](https://gpc.cronusmax.com/functions-and-commands/controller-functions/rumble#reset_rumble) Resets the rumble state and returns condition of the motors to the console ✔️ ✔️ [hashtag](https://gpc.cronusmax.com/functions-and-commands/controller-functions/rumble#get_rumble) 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 to 100 which represents the speed as a percentage ( % ). Copy main { if(get_rumble(RUMBLE_A) > 50) { // If Rumble Motor A is running greater than 50% // do something } } #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/controller-functions/rumble#syntax) 🔴 **Syntax** `get_rumble ( );` #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/controller-functions/rumble#parameters) ⚪ **Parameters** : the identifier of a rumble motor. #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/controller-functions/rumble#returns) 🔵 **Returns** An _int_ ranging from 0 to 100 which represents the current speed of the chosen motor. [hashtag](https://gpc.cronusmax.com/functions-and-commands/controller-functions/rumble#set_rumble) **set\_rumble** ----------------------------------------------------------------------------------------------------------------------- `set_rumble` sets the speed of the chosen rumble motor on the controller. The rumble motors are numbered 0 to 3. To make it easier to remember which motor is which, four constants have been created: Name Description Value RUMBLE\_A Strong Rumble Motor (Usually the Left Motor) 0 RUMBLE\_B Weak Rumble Motor (Usually the Right Motor) 1 RUMBLE\_RT Right Trigger Motor (Xbox One controllers only) 2 RUMBLE\_LT Left Trigger Motor (Xbox One controllers only) 3 #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/controller-functions/rumble#syntax-1) 🔴 **Syntax** `set_rumble (,);` #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/controller-functions/rumble#parameters-1) ⚪ **Parameters** : the identifier of a rumble motor. : Percentage value of the rumble motor ranging 0 - 100 represented as an _int_. #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/controller-functions/rumble#returns-1) 🔵 **Returns** None [hashtag](https://gpc.cronusmax.com/functions-and-commands/controller-functions/rumble#block_rumble) block\_rumble ----------------------------------------------------------------------------------------------------------------------- `block_rumble` does as it implies and blocks any rumble signals to the controller. Once this function is used, it remains active until such time as it is [resetarrow-up-right](https://cronusmax.com/manual/rumble.htm#id_4) in the script or the script is unloaded. Example of usage: #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/controller-functions/rumble#syntax-2) 🔴 **Syntax** `block_rumble ( );` #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/controller-functions/rumble#parameters-2) ⚪ **Parameters** None [hashtag](https://gpc.cronusmax.com/functions-and-commands/controller-functions/rumble#reset_rumble) reset\_rumble ----------------------------------------------------------------------------------------------------------------------- `reset_rumble` returns control of the rumble motors to the console. It also deactivates block\_rumble if it is active. Example of usage: #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/controller-functions/rumble#syntax-3) 🔴 **Syntax** `reset_rumble ( );` #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/controller-functions/rumble#parameters-3) ⚪ **Parameters** None [PreviousCore Controller Functionschevron-left](https://gpc.cronusmax.com/functions-and-commands/controller-functions/core-controller-functions) [NextLED Functionschevron-right](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds) Last updated 4 years ago Was this helpful? * [get\_rumble](https://gpc.cronusmax.com/functions-and-commands/controller-functions/rumble#get_rumble) * [set\_rumble](https://gpc.cronusmax.com/functions-and-commands/controller-functions/rumble#set_rumble) * [block\_rumble](https://gpc.cronusmax.com/functions-and-commands/controller-functions/rumble#block_rumble) * [reset\_rumble](https://gpc.cronusmax.com/functions-and-commands/controller-functions/rumble#reset_rumble) Was this helpful? Copy set_rumble(RUMBLE_A, 50); Copy main { if(event_press(XB1_A)) { // If A / Cross is pressed... block_rumble(); // Block rumble signals to the controller } } Copy main { if(event_press(XB1_A)) { // If A / Cross is pressed... reset_rumble(); // Reset the rumble state } } --- # LED | Cronus GPC Documentation Name Value Zen Plus LED\_NONE \-1 ✔️ ✔️ LED\_1 0 ✔️ ✔️ LED\_2 1 ✔️ ✔️ LED\_3 2 ✔️ ✔️ LED\_4 3 ✔️ ✔️ PS4\_GREEN 2 ✔️ ❌ PS4\_RED 1 ✔️ ❌ PS4\_BLUE 0 ✔️ ❌ DS4\_GREEN 6 ✔️ ❌ DS4\_RED 5 ✔️ ❌ DS4\_BLUE 4 ✔️ ❌ [PreviousPolarchevron-left](https://gpc.cronusmax.com/constants/controller-constants/polar) [NextRumblechevron-right](https://gpc.cronusmax.com/constants/controller-constants/rumble) Last updated 5 years ago Was this helpful? Was this helpful? --- # DF | Cronus GPC Documentation circle-info Please note that scripting is not currently functional for wheels. These are used for testing. Name Value DF\_PS 0 DF\_SELECT 1 DF\_START 2 DF\_RPADDLE 3 DF\_R2 4 DF\_R3 5 DF\_LPADDLE 6 DF\_L2 7 DF\_L3 8 DF\_GAS 9 DF\_STEERING 11 DF\_BRAKE 12 DF\_UP 13 DF\_DOWN 14 DF\_LEFT 15 DF\_RIGHT 16 DF\_TRIANGLE 17 DF\_CIRCLE 18 DF\_CROSS 19 DF\_SQUARE 20 **\-- Values Range --** ( 0 | 100 ) means 0 or 100 ( 0 ~ 100 ) means any value between 0 and 100 ( -100 ~ 100 ) means any value between -100 and 100 Accelerometers: 25% represents 1G; 100% == 4G [PreviousG25chevron-left](https://gpc.cronusmax.com/constants/racing-wheel/g25) [NextDF GTchevron-right](https://gpc.cronusmax.com/constants/racing-wheel/dfgt) Last updated 4 years ago Was this helpful? Was this helpful? --- # DF Pro | Cronus GPC Documentation circle-info Please note that scripting is not currently functional for wheels. These are used for testing. Name Value DFPRO\_PS 0 DFPRO\_SELECT 1 DFPRO\_START 2 DFPRO\_RPADDLE 3 DFPRO\_R2 4 DFPRO\_R3 5 DFPRO\_LPADDLE 6 DFPRO\_L2 7 DFPRO\_L3 8 DFPRO\_GAS 9 DFPRO\_STEERING 11 DFPRO\_BRAKE 12 DFPRO\_UP 13 DFPRO\_DOWN 14 DFPRO\_LEFT 15 DFPRO\_RIGHT 16 DFPRO\_TRIANGLE 17 DFPRO\_CIRCLE 18 DFPRO\_CROSS 19 DFPRO\_SQUARE 20 **\-- Values Range --** ( 0 | 100 ) means 0 or 100 ( 0 ~ 100 ) means any value between 0 and 100 ( -100 ~ 100 ) means any value between -100 and 100 Accelerometers: 25% represents 1G; 100% == 4G [PreviousDF GTchevron-left](https://gpc.cronusmax.com/constants/racing-wheel/dfgt) [NextTracechevron-right](https://gpc.cronusmax.com/constants/trace) Last updated 4 years ago Was this helpful? Was this helpful? --- # Controller Functions | Cronus GPC Documentation A controller is an input device, however, the Cronus Zen also sends data to control the rumble motors and LEDs. [hashtag](https://gpc.cronusmax.com/functions-and-commands/controller-functions#core-controller-functions) Core Controller Functions ----------------------------------------------------------------------------------------------------------------------------------------- Function Name Description Zen Plus [get\_val](https://gpc.cronusmax.com/functions-and-commands/controller-functions/core-controller-functions#get_val) Returns the current value of a controller entry ✔️ ✔️ [get\_lval](https://gpc.cronusmax.com/functions-and-commands/controller-functions/core-controller-functions#get_lval) Returns the previous value of a controller entry ✔️ ✔️ [get\_ptime](https://gpc.cronusmax.com/functions-and-commands/controller-functions/core-controller-functions#get_ptime) Returns the elapsed time of a controller entries state change ✔️ ✔️ [get\_controller](https://gpc.cronusmax.com/functions-and-commands/controller-functions/core-controller-functions#get_controller) Returns the type of controller currently connected to the input port ✔️ ✔️ [get\_battery](https://gpc.cronusmax.com/functions-and-commands/controller-functions/core-controller-functions#get_battery) Returns the current status of the battery for a wireless controller ✔️ ✔️ [event\_press](https://gpc.cronusmax.com/functions-and-commands/controller-functions/core-controller-functions#event_press) Returns TRUE when a controller entry has been pressed ✔️ ✔️ [event\_release](https://gpc.cronusmax.com/functions-and-commands/controller-functions/core-controller-functions#event_release) Returns TRUE when a controller entry has been released ✔️ ✔️ [get\_ival](https://gpc.cronusmax.com/functions-and-commands/controller-functions/core-controller-functions#get_ival) Gets the input value of a button to check if it has been modified by the script. ✔️ ❌ [get\_brtime](https://gpc.cronusmax.com/functions-and-commands/controller-functions/core-controller-functions#get_brtime) Gets the time the input value has been 0 ✔️ ❌ [swap](https://gpc.cronusmax.com/functions-and-commands/controller-functions/core-controller-functions#swap) Swaps the input values to be sent to the console temporarily ✔️ ✔️ [block](https://gpc.cronusmax.com/functions-and-commands/controller-functions/core-controller-functions#block) locks the input from being sent to the console for the specified time ✔️ ✔️ [sensitivity](https://gpc.cronusmax.com/functions-and-commands/controller-functions/core-controller-functions#sensitivity) Changes the input sensitivity ✔️ ✔️ [deadzone](https://gpc.cronusmax.com/functions-and-commands/controller-functions/core-controller-functions#deadzone) Modifies the inner "deadzone", essentially pushes the starting value (when not 0) from the center by deadzone\_x/deadzone\_y or radius ✔️ ✔️ [stickize](https://gpc.cronusmax.com/functions-and-commands/controller-functions/core-controller-functions#sticksize) Modifies outer deadzone, essentially forces the stick to not be further out than the radius from the inner point ✔️ ✔️ [ps4\_touchpad](https://gpc.cronusmax.com/functions-and-commands/controller-functions/core-controller-functions#ps-4-_touchpad) Gets the gets the PS4 touchpad information ✔️ ✔️ [ps4\_set\_touchpad](https://gpc.cronusmax.com/functions-and-commands/controller-functions/core-controller-functions#ps-4-_set_touchpad) Sets the PS4 touchpad finger1 location ✔️ ✔️ [turn\_off](https://gpc.cronusmax.com/functions-and-commands/controller-functions/core-controller-functions#turn_off) Turns off a wireless controller connected to the input port ✔️ ✔️ [wiir\_offscreen](https://gpc.cronusmax.com/functions-and-commands/controller-functions/core-controller-functions#wiir_offscreen) Checks if the Wii remote is off-screen ✔️ ✔️ [Core Controller Functionschevron-right](https://gpc.cronusmax.com/functions-and-commands/controller-functions/core-controller-functions) [hashtag](https://gpc.cronusmax.com/functions-and-commands/controller-functions#rumble-functions) Rumble Functions ----------------------------------------------------------------------------------------------------------------------- Function Name Description [get\_rumble](https://gpc.cronusmax.com/functions-and-commands/controller-functions/rumble#get_rumble) Returns the current value of a Rumble Motor [set\_rumble](https://gpc.cronusmax.com/functions-and-commands/controller-functions/rumble#set_rumble) Sets the speed of a Rumble Motor [block\_rumble](https://gpc.cronusmax.com/functions-and-commands/controller-functions/rumble#block_rumble) Blocks any rumble signals from the console [reset\_rumble](https://gpc.cronusmax.com/functions-and-commands/controller-functions/rumble#reset_rumble) Resets the rumble state and returns condition of the motors to the console [Rumble Functionschevron-right](https://gpc.cronusmax.com/functions-and-commands/controller-functions/rumble) [hashtag](https://gpc.cronusmax.com/functions-and-commands/controller-functions#led-functions) LED Functions ----------------------------------------------------------------------------------------------------------------- Function Name Description Zen Plus [set\_led](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds#set_led) sets the state of the LED on a controller ✔️ ✔️ [LED Functionschevron-right](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds) [PreviousCore Console Functionschevron-left](https://gpc.cronusmax.com/functions-and-commands/console-functions/i-o-functions) [NextCore Controller Functionschevron-right](https://gpc.cronusmax.com/functions-and-commands/controller-functions/core-controller-functions) Last updated 4 years ago Was this helpful? * [Core Controller Functions](https://gpc.cronusmax.com/functions-and-commands/controller-functions#core-controller-functions) * [Rumble Functions](https://gpc.cronusmax.com/functions-and-commands/controller-functions#rumble-functions) * [LED Functions](https://gpc.cronusmax.com/functions-and-commands/controller-functions#led-functions) Was this helpful? --- # G25 | Cronus GPC Documentation circle-info Please note that scripting is not currently functional for wheels. These are used for testing. Name Value G25\_PS 0 G25\_SELECT 1 G25\_START 2 G25\_RPADDLE 3 G25\_R2 4 G25\_R3 5 G25\_LPADDLE 6 G25\_L2 7 G25\_L3 8 G25\_GAS 9 G25\_CLUTCH 10 G25\_STEERING 11 G25\_BRAKE 12 G25\_UP 13 G25\_DOWN 14 G25\_LEFT 15 G25\_RIGHT 16 G25\_TRIANGLE 17 G25\_CIRCLE 18 G25\_CROSS 19 G25\_SQUARE 20 G25\_SHIFT 21 **\-- Values Range --** ( 0 | 100 ) means 0 or 100 ( 0 ~ 100 ) means any value between 0 and 100 ( -100 ~ 100 ) means any value between -100 and 100 Accelerometers: 25% represents 1G; 100% == 4G [PreviousG27chevron-left](https://gpc.cronusmax.com/constants/racing-wheel/g27) [NextDFchevron-right](https://gpc.cronusmax.com/constants/racing-wheel/df) Last updated 4 years ago Was this helpful? Was this helpful? --- # #1 | Cronus GPC Documentation [PreviousCore Keyboard Functionschevron-left](https://gpc.cronusmax.com/functions-and-commands/keyboard-functions/core-keyboard-functions) Was this helpful? Was this helpful? --- # Internal Functions | Cronus GPC Documentation Within this section of the manual you will find the functions and commands the Virtual Machine uses to handle data in GPC scripts. [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions#bit-functions) BIT Functions --------------------------------------------------------------------------------------------------------------- Function Description Zen Plus [set\_bit](https://gpc.cronusmax.com/functions-and-commands/internal-functions/bit-operations#set_bit) Sets one Bit ✔️ ✔️ [clear\_bit](https://gpc.cronusmax.com/functions-and-commands/internal-functions/bit-operations#clear_bit) Clears one Bit ✔️ ✔️ [test\_bit](https://gpc.cronusmax.com/functions-and-commands/internal-functions/bit-operations#test_bit) Tests a Bit ✔️ ✔️ [set\_bits](https://gpc.cronusmax.com/functions-and-commands/internal-functions/bit-operations#set_bits) Stores a value into a Bit Index ✔️ ✔️ [get\_bits](https://gpc.cronusmax.com/functions-and-commands/internal-functions/bit-operations#get_bits) Gets a value from the Bit Index ✔️ ✔️ [Bit Functionschevron-right](https://gpc.cronusmax.com/functions-and-commands/internal-functions/bit-operations) [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions#combo-functions) Combo Functions ------------------------------------------------------------------------------------------------------------------- Function Description Zen Plus [combo\_run](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions#combo_run) Runs a combo ✔️ ✔️ [combo\_running](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions#combo_running) Checks if a combo is running ✔️ ✔️ [combo\_stop](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions#combo_stop) Stops a running combo ✔️ ✔️ [combo\_restart](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions#combo_restart) Restarts a running combo ✔️ ✔️ [Combo Functionschevron-right](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions) [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions#math-functions) Math Functions ----------------------------------------------------------------------------------------------------------------- Function Description Zen Plus [abs](https://gpc.cronusmax.com/functions-and-commands/internal-functions/math-functions#abs) Returns an absolute value of a number ✔️ ✔️ [inv](https://gpc.cronusmax.com/functions-and-commands/internal-functions/math-functions#inv) Returns the inverse value of a number ✔️ ✔️ [pow](https://gpc.cronusmax.com/functions-and-commands/internal-functions/math-functions#pow) Raise and value to the specified power ✔️ ✔️ [isqrt](https://gpc.cronusmax.com/functions-and-commands/internal-functions/math-functions#opcode) Calculates an integer square root ✔️ ✔️ [random](https://gpc.cronusmax.com/functions-and-commands/internal-functions/math-functions#opcode-1) Generates a random value between the specified range ✔️ ❌ [Math Functionschevron-right](https://gpc.cronusmax.com/functions-and-commands/internal-functions/math-functions) [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions#device-functions) Device Functions --------------------------------------------------------------------------------------------------------------------- Function Description Zen Plus [get\_rtime](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#get_rtime) Returns the elapsed time between **main** iterations in milliseconds ✔️ ✔️ [get\_slot](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#get_slot) Returns the active slot number ✔️ ✔️ [load\_slot](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#load_slot) Loads a specified slot ✔️ ✔️ [get\_ctrlbutton](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#get_ctrlbutton) Returns the identifier of the controller button ✔️ ✔️ [vm\_tctrl](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#vm_tctrl) Sets the vm timeout for the next iteration ✔️ ✔️ [set\_polar](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#set_polar) Sets the stick output at a given angle and radius with a high resolution value ✔️ ❌ [set\_rgb](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#set_rgb) Sets the LED on the ZEN to the supplied RGB color ✔️ ❌ [set\_hsb](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#set_hsb) Sets the LED on the ZEN to the supplied HSB color ✔️ ❌ [clamp function](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#clamp-function) 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. ✔️ ❌ [Device Functionschevron-right](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions) [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions#led-display-functions) LED Display Functions ------------------------------------------------------------------------------------------------------------------------------- Function Description Zen Plus [pixel\_oled](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#pixel_oled) Draws a pixel on the OLED display ✔️ ❌ [line\_oled](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#line_oled) Draws a line on the OLED display ✔️ ❌ [rect\_oled](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#rect_oled) Draws a rectangle on the OLED display ✔️ ❌ [circle\_oled](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#circle_oled) Draws a circle on the OLED display ✔️ ❌ [putc\_oled](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#putc_oled) Puts a character into the string buffer for puts\_oled ✔️ ❌ [puts\_oled](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#puts_oled) Draws the characters supplied using putc\_oled on the OLED display ✔️ ❌ [cls\_oled](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#cls_oled) Sets the entire OLED display to a single color ✔️ ❌ [printf](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#printf) Draws a string on the OLED display ✔️ ❌ [PreviousIdentifierschevron-left](https://gpc.cronusmax.com/identifiers) [NextBit Functionschevron-right](https://gpc.cronusmax.com/functions-and-commands/internal-functions/bit-operations) Last updated 4 years ago Was this helpful? * [BIT Functions](https://gpc.cronusmax.com/functions-and-commands/internal-functions#bit-functions) * [Combo Functions](https://gpc.cronusmax.com/functions-and-commands/internal-functions#combo-functions) * [Math Functions](https://gpc.cronusmax.com/functions-and-commands/internal-functions#math-functions) * [Device Functions](https://gpc.cronusmax.com/functions-and-commands/internal-functions#device-functions) * [LED Display Functions](https://gpc.cronusmax.com/functions-and-commands/internal-functions#led-display-functions) Was this helpful? --- # Console Functions | Cronus GPC Documentation [hashtag](https://gpc.cronusmax.com/functions-and-commands/console-functions#core-console-functions) Core Console Functions -------------------------------------------------------------------------------------------------------------------------------- Function Name Description Zen Plus [get\_console](https://gpc.cronusmax.com/functions-and-commands/console-functions/i-o-functions#get_console) Gets which console is currently connected ✔️ ✔️ [set\_val](https://gpc.cronusmax.com/functions-and-commands/console-functions/i-o-functions#set_val) Sets the output value to send to the console ✔️ ✔️ [block\_all\_inputs](https://gpc.cronusmax.com/functions-and-commands/console-functions/i-o-functions#block_all_inputs) Blocks all output from being sent to the console this cycle of main ✔️ ❌ [ps4\_authtimeout](https://gpc.cronusmax.com/functions-and-commands/console-functions/i-o-functions#ps-4-_authtimeout) Check if ps4 authentication is timed out ✔️ ❌ [output\_reconnection](https://gpc.cronusmax.com/functions-and-commands/console-functions/i-o-functions#output_reconnection) Check the output if reconnected ✔️ ❌ output\_protocol Sets Output protocol ✔️ ❌ [get\_led](https://gpc.cronusmax.com/functions-and-commands/console-functions/i-o-functions#get_led) Returns the current state of a specified LED ✔️ ✔️ [get\_rumble](https://gpc.cronusmax.com/functions-and-commands/console-functions/i-o-functions#get_rumble) Returns the current value of a rumble motor ✔️ ✔️ [PreviousOLED Display Functionschevron-left](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions) [NextCore Console Functionschevron-right](https://gpc.cronusmax.com/functions-and-commands/console-functions/i-o-functions) Last updated 4 years ago Was this helpful? Was this helpful? --- # XBox 360 | Cronus GPC Documentation Name Value Range Zen Plus XB360\_XBOX 0 0 | 100 ✔️ ✔️ XB360\_BACK 1 0 | 100 ✔️ ✔️ XB360\_START 2 0 | 100 ✔️ ✔️ XB360\_RB 3 0 | 100 ✔️ ✔️ XB360\_RT 4 0 ~ 100 ✔️ ✔️ XB360\_RS 5 0 | 100 ✔️ ✔️ XB360\_LB 6 0 | 100 ✔️ ✔️ XB360\_LT 7 0 ~ 100 ✔️ ✔️ XB360\_LS 8 0 | 100 ✔️ ✔️ XB360\_RX 9 \-100 ~ 100 ✔️ ✔️ XB360\_RY 10 \-100 ~ 100 ✔️ ✔️ XB360\_LX 11 \-100 ~ 100 ✔️ ✔️ XB360\_LY 12 \-100 ~ 100 ✔️ ✔️ XB360\_UP 13 0 | 100 ✔️ ✔️ XB360\_DOWN 14 0 | 100 ✔️ ✔️ XB360\_LEFT 15 0 | 100 ✔️ ✔️ XB360\_RIGHT 16 0 | 100 ✔️ ✔️ XB360\_Y 17 0 | 100 ✔️ ✔️ XB360\_B 18 0 | 100 ✔️ ✔️ XB360\_A 19 0 | 100 ✔️ ✔️ XB360\_X 20 0 | 100 ✔️ ✔️ **\-- Values Range --** ( 0 | 100 ) means 0 or 100 ( 0 ~ 100 ) means any value between 0 and 100 ( -100 ~ 100 ) means any value between -100 and 100 Accelerometers: 25% represents 1G; 100% == 4G [PreviousPS4chevron-left](https://gpc.cronusmax.com/constants/controller-constants/controller-ps4-constants) [NextXbox Onechevron-right](https://gpc.cronusmax.com/constants/controller-constants/xbox-one) Last updated 3 years ago Was this helpful? Was this helpful? --- # Operator Types | Cronus GPC Documentation An operator is a symbol which tells the interpreter to perform specific mathematical, relational or logical operation and produce final result. This section details the operators available in GPC. Copy int a = 10; int b = 5; int c = 0; main { // Assignment Operator c = 5; // c is set to a value of 5 c += 5; // c is set to a value of 10 (5 + 5 = 10) c -= 5; // c is set to a value of 5 (10 - 5 = 5) c *= 5; // c is set to a value of 25 (5 * 5 = 25) c /= 5; // c is set to a value of 5 (25 / 5 = 5) c %= 5; // c is set to a value of 0 (5 % 5 = 0) // Mathmatical Operators c = a + b; // Addition c = 15 c = a - b; // Subtraction c = 5 c = a * b; // Multiplication c = 50 c = a / b; // Division c = 2 c++; // Increment c = 3 c--; // Decrement c = 2 // Logical Operators if (c ! a) // NOT if c is not a if (a && c) // AND if a and c are TRUE if (a || c) // OR if a or c are TRUE if (a ^^ c) // XOR if either a or c are TRUE but not both // Relational Operators if (c == 10) // EQUAL TO if c is equal to 10 if (c != 50) // NOT EQUAL TO if c is not equal to 50 if (c < 20) // LESS THAN if c is less than 20 if (c > 30) // GREATER THAN if c is greater than 30 if (c <= 40) // LESS THAN OR EQUAL TO if c is less than or equal to 40 if (c >= 40) // GREATER THAN OR EQUAL TO if c is greater than or equal to 40 } Assignment Arithmetic Logical Relational Binary `=` is the assignment operator. Think of this as gets set to rather than equal to. When `=` is used, the left operand gets set to the value of the right operand. There are also a number of short hands for common tasks such as incrementing a value by a set amount. Operator Description \= Sets the left operand to the value of the right operand += Sets the left operand to the value of the left operand plus the right operand \-= Sets the left operand to the value of the left operand minus the right operand \*= Sets the left operand to the value of the left operand multiplied by the right operand /= Sets the left operand to the value of the left operand divided by the right operand %= Sets the left operand to the remainder of dividing the left operand by the right operand In the example below, assume `**a**` holds a value of `**10**`. It is often necessary to perform arithmetic on two values. The following table lists the arithmetic operators available in GPC. Operator Description + Adds two operands \- Subtracts right operand from the left operand \* Multiplies both operands / Divides the left operand by the right operand % Modulus, gives the remainder of an integer division ++ Increments by 1 \-- Decrements by 1 In the example below, assume `**a**` holds a value of `**10**` and `**b**` holds a value of `**5**`. circle-info Note, GPC does not support fractions so the division operator `**/**` will drop any fractions. For example, `**10 / 3 = 3**` as the fraction is dropped. It also does not round, so `**3 / 4 = 0**` and not `**1**`. Logical operators are important in any programming language as they allow to tell the interpreter to make decisions based on certain conditions. The following table lists the logical operators within the GPC languauge. Operator Description && AND operator, if both operators are TRUE then the condition becomes TRUE || OR operator, if either operand is TRUE then the condition becomes TRUE ^^ XOR operator, if either operand is TRUE but not both then the condition becomes TRUE ! NOT operator. Reverses the logical state of an operand. In the example below, assume `**a**` holds a value of `**1**` and `**b**` holds a value of `**0**`. Relational operators produce boolean results (TRUE or FALSE) while comparing two operands. The following tables list the relational operands which are available in GPC. Operator Description \== Equal to, if the left operand holds the same value as the right then the condition becomes TRUE != Not equal to, if the left operand does not hold the same value as the right then the condition becomes TRUE \> Greater than, if the left operand holds a value greater than the left then the condition becomes TRUE < Less than, if the left operand holds a value less than the left then the condition becomes TRUE \>= Greater than or equal to, if the left operand holds a value which is greater than or equal to the right then the condition becomes TRUE <= Less than or equal to, if the left operand holds a value which is less than or equal to the right then the condition becomes TRUE In the example below, assume `**a**` holds a value of `30` and `**b**` holds a value of `**10**`. Binary is the same as Logical, except they work with bits. Operators Description & AND operator, if both operators are TRUE then the condition becomes TRUE | OR operator, if either operand is TRUE then the condition becomes TRUE ^ XOR operator, if either operand is TRUE but not both then the condition becomes TRUE << Left Shift operator, Less than, if the left operand holds a value less than the left then the condition becomes TRUE \>> Right Shift operator, Greater than, if the left operand holds a value greater than the left then the condition becomes TRUE \- NOT operator, Subtracts right operand from the left operand In the example below, [PreviousPersistent Memorychevron-left](https://gpc.cronusmax.com/persistent-variables) [NextIdentifierschevron-right](https://gpc.cronusmax.com/identifiers) Last updated 4 years ago Was this helpful? Was this helpful? Copy a = 5; // a is set to 5 a += 5; // a is set to 15 a -= 5; // a is set to 5 a *= 5; // a is set to 50 a /= 5; // a is set to 2 a %= 3; // a is set to 1 Copy a + b; // will give a value of 15 a - b; // will give a value of 5 a * b; // will give a value of 50 a / b; // will give a value of 2 a % b; // will give a value of 0 a++; // will give a value of 11 a--; // will give a value of 9 Copy a && b // value is FALSE a || b // value is TRUE a ^^ b // value is TRUE !b // value is TRUE !a // value is FALSE Copy a == b // is FALSE a != b // is TRUE a > b // is TRUE a < b // is FALSE a >= b // is TRUE a <= b // is FALSE Copy 3 & 1 = 1 1 | 2 = 3 1 ^ 2 = * 1 << 1 = 2 1 >> 1 = 0 ~ 1 = -32768 --- # Xbox One | Cronus GPC Documentation Name Value Range Zen Plus XB1\_XBOX 0 0 | 100 ✔️ ✔️ XB1\_GUIDE 0 0 | 100 ✔️ ❌ XB1\_VIEW 1 0 | 100 ✔️ ✔️ XB1\_MENU 2 0 | 100 ✔️ ✔️ XB1\_RB 3 0 | 100 ✔️ ✔️ XB1\_RT 4 0 ~ 100 ✔️ ✔️ XB1\_RS 5 0 | 100 ✔️ ✔️ XB1\_LB 6 0 | 100 ✔️ ✔️ XB1\_LT 7 0 ~ 100 ✔️ ✔️ XB1\_LS 8 0 | 100 ✔️ ✔️ XB1\_RX 9 \-100 ~ 100 ✔️ ✔️ XB1\_RY 10 \-100 ~ 100 ✔️ ✔️ XB1\_LX 11 \-100 ~ 100 ✔️ ✔️ XB1\_LY 12 \-100 ~ 100 ✔️ ✔️ XB1\_UP 13 0 | 100 ✔️ ✔️ XB1\_DOWN 14 0 | 100 ✔️ ✔️ XB1\_LEFT 15 0 | 100 ✔️ ✔️ XB1\_RIGHT 16 0 | 100 ✔️ ✔️ XB1\_Y 17 0 | 100 ✔️ ✔️ XB1\_B 18 0 | 100 ✔️ ✔️ XB1\_A 19 0 | 100 ✔️ ✔️ XB1\_X 20 0 | 100 ✔️ ✔️ XB1\_SHARE 21 0 | 100 ✔️ ❌ XB1\_SYNC 27 0 | 100 ✔️ ❌ XB1\_PR1 34 0 | 100 ✔️ ✔️ XB1\_PR2 35 0 | 100 ✔️ ✔️ XB1\_PL1 36 0 | 100 ✔️ ✔️ XB1\_PL2 37 0 | 100 ✔️ ✔️ **\-- Values Range --** ( 0 | 100 ) means 0 or 100 ( 0 ~ 100 ) means any value between 0 and 100 ( -100 ~ 100 ) means any value between -100 and 100 Accelerometers: 25% represents 1G; 100% == 4G [PreviousXBox 360chevron-left](https://gpc.cronusmax.com/constants/controller-constants/xbox-360) [NextNintendo WIIchevron-right](https://gpc.cronusmax.com/constants/controller-constants/wii) Last updated 3 years ago Was this helpful? Was this helpful? --- # Keyboard Functions | Cronus GPC Documentation Function Description Zen Plus [get\_keyboard](https://gpc.cronusmax.com/functions-and-commands/keyboard-functions/core-keyboard-functions#get_keyboard) Checks if a chosen keyboard key is held down ✔️ ❌ [get\_modifiers](https://gpc.cronusmax.com/functions-and-commands/keyboard-functions/core-keyboard-functions#get_modifiers) Checks if a chosen keyboard modifier is held down (ALT, SHIFT,CTRL, etc.) ✔️ ❌ [get\_mk](https://gpc.cronusmax.com/functions-and-commands/keyboard-functions/core-keyboard-functions#get_mk) Gets Mouse&Keyboard config value ✔️ ❌ [set\_mk](https://gpc.cronusmax.com/functions-and-commands/keyboard-functions/core-keyboard-functions#set_mk) Sets Mouse&Keyboard config value ✔️ ❌ [Core Keyboard Functionschevron-right](https://gpc.cronusmax.com/functions-and-commands/keyboard-functions/core-keyboard-functions) [PreviousLED Functionschevron-left](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds) [NextCore Keyboard Functionschevron-right](https://gpc.cronusmax.com/functions-and-commands/keyboard-functions/core-keyboard-functions) Last updated 4 years ago Was this helpful? Was this helpful? --- # Nintendo Switch | Cronus GPC Documentation Name Value Zen Plus SWI\_HOME 0 ✔️ ❌ SWI\_MINUS 1 ✔️ ❌ SWI\_PLUS 2 ✔️ ❌ SWI\_R 3 ✔️ ❌ SWI\_ZR 4 ✔️ ❌ SWI\_R3 5 ✔️ ❌ SWI\_L 6 ✔️ ❌ SWI\_ZL 7 ✔️ ❌ SWI\_L3 8 ✔️ ❌ SWI\_RX 9 ✔️ ❌ SWI\_LX 10 ✔️ ❌ SWI\_RY 11 ✔️ ❌ SWI\_LY 12 ✔️ ❌ SWI\_UP 13 ✔️ ❌ SWI\_DOWN 14 ✔️ ❌ SWI\_LEFT 15 ✔️ ❌ SWI\_RIGHT 16 ✔️ ❌ SWI\_X 17 ✔️ ❌ SWI\_A 18 ✔️ ❌ SWI\_B 19 ✔️ ❌ SWI\_Y 20 ✔️ ❌ SWI\_ACCX 21 ✔️ ❌ SWI\_ACCY 22 ✔️ ❌ SWI\_ACCZ 23 ✔️ ❌ SWI\_GYROX 24 ✔️ ❌ SWI\_GYROY 25 ✔️ ❌ SWI\_GYROZ 26 ✔️ ❌ SWI\_CAPTURE 27 ✔️ ❌ [PreviousNintendo WIIchevron-left](https://gpc.cronusmax.com/constants/controller-constants/wii) [NextRacing Wheelchevron-right](https://gpc.cronusmax.com/constants/racing-wheel) Last updated 4 years ago Was this helpful? Was this helpful? --- # Nintendo WII | Cronus GPC Documentation Name Value Range Zen Plus WII\_HOME 0 0 | 100 ✔️ ✔️ WII\_MINUS 1 0 | 100 ✔️ ✔️ WII\_PLUS 2 0 | 100 ✔️ ✔️ WII\_RT 3 0 ~ 100 ✔️ ✔️ WII\_ZR 4 0 ~ 100 ✔️ ✔️ WII\_ONE 5 0 | 100 ✔️ ✔️ WII\_R3 5 0 | 100 ✔️ ✔️ WII\_C 6 0 | 100 ✔️ ✔️ WII\_LT 6 0 ~ 100 ✔️ ✔️ WII\_Z 7 0 ~ 100 ✔️ ✔️ WII\_ZL 7 0 ~ 100 ✔️ ✔️ WII\_TWO 8 0 | 100 ✔️ ✔️ WII\_RX 9 \-100 ~ 100 ✔️ ✔️ WII\_RY 10 \-100 ~ 100 ✔️ ✔️ WII\_LX 11 \-100 ~ 100 ✔️ ✔️ WII\_LY 12 \-100 ~ 100 ✔️ ✔️ WII\_UP 13 0 | 100 ✔️ ✔️ WII\_DOWN 14 0 | 100 ✔️ ✔️ WII\_LEFT 15 0 | 100 ✔️ ✔️ WII\_RIGHT 16 0 | 100 ✔️ ✔️ WII\_X 17 0 | 100 ✔️ ✔️ WII\_B 18 0 | 100 ✔️ ✔️ WII\_A 19 0 | 100 ✔️ ✔️ WII\_Y 20 0 | 100 ✔️ ✔️ WII\_ACCX 21 \-100 ~ 100 ✔️ ✔️ WII\_ACCY 22 \-100 ~ 100 ✔️ ✔️ WII\_ACCZ 23 \-100 ~ 100 ✔️ ✔️ WII\_ACCNX 25 \-100 ~ 100 ✔️ ✔️ WII\_ACCNY 26 \-100 ~ 100 ✔️ ✔️ WII\_ACCNZ 27 \-100 ~ 100 ✔️ ✔️ WII\_IRX 28 \-100 ~ 100 ✔️ ✔️ WII\_IRY 29 \-100 ~ 100 ✔️ ✔️ **\-- Values Range --** ( 0 | 100 ) means 0 or 100 ( 0 ~ 100 ) means any value between 0 and 100 ( -100 ~ 100 ) means any value between -100 and 100 Accelerometers: 25% represents 1G; 100% == 4G [PreviousXbox Onechevron-left](https://gpc.cronusmax.com/constants/controller-constants/xbox-one) [NextNintendo Switchchevron-right](https://gpc.cronusmax.com/constants/controller-constants/switch) Last updated 4 years ago Was this helpful? Was this helpful? --- # Core Console Functions | Cronus GPC Documentation Function Name Description Zen Plus [get\_console](https://gpc.cronusmax.com/functions-and-commands/console-functions/i-o-functions#get_console) Gets which console is currently connected ✔️ ✔️ [set\_val](https://gpc.cronusmax.com/functions-and-commands/console-functions/i-o-functions#set_val) Sets the output value to send to the console ✔️ ✔️ [block\_all\_inputs](https://gpc.cronusmax.com/functions-and-commands/console-functions/i-o-functions#block_all_inputs) Blocks all output from being sent to the console this cycle of main ✔️ ❌ [ps4\_authtimeout](https://gpc.cronusmax.com/functions-and-commands/console-functions/i-o-functions#ps-4-_authtimeout) Check if ps4 authentication is timed out ❌ ✔️ [output\_reconnection](https://gpc.cronusmax.com/functions-and-commands/console-functions/i-o-functions#output_reconnection) Check the output if reconnected ❌ ✔️ output\_protocol Sets Output protocol ❌ ✔️ [get\_led](https://gpc.cronusmax.com/functions-and-commands/console-functions/i-o-functions#get_led) Returns the current state of a specified LED ✔️ ✔️ [get\_rumble](https://gpc.cronusmax.com/functions-and-commands/console-functions/i-o-functions#get_rumble) Returns the current value of a rumble motor ✔️ ✔️ [hashtag](https://gpc.cronusmax.com/functions-and-commands/console-functions/i-o-functions#get_console) get\_console ------------------------------------------------------------------------------------------------------------------------- `opcode` sets one bit of a variable based on its bit index¹ ² ³ Copy opcode(a,5); #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/console-functions/i-o-functions#syntax) 🔴 **Syntax**¹ ² ³ `opcode( , );` #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/console-functions/i-o-functions#parameters) ⚪ **Parameters** : any defined variable. : index point of the bit to be set with a range of 0 to 15. #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/console-functions/i-o-functions#returns) 🔵 **Returns** Nothing [hashtag](https://gpc.cronusmax.com/functions-and-commands/console-functions/i-o-functions#set_val) 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: #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/console-functions/i-o-functions#syntax-1) 🔴 **Syntax** set\_val ( ); #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/console-functions/i-o-functions#parameters-1) ⚪ **Parameters** : the identifier of a controller entry [hashtag](https://gpc.cronusmax.com/functions-and-commands/console-functions/i-o-functions#block_all_inputs) block\_all\_inputs ------------------------------------------------------------------------------------------------------------------------------------ `block_all_input` Blocks all output from being sent to the console this cycle of main [hashtag](https://gpc.cronusmax.com/functions-and-commands/console-functions/i-o-functions#ps4_authtimeout) 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 CronusZEN 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 CronusZEN 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: #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/console-functions/i-o-functions#syntax-2) 🔴 **Syntax** `ps4_authtimeout ( );` #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/console-functions/i-o-functions#parameters-2) ⚪ **Parameters** None #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/console-functions/i-o-functions#returns-1) 🔵 **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 CronusZEN. [hashtag](https://gpc.cronusmax.com/functions-and-commands/console-functions/i-o-functions#output_reconnection) output\_reconnection ----------------------------------------------------------------------------------------------------------------------------------------- `opcode` sets one bit of a variable based on its bit index¹ ² ³ #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/console-functions/i-o-functions#syntax-3) 🔴 **Syntax**¹ ² ³ `opcode( , );` #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/console-functions/i-o-functions#parameters-3) ⚪ **Parameters** : any defined variable. : index point of the bit to be set with a range of 0 to 15. #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/console-functions/i-o-functions#returns-2) 🔵 **Returns** Nothing [hashtag](https://gpc.cronusmax.com/functions-and-commands/console-functions/i-o-functions#get_led) 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 LED 1 / Xbox 360 Quadrant 1 0 LED\_2 LED 2 / Xbox 360 Quadrant 2 1 LED\_3 LED 3 / Xbox 360 Quadrant 3 2 LED\_4 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: #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/console-functions/i-o-functions#syntax-4) 🔴 **Syntax** `get_led ( );` #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/console-functions/i-o-functions#parameters-4) ⚪ **Parameters** : The identifier of an LED #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/console-functions/i-o-functions#returns-3) 🔵 **Returns** An **int** ranging from 0 ~ 3 which represents the current state Click [here](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds) for more information on LED states [hashtag](https://gpc.cronusmax.com/functions-and-commands/console-functions/i-o-functions#get_rumble) 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 RUMBLE\_A Strong Rumble Motor (Usually the Left Motor) 0 RUMBLE\_B Weak Rumble Motor (Usually the Right Motor) 1 RUMBLE\_RT Right Trigger Motor (Xbox One controllers only) 2 RUMBLE\_LT Left Trigger Motor (Xbox One controllers only) 3 Example of usage: #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/console-functions/i-o-functions#syntax-5) 🔴 **Syntax** `get_rumble ( );` #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/console-functions/i-o-functions#parameters-5) ⚪ **Parameters** : the identifier of a Rumble Motor #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/console-functions/i-o-functions#returns-4) 🔵 **Returns** An **int** ranging from 0 ~ 100 which represents the current speed of the chosen motor Click [here](https://gpc.cronusmax.com/functions-and-commands/controller-functions/rumble) for more information on setting Rumble Motors [PreviousConsole Functionschevron-left](https://gpc.cronusmax.com/functions-and-commands/console-functions) [NextController Functionschevron-right](https://gpc.cronusmax.com/functions-and-commands/controller-functions) Last updated 4 years ago Was this helpful? * [get\_console](https://gpc.cronusmax.com/functions-and-commands/console-functions/i-o-functions#get_console) * [set\_val](https://gpc.cronusmax.com/functions-and-commands/console-functions/i-o-functions#set_val) * [block\_all\_inputs](https://gpc.cronusmax.com/functions-and-commands/console-functions/i-o-functions#block_all_inputs) * [ps4\_authtimeout](https://gpc.cronusmax.com/functions-and-commands/console-functions/i-o-functions#ps4_authtimeout) * [output\_reconnection](https://gpc.cronusmax.com/functions-and-commands/console-functions/i-o-functions#output_reconnection) * [get\_led](https://gpc.cronusmax.com/functions-and-commands/console-functions/i-o-functions#get_led) * [get\_rumble](https://gpc.cronusmax.com/functions-and-commands/console-functions/i-o-functions#get_rumble) Was this helpful? Copy main { if(get_val(XB1_LT)) { // If LT / L2 is pressed set_val(XB1_LT, 100); // Set LT / L2 to 100 (Fully Pressed) } if(get_val(XB1_RT)) { // If RT / R2 is pressed set_val(XB1_RT, 100); // Set RT / R2 to 100 (Fully Pressed) } } Copy main{ if(event_press(PS4_PS)) block_all_input(); } function block_all_input() { set_val(PS4_UP , 0 ); set_val(PS4_DOWN , 0 ); set_val(PS4_LEFT , 0 ); set_val(PS4_RIGHT , 0); set_val(PS4_CROSS , 0 ); set_val(PS4_CIRCLE, 0 ); set_val(PS4_SQUARE, 0 ); set_val(PS4_TRIANGLE, 0); set_val(PS4_L1 , 0 ); set_val(PS4_R1 , 0 ); set_val(PS4_L3 , 0 ); set_val(PS4_R3 , 0); set_val(PS4_OPTIONS, 0 ); set_val(PS4_SHARE , 0 ); set_val(PS4_TOUCH , 0 ); set_val(PS4_PS , 0); set_val(PS4_LX, 0); set_val(PS4_LY, 0); set_val(PS4_RX, 0); set_val(PS4_RY, 0); set_val(PS4_L2, 0); set_val(PS4_R2, 0); } Copy int authcount; int NOTIFY = 3; //1 = 30 secs 2 = 1 min 3 = 1 min 30 secs and so on up to 16. main{ //PS4 Cross Over Gaming Section if(get_console() == PIO_PS4 && get_controller() != PIO_PS4){ authcount = ps4_authtimeout(); swap(PS4_SHARE,PS4_TOUCH); // Swap Back/Select with Touchpad Press if(get_val(PS4_SHARE) && get_val(PS4_R3)) { // Press Back/Select and press RS/R3 to press share. set_val(PS4_TOUCH, 0); set_val(PS4_R3, 0); set_val(PS4_SHARE, 100); } if(get_val(PS4_TOUCH)) { // Hold Back/Select and Press A/Cross to reset Auth Timeout. if(event_press(PS4_CROSS)){ output_reconnection(); } set_val(PS4_CROSS, 0); } if(authcount <= NOTIFY + 1) { combo_run(notify); } } //PS4 Cross Over Gaming Section End } combo notify{ set_rumble(RUMBLE_A, 100); set_rumble(RUMBLE_B, 100); wait(150); reset_rumble(); wait(250*authcount); } Copy opcode(a,5); Copy main { if(get_led(LED_2) == 1) { // If LED 2 is On // Do Something } } Copy main { if(get_rumble(RUMBLE_A) > 50) { // If Rumble Motor A is running greater than 50% speed... // Do Something } } --- # Device Functions | Cronus GPC Documentation Here we will cover a few functions available within your code, these functions Function Description Zen Plus [get\_rtime](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#get_rtime) Returns the elapsed time between **main** iterations in milliseconds ✔️ ✔️ [get\_slot](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#get_slot) Returns the active slot number ✔️ ✔️ [load\_slot](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#load_slot) Loads a specified slot ✔️ ✔️ [get\_ctrlbutton](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#get_ctrlbutton) Returns the identifier of the controller button ✔️ ✔️ [vm\_tctrl](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#vm_tctrl) Sets the vm timeout for the next iteration ✔️ ✔️ [set\_polar](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#set_polar) Sets the stick output at a given angle and radius with a high resolution value ✔️ ❌ [set\_rgb](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#set_rgb) Sets the LED on the ZEN to the supplied RGB color ✔️ ❌ [set\_hsb](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#set_hsb) Sets the LED on the ZEN to the supplied HSB color ✔️ ❌ [clamp function](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#clamp-function) 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. ✔️ ❌ [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#get_rtime) **get\_rtime** ----------------------------------------------------------------------------------------------------------------------------- `get_rtime`returns the elapsed time between the current and previous iteration of the **main** function. The value returned is in milliseconds. You can see this function in action by using this counter script: Copy int days; int hours; int minutes; int seconds; int milliseconds; main { milliseconds = milliseconds + get_rtime(); if(milliseconds >= 1000) { milliseconds = milliseconds - 1000 seconds = seconds + 1; if(seconds == 60) { seconds = 0; minutes = minutes + 1; if(minutes == 60) { minutes = 0; hours = hours + 1; if(hours == 24) { hours = 0; days = days + 1; } } } } set_val(TRACE_1, days); set_val(TRACE_2, hours); set_val(TRACE_3, minutes); set_val(TRACE_4, seconds); set_val(TRACE_5, milliseconds / 10); } #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#syntax) 🔴 **Syntax** `get_rtime ( );` #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#parameters) ⚪ **Parameters** None #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#returns) 🔵 **Returns** The elapsed time, in milliseconds, between the main iteration [Main Sectionchevron-right](https://gpc.cronusmax.com/main-section) [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#get_slot) get\_slot ----------------------------------------------------------------------------------------------------------------------- `get_slot` returns an _int_ value representing the current active slot of the Cronus Device. #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#syntax-1) 🔴 **Syntax** `getslot();` #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#parameters-1) ⚪ **Parameters** None #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#returns-1) 🔵 **Returns** An _int_ value representing the current active slot of the Cronus Device. [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#load_slot) load\_slot ------------------------------------------------------------------------------------------------------------------------- `load_slot` will attempt to load the slot number specified within its parameter. If there is no script current stored in the specified slot, then it will unload the current slot and load slot 0 of the device. #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#syntax-2) 🔴 **Syntax** `load_slot ( );` #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#parameters-2) ⚪ **Parameters** : A value which represents a slot number to load with a range of 0 - 9 on Cronus MAX Plus or 0 - 8 on Cronus ZEN. #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#returns-2) 🔵 **Returns** Nothing [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#get_ctrlbutton) get\_ctrlbutton ----------------------------------------------------------------------------------------------------------------------------------- `get_ctrlbutton` returns the current control button. The control button is set in the Device tab within Cronus PRO's Options window or the Device Tab of the Cronus Zen. The enable remote control switch on device dictates which button it is set to {{IMAGE PLACEHOLDER}} #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#syntax-3) 🔴 **Syntax** `get_ctrlbutton( );` #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#parameters-3) ⚪ **Parameters** Nothing #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#returns-3) 🔵 **Returns** Depending on the remote slot settings the value can be 0, 1 or 8. [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#vm_tctrl) vm\_tctrl ----------------------------------------------------------------------------------------------------------------------- Sets the virtual machine timeout for the next iteration. By default, the virtual machine runs the main loop every 10 milliseconds as it aids stability. You can however adjust how often each main iteration is run. Just be aware than changing this setting may cause instability within your script. #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#syntax-4) 🔴 **Syntax** `vm_tctrl( );` #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#parameters-4) ⚪ **Parameters** : Numeric value to add to the Virtual Machine base time. Range -9 ~ 10 #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#returns-4) 🔵 **Returns** Nothing [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#set_polar) set\_polar ------------------------------------------------------------------------------------------------------------------------- Sets the stick output at a given angle and radius with a high resolution value #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#syntax-5) 🔴 **Syntax**¹ ² ³ `set_polar(stick,angle,radius);` #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#parameters-5) ⚪ **Parameters** stick: defined stick (POLAR\_LS or POLAR\_RS). angle: index point of the bit to be set with a range of 0 to 359. radius: index point of the bit to be set with a range of -32768 to 32767. #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#returns-5) 🔵 **Returns** Nothing [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#set_rgb) set\_rgb --------------------------------------------------------------------------------------------------------------------- Sets the LED on the ZEN to the supplied RGB color (Red,Green,Blue). #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#syntax-6) 🔴 **Syntax**¹ ² ³ `set_rgb(red,green,blue);` #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#parameters-6) ⚪ **Parameters** 1. red: index point of the bit to be set with a range of 0 - 255 2. green: index point of the bit to be set with a range of 0 - 255 3. blue: index point of the bit to be set with a range of 0 - 255 #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#returns-6) 🔵 **Returns** Nothing [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#set_hsb) set\_hsb --------------------------------------------------------------------------------------------------------------------- set\_hsb sets the LED colors on the Zen eyes or a Playstation controller based on the Hue, Saturation, and Brightness. #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#syntax-7) 🔴 **Syntax**¹ ² ³ set\_hsb( Hue, Saturation, Brightness)`;` #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#parameters-7) ⚪ **Parameters** 1. hue: index point of the bit to be set with a range of 0 - 359 2. saturation: index point of the bit to be set with a range of 0 - 100 3. brightness: index point of the bit to be set with a range of 0 - 100 #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#returns-7) 🔵 **Returns** Nothing [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#clamp-function) clamp function ---------------------------------------------------------------------------------------------------------------------------------- The clamp function clamps _x_ to the range _\[min, max\]_. #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#syntax-8) 🔴 **Syntax**¹ ² ³ * clamp (_x, min, max_) #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#parameters-8) ⚪ **Parameters** 1. _x_ — The number to clamp. 2. _min_ — Lower bound of range to which _x_ is clamped. Minimum value returned. 3. _max_— Upper bound of range to which _x_ is clamped. Maximum value returned. #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#returns-8) 🔵 **Returns** Returns _min_ if _x_ is less than _min_, _max_ if _x_ is greater than _max_, and _x_ otherwise. #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#undefined) [PreviousMath Functionschevron-left](https://gpc.cronusmax.com/functions-and-commands/internal-functions/math-functions) [NextOLED Display Functionschevron-right](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions) Last updated 4 years ago Was this helpful? * [get\_rtime](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#get_rtime) * [get\_slot](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#get_slot) * [load\_slot](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#load_slot) * [get\_ctrlbutton](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#get_ctrlbutton) * [vm\_tctrl](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#vm_tctrl) * [set\_polar](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#set_polar) * [set\_rgb](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#set_rgb) * [set\_hsb](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#set_hsb) * [clamp function](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions#clamp-function) Was this helpful? Copy int _currentSlot; init { _currentSlot = get_slot(); } main { } Copy main { if(event_press(XB1_RB)) // if RB / R2 is pressed... load_slot(5); // Load slot 5 if(event_press(XB1_LB)) // if LB / L2 is pressed... load_slot(0); // Unload current slot and load slot 0 } Copy get_ctrlbutton(); Copy main { vm_tctrl(-5); // Run the VM every 5ms } Copy set_polar(POLAR_LS,250, 32000); Copy set_rgb(255,0,0) // red set_rgb(0,255,0)// green set_rgb(0,0,255) // blue Copy set_hsb(300, 55, 70); Copy clamp(-11, -10, 10) // result = -10; --- # Math Functions | Cronus GPC Documentation In this section are the GPC functions used to perform specific mathematical operations. Two important things to note when working while performing math computations in GPC is that it is a signed 16bit environment so all operations must work within that range which is -32768 to +32767 and GPC only supports integer values which means any fractions will be rounded down to a whole value. Function Description Zen Plus [abs](https://gpc.cronusmax.com/functions-and-commands/internal-functions/math-functions#abs) Returns an absolute value of a number ✔️ ✔️ [inv](https://gpc.cronusmax.com/functions-and-commands/internal-functions/math-functions#inv) Returns the inverse value of a number ✔️ ✔️ [pow](https://gpc.cronusmax.com/functions-and-commands/internal-functions/math-functions#pow) Raise and value to the specified power ✔️ ✔️ [isqrt](https://gpc.cronusmax.com/functions-and-commands/internal-functions/math-functions#opcode) Calculates an integer square root ✔️ ✔️ [random](https://gpc.cronusmax.com/functions-and-commands/internal-functions/math-functions#random) Generates a random value between the specified range ✔️ ❌ [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/math-functions#abs) abs ---------------------------------------------------------------------------------------------------------- `abs`command returns the absolute value of an expression. An absolute value is a number without regard for its sign, for example the absolute value of 8 and -8 is 8. An absolute value can also be thought of as its distance from zero which is always a positive value. One of the popular uses for the abs command is when working with axis to start combos. Such as in fighting games where many users tend to use the right stick to start a combo. So if you wished for the same combo to be run if the right stick was pushed left or right, instead of using the 'or' ( || ) operator or using two if commands you could just do this: Copy main { if( abs(get_val(XB1_RX)) > 70 ) // if RX is greater than 70 or less than -70 combo_run(my_combo); } combo my_combo { //Do something } #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/math-functions#syntax) 🔴 **Syntax** `abs ( );` #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/math-functions#parameters) ⚪ **Parameters** : any expression which has a value #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/math-functions#returns) 🔵 **Returns** The absolute value of the expression [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/math-functions#inv) inv ---------------------------------------------------------------------------------------------------------- `inv` returns the inverted value of an expression or number. This means a positive value will be turned in to a negative value and vice versa, which is the same as multiplying the value by -1. For example; One of the popular uses for this command is to invert the right sticks Y axis. For example, if you prefer to play with an inverted aim but come across a game which doesn't support it, with one line of code you can have the Cronus invert the axis for you. Like so: #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/math-functions#syntax-1) 🔴 **Syntax** `inv( );` #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/math-functions#parameters-1) ⚪ **Parameters** : any expression which has a value. #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/math-functions#returns-1) 🔵 **Returns** The inverted value of the expression [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/math-functions#pow) pow ---------------------------------------------------------------------------------------------------------- `pow` raises the given value to the power specified. What this means is a value will be multiple by itself X amount of times. For example: circle-exclamation This function must be used with caution as there is a risk of an integer overflow when using it. This would occur when the function attempts to return a value greater than 32767 which is the maximum value for a signed 16 bit integer. #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/math-functions#syntax-2) 🔴 **Syntax** `pow ( , );` #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/math-functions#parameters-2) ⚪ **Parameters** : base number . : power raised to the base value. #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/math-functions#returns-2) 🔵 **Returns** It returns the base value raised to the power of the exponent. [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/math-functions#isqrt) isqrt -------------------------------------------------------------------------------------------------------------- `isqrt` returns the square root of a given value. The square root of a value is the value which when multiplied by itself equals the given value. For example, the square root of 25 is 5 (5 \* 5 = 25). The return value is an integer which means any fractions will be dropped. As shown below: #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/math-functions#syntax-3) 🔴 **Syntax** `isqrt ( );` #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/math-functions#parameters-3) ⚪ **Parameters** : any expression which has a value. 🔵 **Returns** The square root of the given expression [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/math-functions#random) random ---------------------------------------------------------------------------------------------------------------- `random` generates a random `_int_` between two numbers (minimum -32768 and maximum 32767) circle-info This function is only available with Cronus Zen #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/math-functions#syntax-4) 🔴 **Syntax** `random ( , );` #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/math-functions#parameters-4) ⚪ **Parameters** : the minimum integer value to start your random number (minimum value -32768) : the maximum integer value to start your random number (maximum value 32767) #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/math-functions#returns-3) 🔵 **Returns** Generates a random `_int_` value between the and the parameters. [PreviousCombo Functionschevron-left](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions) [NextDevice Functionschevron-right](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions) Last updated 6 years ago Was this helpful? * [abs](https://gpc.cronusmax.com/functions-and-commands/internal-functions/math-functions#abs) * [inv](https://gpc.cronusmax.com/functions-and-commands/internal-functions/math-functions#inv) * [pow](https://gpc.cronusmax.com/functions-and-commands/internal-functions/math-functions#pow) * [isqrt](https://gpc.cronusmax.com/functions-and-commands/internal-functions/math-functions#isqrt) * [random](https://gpc.cronusmax.com/functions-and-commands/internal-functions/math-functions#random) Was this helpful? Copy int a = 100; int b = -50; main { a = inv(a); // a = -100 b = inv(b); // b = 50 } Copy main { // Set RY to the inverse of its current value set_val(XB1_RY, inv(get_val(XB1_RY)) ); } Copy int a; main { a = pow(5, 3); // a = 125 (5³) or (5 * 5 * 5) } Copy int a; main { a = isqrt(10); // a = 3. The square root of 10 is 3.16... // GPC supports integer values only so the fraction is dropped. } Copy int a = 5; // minimum value of the integer to randomize int b = 3999; // maximum value of the integer to randomize int c; main { c = random(a,b); // generates a random number and assigns the result to c; } --- # PS4 | Cronus GPC Documentation Name Value Range Zen Plus PS4\_PS 0 0 | 100 ✔️ ✔️ PS4\_SHARE 1 0 | 100 ✔️ ✔️ PS4\_OPTIONS 2 0 | 100 ✔️ ✔️ PS4\_R1 3 0 | 100 ✔️ ✔️ PS4\_R2 4 0 ~ 100 ✔️ ✔️ PS4\_R3 5 0 | 100 ✔️ ✔️ PS4\_L1 6 0 | 100 ✔️ ✔️ PS4\_L2 7 0 ~ 100 ✔️ ✔️ PS4\_L3 8 0 | 100 ✔️ ✔️ PS4\_RX 9 \-100 ~ 100 ✔️ ✔️ PS4\_RY 10 \-100 ~ 100 ✔️ ✔️ PS4\_LX 11 \-100 ~ 100 ✔️ ✔️ PS4\_LY 12 \-100 ~ 100 ✔️ ✔️ PS4\_UP 13 0 | 100 ✔️ ✔️ PS4\_DOWN 14 0 | 100 ✔️ ✔️ PS4\_LEFT 15 0 | 100 ✔️ ✔️ PS4\_RIGHT 16 0 | 100 ✔️ ✔️ PS4\_TRIANGLE 17 0 | 100 ✔️ ✔️ PS4\_CIRCLE 18 0 | 100 ✔️ ✔️ PS4\_CROSS 19 0 | 100 ✔️ ✔️ PS4\_SQUARE 20 0 | 100 ✔️ ✔️ PS4\_ACCX 21 \-100 ~ 100 ✔️ ✔️ PS4\_ACCY 22 \-100 ~ 100 ✔️ ✔️ PS4\_ACCZ 23 \-100 ~ 100 ✔️ ✔️ PS4\_GYROX 24 \-100 ~ 100 ✔️ ✔️ PS4\_GYROY 25 \-100 ~ 100 ✔️ ✔️ PS4\_GYROZ 26 \-100 ~ 100 ✔️ ✔️ PS4\_TOUCH 27 0 | 100 ✔️ ✔️ PS4\_FINGER1X 28 \-100 ~ 100 ✔️ ✔️ PS4\_FINGER1Y 29 \-100 ~ 100 ✔️ ✔️ PS4\_FINGER1 30 \-100 ~ 100 ✔️ ✔️ PS4\_FINGER2X 31 \-100 ~ 100 ✔️ ❌ PS4\_FINGER2Y 32 \-100 ~ 100 ✔️ ❌ PS4\_FINGER2 33 \-100 ~ 100 ✔️ ❌ **\-- Values Range --** ( 0 | 100 ) means 0 or 100 ( 0 ~ 100 ) means any value between 0 and 100 ( -100 ~ 100 ) means any value between -100 and 100 Accelerometers: 25% represents 1G; 100% == 4G [PreviousPS3chevron-left](https://gpc.cronusmax.com/constants/controller-constants/ps3) [NextXBox 360chevron-right](https://gpc.cronusmax.com/constants/controller-constants/xbox-360) Last updated 3 years ago Was this helpful? Was this helpful? --- # OLED Display Functions | Cronus GPC Documentation The functions below allow you to control the output display on the Zen. These are specific to the Zen and do not work in the CronusMAX Plus. Function Description Zen Plus [pixel\_oled](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#pixel_oled) Draws a pixel on the OLED display ✔️ ❌ [line\_oled](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#line_oled) Draws a line on the OLED display ✔️ ❌ [rect\_oled](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#rect_oled) Draws a rectangle on the OLED display ✔️ ❌ [circle\_oled](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#circle_oled) Draws a circle on the OLED display ✔️ ❌ [putc\_oled](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#putc_oled) Puts a character into the string buffer for puts\_oled ✔️ ❌ [puts\_oled](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#puts_oled) Draws the characters supplied using putc\_oled on the OLED display ✔️ ❌ [cls\_oled](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#cls_oled) Sets the entire OLED display to a single color ✔️ ❌ [printf](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#printf) Draws a string on the OLED display ✔️ ❌ [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#pixel_oled) pixel\_oled --------------------------------------------------------------------------------------------------------------------------------- Draws a pixel on the OLED display Copy pixel_oled(x, y, color); #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#syntax) 🔴 **Syntax** `pixel_oled( , , );` #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#parameters) ⚪ **Parameters** : The X coordinate of the pixel : The Y coordinate of the pixel : The color flag to set the pixel to 0 means Black and 1 means White #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#returns) 🔵 **Returns** Nothing [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#line_oled) line\_oled ------------------------------------------------------------------------------------------------------------------------------- Draws a line of pixels #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#syntax-1) 🔴 **Syntax** `line_oled( , , , , , );` #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#parameters-1) ⚪ **Parameters** : The starting X coordinate : The starting Y coordinate : The ending X coordinate : The ending Y coordinate : The thickness of the line : The color flag to set the pixels to 0 means Black and 1 means White #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#returns-1) 🔵 **Returns** Nothing [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#rect_oled) rect\_oled ------------------------------------------------------------------------------------------------------------------------------- Draws a rectangle on the OLED screen of the Cronus Zen #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#syntax-2) 🔴 **Syntax** `rect_oled( , , , , , );` #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#parameters-2) ⚪ **Parameters** : The X coordinate of the upper left corner of the rectangle : The Y coordinate of the upper left corner of the rectangle : The width of the rectangle to draw : The height of the rectangle to draw : A flag saying if the rectangle should be filled or just outlined (1 means fill it, 0 means only draw the outline) : The color flag to set the pixels to 0 means Black and 1 means White #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#returns-2) 🔵 **Returns** Nothing [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#circle_oled) circle\_oled ----------------------------------------------------------------------------------------------------------------------------------- Draws a circle on the Cronus Zen OLED screen. #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#syntax-3) 🔴 **Syntax** `circle_oled( , , , , );` #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#parameters-3) ⚪ **Parameters** : The X coordinate of the center of the circle? : The Y coordinate of the center of the circle? : The radius of the circle to draw (the distance from the center point to the outer edge) : A flag saying if the rectangle should be filled or just outlined (1 means fill it, 0 means only draw the outline) : The color flag to set the pixels to 0 means Black and 1 means White #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#returns-3) 🔵 **Returns** Nothing [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#putc_oled) putc\_oled ------------------------------------------------------------------------------------------------------------------------------- Puts a character into the string buffer for puts\_oled #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#syntax-4) 🔴 **Syntax** `putc_oled( , );` #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#parameters-4) ⚪ **Parameters** : The 1 based index where to put the character in the buffer : The ASCII code value to put into the buffer, see table of supported characters/constants [here](https://gpc.cronusmax.com/constants/zen/ascii) #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#returns-4) 🔵 **Returns** Nothing [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#puts_oled) puts\_oled ------------------------------------------------------------------------------------------------------------------------------- Draws the characters supplied using putc\_oled on the OLED display #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#syntax-5) 🔴 **Syntax** `puts_oled( , , , , );` #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#parameters-5) ⚪ **Parameters** : The X coordinate of the upper left corner of where the text will be drawn : The Y coordinate of the upper left corner of where the text will be drawn : The font constant to use when drawing the text see table of supported fonts [here](https://gpc.cronusmax.com/constants/zen/oled-constants#oled-font-constants) : The color flag to set the pixels to 0 means Black and 1 means White #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#returns-5) 🔵 **Returns** Nothing [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#cls_oled) cls\_oled ----------------------------------------------------------------------------------------------------------------------------- Sets the entire OLED display to a single color #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#syntax-6) 🔴 **Syntax** `cls_oled( );` #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#parameters-6) ⚪ **Parameters** : any defined variable. #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#returns-6) 🔵 **Returns** Nothing [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#printf) printf ------------------------------------------------------------------------------------------------------------------------ Draws a string on the OLED display #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#syntax-7) 🔴 **Syntax** `printf( , , , , );` #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#parameters-7) ⚪ **Parameters** : The X coordinate of the upper left corner of where the text will be drawn : The Y coordinate of the upper left corner of where the text will be drawn : The font constant to use when drawing the text see table of supported fonts [here](https://gpc.cronusmax.com/constants/zen/oled-constants#oled-font-constants) : The color flag to set the pixels to 0 means Black and 1 means White : The offset in the data section where the 0 terminated string is located, usually used with the string constant type #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#returns-7) 🔵 **Returns** Nothing [PreviousDevice Functionschevron-left](https://gpc.cronusmax.com/functions-and-commands/internal-functions/device-functions) [NextConsole Functionschevron-right](https://gpc.cronusmax.com/functions-and-commands/console-functions) Last updated 4 years ago Was this helpful? * [pixel\_oled](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#pixel_oled) * [line\_oled](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#line_oled) * [rect\_oled](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#rect_oled) * [circle\_oled](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#circle_oled) * [putc\_oled](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#putc_oled) * [puts\_oled](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#puts_oled) * [cls\_oled](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#cls_oled) * [printf](https://gpc.cronusmax.com/functions-and-commands/internal-functions/oled-display-functions#printf) Was this helpful? Copy line_oled(x, y, tox, toy, thickness, color); Copy rect_oled(x, y, width, height, fill, color); Copy circle_oled(x, y, radius, fill, color); Copy putc_oled(position, ascii); Copy puts_oled(x, y, font, length, color); Copy cls_oled(color); Copy printf(x, y, font, color, stringaddr); --- # PS3 | Cronus GPC Documentation Name Value Range Plus Plus PS3\_PS 0 0 | 100 ✔️ ✔️ PS3\_SELECT 1 0 | 100 ✔️ ✔️ PS3\_START 2 0 | 100 ✔️ ✔️ PS3\_R1 3 0 | 100 ✔️ ✔️ PS3\_R2 4 0 ~ 100 ✔️ ✔️ PS3\_R3 5 0 | 100 ✔️ ✔️ PS3\_L1 6 0 | 100 ✔️ ✔️ PS3\_L2 7 0 ~ 100 ✔️ ✔️ PS3\_L3 8 0 | 100 ✔️ ✔️ PS3\_RX 9 \-100 ~ 100 ✔️ ✔️ PS3\_RY 10 \-100 ~ 100 ✔️ ✔️ PS3\_LX 11 \-100 ~ 100 ✔️ ✔️ PS3\_LY 12 \-100 ~ 100 ✔️ ✔️ PS3\_UP 13 0 | 100 ✔️ ✔️ PS3\_DOWN 14 0 | 100 ✔️ ✔️ PS3\_LEFT 15 0 | 100 ✔️ ✔️ PS3\_RIGHT 16 0 | 100 ✔️ ✔️ PS3\_TRIANGLE 17 0 | 100 ✔️ ✔️ PS3\_CIRCLE 18 0 | 100 ✔️ ✔️ PS3\_CROSS 19 0 | 100 ✔️ ✔️ PS3\_SQUARE 20 0 | 100 ✔️ ✔️ PS3\_ACCX 21 \-100 ~ 100 ✔️ ✔️ PS3\_ACCY 22 \-100 ~ 100 ✔️ ✔️ PS3\_ACCZ 23 \-100 ~ 100 ✔️ ✔️ PS3\_GYRO 24 \-100 ~ 100 ✔️ ✔️ **\-- Values Range --** ( 0 | 100 ) means 0 or 100 ( 0 ~ 100 ) means any value between 0 and 100 ( -100 ~ 100 ) means any value between -100 and 100 Accelerometers: 25% represents 1G; 100% == 4G [PreviousRumblechevron-left](https://gpc.cronusmax.com/constants/controller-constants/rumble) [NextPS4chevron-right](https://gpc.cronusmax.com/constants/controller-constants/controller-ps4-constants) Last updated 3 years ago Was this helpful? Was this helpful? --- # Core Keyboard Functions | Cronus GPC Documentation Function Description Zen Plus [get\_keyboard](https://gpc.cronusmax.com/functions-and-commands/keyboard-functions/core-keyboard-functions#get_keyboard) Checks if a chosen keyboard key is held down ✔️ ❌ [get\_modifiers](https://gpc.cronusmax.com/functions-and-commands/keyboard-functions/core-keyboard-functions#get_modifiers) Checks if a chosen keyboard modifier is held down (ALT, SHIFT,CTRL, etc.) ✔️ ❌ [get\_mk](https://gpc.cronusmax.com/functions-and-commands/keyboard-functions/core-keyboard-functions#get_mk) Gets Mouse&Keyboard config value ✔️ ❌ [set\_mk](https://gpc.cronusmax.com/functions-and-commands/keyboard-functions/core-keyboard-functions#set_mk) Sets Mouse&Keyboard config value ✔️ ❌ [hashtag](https://gpc.cronusmax.com/functions-and-commands/keyboard-functions/core-keyboard-functions#get_keyboard) get\_keyboard -------------------------------------------------------------------------------------------------------------------------------------- `get_keyboard` checks to see if a chosen keyboard key is pressed Copy main { if(get_keyboard(KEY_A)){ combo_run(jump); } } combo jump { wait(20); set_val(XB1_A, 100); wait(20); } #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/keyboard-functions/core-keyboard-functions#syntax) 🔴 **Syntax**¹ ² ³ `get_keyboard( );` #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/keyboard-functions/core-keyboard-functions#parameters) ⚪ **Parameters** : any defined keyboard constant. #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/keyboard-functions/core-keyboard-functions#returns) 🔵 **Returns** Nothing [hashtag](https://gpc.cronusmax.com/functions-and-commands/keyboard-functions/core-keyboard-functions#get_modifiers) get\_modifiers ---------------------------------------------------------------------------------------------------------------------------------------- `get_modifiers` sets one bit of a variable based on its bit index¹ ² ³ #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/keyboard-functions/core-keyboard-functions#syntax-1) 🔴 **Syntax**¹ ² ³ `get_modifiers( , );` #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/keyboard-functions/core-keyboard-functions#parameters-1) ⚪ **Parameters** : any defined variable. : index point of the bit to be set with a range of 0 to 15. #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/keyboard-functions/core-keyboard-functions#returns-1) 🔵 **Returns** Nothing [hashtag](https://gpc.cronusmax.com/functions-and-commands/keyboard-functions/core-keyboard-functions#get_mk) get\_mk -------------------------------------------------------------------------------------------------------------------------- Gets Mouse&Keyboard config value. mk\_type\_identifier - Must be MK\_GENERAL mk\_general\_identifier - Field to get information for mk\_axis\_identifier - Stick (X, Y or Unused) [hashtag](https://gpc.cronusmax.com/functions-and-commands/keyboard-functions/core-keyboard-functions#set_mk) set\_mk -------------------------------------------------------------------------------------------------------------------------- Sets Mouse&Keyboard config value. mk\_type\_identifier - Must be MK\_GENERAL mk\_general\_identifier - Field to set value for mk\_value1 - Value 1 (X axis or value) mk\_value2 - Value 2 (Y axis or not used??) [PreviousKeyboard Functionschevron-left](https://gpc.cronusmax.com/functions-and-commands/keyboard-functions) [Next#1chevron-right](https://gpc.cronusmax.com/gpc-examples/untitled) Last updated 4 years ago Was this helpful? * [get\_keyboard](https://gpc.cronusmax.com/functions-and-commands/keyboard-functions/core-keyboard-functions#get_keyboard) * [get\_modifiers](https://gpc.cronusmax.com/functions-and-commands/keyboard-functions/core-keyboard-functions#get_modifiers) * [get\_mk](https://gpc.cronusmax.com/functions-and-commands/keyboard-functions/core-keyboard-functions#get_mk) * [set\_mk](https://gpc.cronusmax.com/functions-and-commands/keyboard-functions/core-keyboard-functions#set_mk) Was this helpful? Copy opcode(a,5); Copy Example Coming Soon! Copy Example Coming Soon! --- # LED Functions | Cronus GPC Documentation Function Name Description Zen Plus [set\_led](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds#set_led) Sets the state of the LED on a controller ✔️ ✔️ [get\_led](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds#get_led) Gets the state of the LED on a controller ✔️ ✔️ [set\_ledx](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds#set_ledx) Blinks a LED a certain number of times ✔️ ✔️ [get\_ledx](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds#get_ledx) Checks if a LED is being blinked by the set\_ledx function ✔️ ✔️ [reset\_leds](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds#reset_leds) Reset the LEDs state to what was set by the console ✔️ ✔️ [get\_ps4\_lbar](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds#get_ps-4-_lbar) Gets ps4 indication bar color ✔️ ❌ [set\_ps4\_lbar](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds#set_ps-4-_lbar) Sets ps4 indication color ✔️ ❌ [hashtag](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds#set_led) set\_led ----------------------------------------------------------------------------------------------------------- `set_led` sets the state of an LED on the controller. The LEDs range from 0 to 3. Four constants have been created to make it easier to remember which value is assigned to which LED: Name Description Value LED\_1 LED 1 / Xbox 360 Quadrant 1 0 LED\_2 LED 2 / Xbox 360 Quadrant 2 1 LED\_3 LED 3 / Xbox 360 Quadrant 3 2 LED\_4 LED 4 / Xbox 360 Quadrant 4 3 An LED can be set to one of four states using this function which range from 0 to 3, as shown in the table below: Value Description 0 LED Off 1 LED On 2 LED Blink Fast 3 LED Blink Slowly #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds#syntax) 🔴 **Syntax** `set_led( ,);` #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds#parameters) ⚪ **Parameters** : the LED identifier. : the state identifier of the controller LED. #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds#returns) 🔵 **Returns** **None** [hashtag](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds#get_led) get\_led ----------------------------------------------------------------------------------------------------------- get\_led returns a value in the form of an **int** which represents the current state of the chosen LED. 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: #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds#syntax-1) 🔴 **Syntax** `get_led ( );` #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds#parameters-1) ⚪ **Parameters** : The identifier of an LED #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds#returns-1) 🔵 **Returns** An **int** ranging from 0 ~ 3 which represents the current state ### [hashtag](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds#undefined) [hashtag](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds#set_ledx) set\_ledx ------------------------------------------------------------------------------------------------------------- set\_ledx is used to Blink and LED a set amount of times. You can blink an led from 0 to 255 times. 0 sets the LED to on. Example of usage: #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds#syntax-2) 🔴 **Syntax** `set_ledx ( , );` #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds#parameters-2) ⚪ **Parameters** : the identifier of an LED : The number of times to blink the LED ### [hashtag](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds#undefined-1) [hashtag](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds#get_ledx) **get\_ledx** ----------------------------------------------------------------------------------------------------------------- get\_ledx checks to see if an LED is currently being blinked by the set\_ledx function. Example of usage: #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds#syntax-3) 🔴 **Syntax** `get_ledx ( );` #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds#parameters-3) ⚪ **Parameters** None #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds#returns-2) 🔵 **Returns** TRUE is the LEDs are being blinked by the set\_ledx function, FALSE if they are not ### [hashtag](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds#undefined-2) [hashtag](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds#reset_leds) reset\_leds ----------------------------------------------------------------------------------------------------------------- reset\_leds returns control of the LEDs to the console and disables any current LED states which are being set by the Virtual Machine. Example of usage: #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds#syntax-4) 🔴 **Syntax** `reset_leds ( );` #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds#parameters-4) ⚪ **Parameters** **None** ### [hashtag](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds#undefined-3) [hashtag](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds#setting-ds4-lightbar) Setting DS4 Lightbar ------------------------------------------------------------------------------------------------------------------------------------ The Dualshock 4 controller has one lightbar instead of four LEDs. The color of the lightbar can be controlled by setting all four led states simultaneously. ### [hashtag](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds#get_ps4_lbar) get\_ps4\_lbar `get_ps4_lbar` gets the playstation 4 lightbar led state from the console. _get\_ps4\_lbar(State, Range, Color)_ There is 3 Colors: **PS4\_RED,** **PS4**_**\_**_**GREEN, and PS4\_BLUE**_. They have a range from 0 - 255 ( Lower the number equals less brightness, higher the number equals more brighter )._ _Example:_ ### [hashtag](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds#set_ps4_lbar) set\_ps4\_lbar `set_ps4_lbar` sets the playstation 4 lightbar led state on the controller and sets the color that will be sent to the controller. There is 3 Colors: **DS4\_RED,** **DS4**_**\_**_**GREEN, and DS4\_BLUE**_. They have a range from 0 - 255 ( Lower the number equals less brightness, higher the number equals more brighter )._ Example: Example using both: [PreviousRumble Functionschevron-left](https://gpc.cronusmax.com/functions-and-commands/controller-functions/rumble) [NextKeyboard Functionschevron-right](https://gpc.cronusmax.com/functions-and-commands/keyboard-functions) Last updated 4 years ago Was this helpful? * [set\_led](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds#set_led) * [get\_led](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds#get_led) * [](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds#undefined) * [set\_ledx](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds#set_ledx) * [](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds#undefined-1) * [get\_ledx](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds#get_ledx) * [](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds#undefined-2) * [reset\_leds](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds#reset_leds) * [](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds#undefined-3) * [Setting DS4 Lightbar](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds#setting-ds4-lightbar) * [get\_ps4\_lbar](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds#get_ps4_lbar) * [set\_ps4\_lbar](https://gpc.cronusmax.com/functions-and-commands/controller-functions/leds#set_ps4_lbar) Was this helpful? Copy set_led(LED_1, 0); // turn the LED OFF set_led(LED_1, 1); // turn the LED ON set_led(LED_1, 2); // make the LED blink fast set_led(LED_1, 3); // make the LED blink slowly Copy main { if(get_led(LED_2) == 1) { // If LED 2 is On // Do Something } } Copy main { if(!get_ledx()) { // If the leds are not blinking... set_led(LED_1, 10); // Blink LED 1 10 times } } Copy main { if(get_ledx()) { // If the leds are blinking... // Do Something } } Copy main { if(event_press(XB1_A)) { // If A / Cross is Pressed... reset_leds(); // Reset Leds } } Copy if(get_ps4_lbar(TRUE,255,PS4_GREEN)){ // Will check if the console is sending Green lightbar to controller. Copy set_ps4_lbar(0,0,255); //Will set the DS4 lightbar to bright green. set_ps4_lbar(0,255,0); //Will set the DS4 lightbar to bright red. set_ps4_lbar(255,0,0); //Will set the DS4 lightbar to bright blue. Copy main{ if(get_ps4_lbar(TRUE,255,PS4_GREEN)){ //Checks if console sending green to controller. set_ps4_lbar(0,225,0) ; // Sets Contoller lightbar to Red if console sending Green to controller. } --- # Memory | Cronus GPC Documentation Name Value Zen Plus PVAR\_1 0 ✔️ ✔️ PVAR\_2 1 ✔️ ✔️ PVAR\_3 2 ✔️ ✔️ PVAR\_4 3 ✔️ ✔️️ PVAR\_5 4 ✔️ ✔️ PVAR\_6 5 ✔️ ✔️ PVAR\_7 6 ✔️ ✔️ PVAR\_8 7 ✔️ ✔️ PVAR\_9 8 ✔️ ✔️ PVAR\_10 9 ✔️ ✔️ PVAR\_11 10 ✔️ ✔️ PVAR\_12 11 ✔️ ✔️ PVAR\_13 12 ✔️ ✔️ PVAR\_14 13 ✔️ ✔️ PVAR\_15 14 ✔️ ✔️ PVAR\_16 15 ✔️ ✔️ SPVAR\_1 \-32768 ✔️ ✔️ SPVAR\_2 \-32767 ✔️ ✔️ SPVAR\_3 \-32766 ✔️ ✔️ SPVAR\_4 \-32765 ✔️ ✔️ SPVAR\_5 \-32764 ✔️ ✔️ SPVAR\_6 \-32763 ✔️ ✔️ SPVAR\_7 \-32762 ✔️ ✔️ SPVAR\_8 \-32761 ✔️ ✔️ SPVAR\_9 \-32760 ✔️ ✔️ SPVAR\_10 \-32759 ✔️ ✔️ SPVAR\_11 \-32758 ✔️ ✔️ SPVAR\_12 \-32757 ✔️ ✔️ SPVAR\_13 \-32756 ✔️ ✔️ SPVAR\_14 \-32755 ✔️ ✔️ SPVAR\_15 \-32754 ✔️ ✔️ SPVAR\_16 \-32753 ✔️ ✔️ SPVAR\_17 \-32752 ✔️ ✔️ SPVAR\_18 \-32751 ✔️ ✔️ SPVAR\_19 \-32750 ✔️ ✔️ SPVAR\_20 \-32749 ✔️ ✔️ SPVAR\_21 \-32748 ✔️ ✔️ SPVAR\_22 \-32747 ✔️ ✔️ SPVAR\_23 \-32746 ✔️ ✔️ SPVAR\_24 \-32745 ✔️ ✔️ SPVAR\_25 \-32744 ✔️ ✔️ SPVAR\_26 \-32743 ✔️ ✔️ SPVAR\_27 \-32742 ✔️ ✔️ SPVAR\_28 \-32741 ✔️ ✔️ SPVAR\_29 \-32740 ✔️ ✔️ SPVAR\_30 \-32739 ✔️ ✔️ SPVAR\_31 \-32738 ✔️ ✔️ SPVAR\_32 \-32737 ✔️ ✔️ SPVAR\_33 \-32736 ✔️ ❌ SPVAR\_34 \-32735 ✔️ ❌ SPVAR\_35 \-32734 ✔️ ❌ SPVAR\_36 \-32733 ✔️ ❌ SPVAR\_37 \-32732 ✔️ ❌ SPVAR\_38 \-32731 ✔️ ❌ SPVAR\_39 \-32730 ✔️ ❌ SPVAR\_40 \-32729 ✔️ ❌ SPVAR\_41 \-32728 ✔️ ❌ SPVAR\_42 \-32727 ✔️ ❌ SPVAR\_43 \-32726 ✔️ ❌ SPVAR\_44 \-32725 ✔️ ❌ SPVAR\_45 \-32724 ✔️ ❌ SPVAR\_46 \-32723 ✔️ ❌ SPVAR\_47 \-32722 ✔️ ❌ SPVAR\_48 \-32721 ✔️ ❌ SPVAR\_49 \-32720 ✔️ ❌ SPVAR\_50 \-32719 ✔️ ❌ SPVAR\_51 \-32718 ✔️ ❌ SPVAR\_52 \-32717 ✔️ ❌ SPVAR\_53 \-32716 ✔️ ❌ SPVAR\_54 \-32715 ✔️ ❌ SPVAR\_55 \-32714 ✔️ ❌ SPVAR\_56 \-32713 ✔️ ❌ SPVAR\_57 \-32712 ✔️ ❌ SPVAR\_58 \-32711 ✔️ ❌ SPVAR\_59 \-32710 ✔️ ❌ SPVAR\_60 \-32709 ✔️ ❌ SPVAR\_61 \-32708 ✔️ ❌ SPVAR\_62 \-32707 ✔️ ❌ SPVAR\_63 \-32706 ✔️ ❌ SPVAR\_64 \-32705 ✔️ ❌ [PreviousTracechevron-left](https://gpc.cronusmax.com/constants/trace) [NextMiscchevron-right](https://gpc.cronusmax.com/constants/misc) Last updated 6 years ago Was this helpful? Was this helpful? --- # Combo Functions | Cronus GPC Documentation [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions#combo-functions-and-commands) Combo Functions and Commands ------------------------------------------------------------------------------------------------------------------------------------------------------------- A combo (short for combination) is a combination of pre-programmed instructions which are executed in sequence. Just like the main section, commands within a combo are performed in the order they are written. You can run any code you can run in the main section within a combo such as calling functions or setting variables, although this is generally unnecessary and usually results in nothing more than a waste of stack memory and bytecode space. A combo is ideal suited to setting the output of a button for a specific length of time which is done using the wait command, a command that is unique to combos and cannot be used elsewhere. Just as with variables, a combos name can start with either an underscore ( \_ ) or a letter and can be followed by any combination of letters, digits or underscores. Function Description Zen Plus [combo\_run](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions#combo_run) Runs a combo ✔️ ✔️ [combo\_running](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions#combo_running) Checks if a combo is running ✔️ ✔️ [combo\_stop](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions#combo_stop) Stops a running combo ✔️ ✔️ [combo\_restart](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions#combo_restart) Restarts a running combo ✔️ ✔️ [combo\_suspend](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions#combo_suspend) Suspends (pauses) a combo ✔️ ✔️ [combo\_suspended](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions#combo_suspended) Checks if a combo is in the suspended state ✔️ ✔️ [combo\_current\_step](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions#combo_current_step) keywords returning the current step ✔️ ❌ [combo\_step\_time\_left](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions#combo_step_time_left) the time left of the currently executed step ✔️ ❌ [combo\_stop\_all](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions#combo_stop_all) Stops all combos ✔️ ❌ [combo\_suspend\_all](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions#combo_suspend_all) Suspends (pauses) all combos ✔️ ❌ [combo\_resume](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions#combo_resume) Resumes the suspended combo or already running combo ✔️ ❌ [combo\_resume\_all](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions#combo_resume_all) Resumes all suspended combos ✔️ ❌ [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions#undefined) ------------------------------------------------------------------------------------------------------------ [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions#combo_run) combo\_run ------------------------------------------------------------------------------------------------------------------------ `combo_run` does precisely what the name suggests and runs a combo. However, unlike the [combo\_restart](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions#combo_restart) command, it has no effect if the combo is currently running. It will only start a combo is it is not already running. #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions#syntax) 🔴**Syntax** `combo_run( );` #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions#parameters) ⚪**Parameters** : The name assigned to a combo 🔵**Returns** Nothing [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions#combo_running) combo\_running -------------------------------------------------------------------------------------------------------------------------------- `combo_running` is a function which can be used in your code to check is a combo is running is not. If the combo named in its parameter is running, then it will return **TRUE**. If not, it will return **FALSE**. #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions#syntax-1) 🔴**Syntax** `combo_running( );` #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions#parameters-1) ⚪**Parameters** : The name assigned to a combo 🔵**Returns** **TRUE** if the combo is currently running and **FALSE** if it is not. [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions#combo_stop) combo\_stop -------------------------------------------------------------------------------------------------------------------------- `combo_stop` does precisely what the name suggests and will stop a combo if it is running. As with [combo\_run](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions#combo_run) , it has no effect if the combo is currently not running. #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions#syntax-2) 🔴**Syntax** `combo_stop( );` #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions#parameters-2) ⚪**Parameters** : The name assigned to a combo 🔵**Returns** Nothing [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions#combo_restart) combo\_restart -------------------------------------------------------------------------------------------------------------------------------- `combo_restart` will restart a running combo. If the combo started within its parameters is currently running, it will be restarted from the beginning. If the combo is not currently running, it will be run. #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions#syntax-3) 🔴**Syntax** `combo_restart( );` #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions#parameters-3) ⚪**Parameters** : The name assigned to a combo 🔵**Returns** Nothing [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions#combo_suspend) combo\_suspend -------------------------------------------------------------------------------------------------------------------------------- `combo_suspend` command suspends (pauses) a combo from running . #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions#syntax-4) 🔴**Syntax** `combo_suspend( );` #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions#parameters-4) ⚪**Parameters** : The name assigned to a combo 🔵**Returns** Nothing [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions#combo_suspended) combo\_suspended ------------------------------------------------------------------------------------------------------------------------------------ `combo_suspended` Check to see if a combo is suspended. #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions#syntax-5) 🔴**Syntax** `combo_suspended( );` #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions#parameters-5) ⚪**Parameters** : Checks the name assigned to a combo if suspended 🔵**Returns** Nothing [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions#combo_current_step) combo\_current\_step ------------------------------------------------------------------------------------------------------------------------------------------- `combo_current_step` keywords returning the current step [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions#combo_step_time_left) combo\_step\_time\_left ------------------------------------------------------------------------------------------------------------------------------------------------ `combo_step_time_left` Checks the time left of the currently executed step. [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions#combo_stop_all) combo\_stop\_all ----------------------------------------------------------------------------------------------------------------------------------- `combo_stop_all` Stops all combos from running. [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions#combo_suspend_all) combo\_suspend\_all ----------------------------------------------------------------------------------------------------------------------------------------- `combo_suspend_all` Suspends all combos that is running. [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions#combo_resume) combo\_resume ------------------------------------------------------------------------------------------------------------------------------ `combo_resume` Will resume a combo if it is suspended or a running combo. [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions#combo_resume_all) combo\_resume\_all --------------------------------------------------------------------------------------------------------------------------------------- `combo_resume_all` Will resume all combos if it is suspended or a running combos. [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions#combo-specific-commands) Combo Specific Commands --------------------------------------------------------------------------------------------------------------------------------------------------- [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions#wait) wait ------------------------------------------------------------------------------------------------------------- `wait` command instructs the Virtual Machine within the Cronus on how long the last set of commands should be executed for. The length of time they instruct the VM to execute the commands for is represented in milliseconds and can rand from 1ms to 32 767ms (That's 1 millisecond to just over 32 seconds). The commands executed during the wait time are those placed between the current wait and the previous wait time, the current wait time and previous call command or the start of the combo, whichever comes first. As shown in the example below: circle-info The wait command can only be used within a combo and must be at the first level of the combo block, it cannot be nested. #### [hashtag](https://gpc.cronusmax.com/functions-and-commands/internal-functions/combo-functions#syntax-6) 🔴**Syntax** `wait(