# Table of Contents - [GPC Scripting - DF Identifiers - GPC Script Guide](#gpc-scripting-df-identifiers-gpc-script-guide) - [GPC Scripting - PS4 Identifiers - GPC Script Guide](#gpc-scripting-ps4-identifiers-gpc-script-guide) - [GPC Scripting - Trace Constants - GPC Script Guide](#gpc-scripting-trace-constants-gpc-script-guide) - [GPC Scripting - Xbox Series X/S Controller Identifiers - GPC Script Guide](#gpc-scripting-xbox-series-x-s-controller-identifiers-gpc-script-guide) - [Data Section - GPC Script Guide](#data-section-gpc-script-guide) - [GPC Scripting - Console Functions - GPC Script Guide](#gpc-scripting-console-functions-gpc-script-guide) - [GPC Scripting - Core Keyboard Functions - GPC Script Guide](#gpc-scripting-core-keyboard-functions-gpc-script-guide) - [GPC Scripting - LED Constants - GPC Script Guide](#gpc-scripting-led-constants-gpc-script-guide) - [A Simple Tutorial - GPC Script Guide](#a-simple-tutorial-gpc-script-guide) - [GPC Scripting - G29 Identifiers - GPC Script Guide](#gpc-scripting-g29-identifiers-gpc-script-guide) - [GPC Scripting - Controller Constants - GPC Script Guide](#gpc-scripting-controller-constants-gpc-script-guide) - [GPC Scripting - Nintendo WII Identifiers - GPC Script Guide](#gpc-scripting-nintendo-wii-identifiers-gpc-script-guide) - [GPC Scripting - Core Console Functions - GPC Script Guide](#gpc-scripting-core-console-functions-gpc-script-guide) --- # GPC Scripting - DF Identifiers - GPC Script Guide Navigate through spaces K [👋GPC: An Introduction](https://guide.cronus.support/gpc) [🚀New 32-bit Updates](https://guide.cronus.support/gpc/new-32bit-updates) 📑GPC Developer Guides [Basic Syntax](https://guide.cronus.support/gpc/basic-syntax) [Basic GPC Structure](https://guide.cronus.support/gpc/basic-gpc-structure-with-gpc-scripting) [A Simple Tutorial](https://guide.cronus.support/gpc/a-simple-tutorial) [Variables](https://guide.cronus.support/gpc/gpc-scripting-variables) [Definitions](https://guide.cronus.support/gpc/gpc-scripting-definitions) [Data Section](https://guide.cronus.support/gpc/data-section) [Remapping](https://guide.cronus.support/gpc/remapping) [Const Arrays](https://guide.cronus.support/gpc/gpc-scripting-const-arrays) [Init Section](https://guide.cronus.support/gpc/gpc-scripting-init-section) [Main Section](https://guide.cronus.support/gpc/gpc-scripting-main-section) [Combo Section](https://guide.cronus.support/gpc/gpc-scripting-combo-section) [User Created Functions](https://guide.cronus.support/gpc/gpc-scripting-user-created-functions) [Identifiers](https://guide.cronus.support/gpc/identifiers) [Flow Control](https://guide.cronus.support/gpc/flow-control) [Operator Types](https://guide.cronus.support/gpc/operator-types) [Constants](https://guide.cronus.support/gpc/gpc-scripting-constants) [Functions](https://guide.cronus.support/gpc/gpc-scripting-functions) [Device Functions](https://guide.cronus.support/gpc/gpc-scripting-device-functions) [Remapping](https://guide.cronus.support/gpc/gpc-scripting-remapping) [Advanced Samples](https://guide.cronus.support/gpc/gpc-scripting-advanced-samples) [API Samples](https://guide.cronus.support/gpc/gpc-scripting-api-samples) [Docs powered by Archbee](https://www.archbee.com/?utm_campaign=hosted-docs&utm_medium=referral&utm_source=guide.cronus.support) GPC Developer Guides ... Racing Wheel DF == the below table outlines all of the df identifiers which are defined, with value 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 clutch 10 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 value range explanation range meaning 0 | 100 either 0 or 100 0 100 any value between 0 and 100 100 100 any value between 100 and 100 [PREVIOUS\ \ G25](https://guide.cronus.support/gpc/gpc-scripting-g25-identifiers "G25") [NEXT\ \ DF GT](https://guide.cronus.support/gpc/gpc-scripting-df-gt-identifiers "DF GT") [Docs powered by Archbee](https://www.archbee.com/?utm_campaign=hosted-docs&utm_medium=referral&utm_source=guide.cronus.support) [Docs powered by Archbee](https://www.archbee.com/?utm_campaign=hosted-docs&utm_medium=referral&utm_source=guide.cronus.support) --- # GPC Scripting - PS4 Identifiers - GPC Script Guide Navigate through spaces K [👋GPC: An Introduction](https://guide.cronus.support/gpc) [🚀New 32-bit Updates](https://guide.cronus.support/gpc/new-32bit-updates) 📑GPC Developer Guides [Basic Syntax](https://guide.cronus.support/gpc/basic-syntax) [Basic GPC Structure](https://guide.cronus.support/gpc/basic-gpc-structure-with-gpc-scripting) [A Simple Tutorial](https://guide.cronus.support/gpc/a-simple-tutorial) [Variables](https://guide.cronus.support/gpc/gpc-scripting-variables) [Definitions](https://guide.cronus.support/gpc/gpc-scripting-definitions) [Data Section](https://guide.cronus.support/gpc/data-section) [Remapping](https://guide.cronus.support/gpc/remapping) [Const Arrays](https://guide.cronus.support/gpc/gpc-scripting-const-arrays) [Init Section](https://guide.cronus.support/gpc/gpc-scripting-init-section) [Main Section](https://guide.cronus.support/gpc/gpc-scripting-main-section) [Combo Section](https://guide.cronus.support/gpc/gpc-scripting-combo-section) [User Created Functions](https://guide.cronus.support/gpc/gpc-scripting-user-created-functions) [Identifiers](https://guide.cronus.support/gpc/identifiers) [Flow Control](https://guide.cronus.support/gpc/flow-control) [Operator Types](https://guide.cronus.support/gpc/operator-types) [Constants](https://guide.cronus.support/gpc/gpc-scripting-constants) [Functions](https://guide.cronus.support/gpc/gpc-scripting-functions) [Device Functions](https://guide.cronus.support/gpc/gpc-scripting-device-functions) [Remapping](https://guide.cronus.support/gpc/gpc-scripting-remapping) [Advanced Samples](https://guide.cronus.support/gpc/gpc-scripting-advanced-samples) [API Samples](https://guide.cronus.support/gpc/gpc-scripting-api-samples) [Docs powered by Archbee](https://www.archbee.com/?utm_campaign=hosted-docs&utm_medium=referral&utm_source=guide.cronus.support) GPC Developer Guides ... Controller PlayStation 4 ============= this is a list of all playstation 4 input identifiers, values, and ranges these also work for the ps5 dualsense controller name description value range ps4 ps ps/guide button 0 0 | 100 ps4 share share button 1 0 | 100 ps4 options options button 2 0 | 100 ps4 r1 right bumper 3 0 | 100 ps4 r2 right trigger 4 0 100 ps4 r3 right stick 5 0 | 100 ps4 l1 left bumper 6 0 | 100 ps4 l2 left trigger 7 0 100 ps4 l3 left stick 8 0 | 100 ps4 rx right stick x axis (left/right) 9 100 100 ps4 ry right stick y axis (up/down) 10 100 100 ps4 lx light stick x axis (left/right) 11 100 100 ps4 ly left stick y axis (up/down) 12 100 100 ps4 up d pad up 13 0 | 100 ps4 down d pad down 14 0 | 100 ps4 left d pad left 15 0 | 100 ps4 right d pad right 16 0 | 100 ps4 triangle triangle button 17 0 | 100 ps4 circle circle button 18 0 | 100 ps4 cross cross button 19 0 | 100 ps4 square square button 20 0 | 100 ps4 accx accx axis (left/right) 21 25 25 ps4 accy accy axis (up/down) 22 25 25 ps4 accz accz 23 25 25 ps4 gyrox gyrox axis (left/right) 24 25 25 ps4 gyroy gyroy axis (up/down) 25 25 25 ps4 gyroz gyroz 26 25 25 ps4 touch touch button 27 0 | 100 ps4 finger1x finger1x axis (left/right) 28 100 100 ps4 finger1y finger1y axis (up/down) 29 100 100 ps4 finger1 finger1 30 0 | 100 ps4 finger2x finger2x axis (left/right) 31 100 100 ps4 finger2y finger2y axis (up/down) 32 100 100 ps4 finger2 finger2 33 0 | 100 value range explanation range meaning 0 | 100 either 0 or 100 0 100 any value between 0 and 100 100 100 any value between 100 and 100 note for accelerometers, every 25% represents 1g [PREVIOUS\ \ PlayStation 5](https://guide.cronus.support/gpc/playstation-5 "PlayStation 5") [NEXT\ \ PlayStation 3](https://guide.cronus.support/gpc/gpc-scripting-ps3-identifiers "PlayStation 3") [Docs powered by Archbee](https://www.archbee.com/?utm_campaign=hosted-docs&utm_medium=referral&utm_source=guide.cronus.support) [Docs powered by Archbee](https://www.archbee.com/?utm_campaign=hosted-docs&utm_medium=referral&utm_source=guide.cronus.support) --- # GPC Scripting - Trace Constants - GPC Script Guide Navigate through spaces K [👋GPC: An Introduction](https://guide.cronus.support/gpc) [🚀New 32-bit Updates](https://guide.cronus.support/gpc/new-32bit-updates) 📑GPC Developer Guides [Basic Syntax](https://guide.cronus.support/gpc/basic-syntax) [Basic GPC Structure](https://guide.cronus.support/gpc/basic-gpc-structure-with-gpc-scripting) [A Simple Tutorial](https://guide.cronus.support/gpc/a-simple-tutorial) [Variables](https://guide.cronus.support/gpc/gpc-scripting-variables) [Definitions](https://guide.cronus.support/gpc/gpc-scripting-definitions) [Data Section](https://guide.cronus.support/gpc/data-section) [Remapping](https://guide.cronus.support/gpc/remapping) [Const Arrays](https://guide.cronus.support/gpc/gpc-scripting-const-arrays) [Init Section](https://guide.cronus.support/gpc/gpc-scripting-init-section) [Main Section](https://guide.cronus.support/gpc/gpc-scripting-main-section) [Combo Section](https://guide.cronus.support/gpc/gpc-scripting-combo-section) [User Created Functions](https://guide.cronus.support/gpc/gpc-scripting-user-created-functions) [Identifiers](https://guide.cronus.support/gpc/identifiers) [Flow Control](https://guide.cronus.support/gpc/flow-control) [Operator Types](https://guide.cronus.support/gpc/operator-types) [Constants](https://guide.cronus.support/gpc/gpc-scripting-constants) [Functions](https://guide.cronus.support/gpc/gpc-scripting-functions) [Device Functions](https://guide.cronus.support/gpc/gpc-scripting-device-functions) [Remapping](https://guide.cronus.support/gpc/gpc-scripting-remapping) [Advanced Samples](https://guide.cronus.support/gpc/gpc-scripting-advanced-samples) [API Samples](https://guide.cronus.support/gpc/gpc-scripting-api-samples) [Docs powered by Archbee](https://www.archbee.com/?utm_campaign=hosted-docs&utm_medium=referral&utm_source=guide.cronus.support) GPC Developer Guides Constants Trace ===== we updated trace which trace 1 , trace 2 , trace 3 are 32bit , trace 4 , trace 5 & trace 6 are 16 bit trace description range trace 1 32 bit trace 2 32 bit trace 3 32 bit trace 4 16 bit trace 5 16 bit trace 6 16 bit here is an example, of trace 2 32 bit gpc const int depracted\\\[\] = {4444, 5555} const uint16 test\\\[\] = {44444, 55555} const int32 test2\\\[\] = {444444, 555555} const int8 test3\\\[\] = {44, 55} const uint8 test4\\\[\] = {44, 55} const uint16 test5\\\[\]\\\[\] = { { 44444, 55555}, { 56666, 57777}, { 60000, 65535} } const int32 test6\\\[\]\\\[\] = { { 4444444, 555555}, { 6666666, 777777}, { 8888888, 999999} } main { // in 32bit mode, trace 1, 2 and 3 are 32bit, trace 4,5, 6 are 16bit set val(trace 2, 0xffffffff) if (get ptime(xb1 a) < 6666666) { combo run(test combo); } } combo test combo { set val(xb1 rt,100) wait(9999999); } example using trace 1 thru trace 6 gpc int a = 0xf0; int b = 0x11; int menu = 1; int c = 0x7fffffff; int d = 0xffffffff; main { set val(trace 1, c) set val(trace 2, d) set val(trace 3, a & b) set val(trace 4, a ^ b) set val(trace 5, a | b) set val(trace 6, a << 2) // set val(trace 6, a >> 2) // set val(trace 6, get ps4 lbar(ds4 blue)) if (get ps4 lbar(ps4 blue) > 0x20) { set val(ps4 cross,100); } if (get keyboard(key a) || get modifiers(mod lctrl)) { combo run(rumble); } if (get ival(ps4 cross)) { if (menu) block all inputs(); } } combo rumble { set rumble(rumble a, 40) reset rumble(); } what are traces and what do they do? traces are boxes of information commonly used to debug a gpc, get the information you may want from a game or get information from mods that may be running, and more when in zen studio simply click tools > device monitor or press the shortcut f3 on your keyboard this will bring up device monitor where traces can be seen on the bottom right of the device monitor here is where information will be displayed depending on how you have traces set in a gpc script the example below is an example of using a trace to verify if a combo is running when the combo is running the value of trace 1 is 1 and when the mod is off the value of trace 1 is 0 16bit example gpc main { set val(trace 1,combo running(rapidfire)); if(get ival(xb1 rt)){ combo run(rapidfire); } } combo rapidfire{ set val(xb1 rt,100); wait(40); set val(xb1 rt,0); wait(30); } in the gif below we can see that the value of trace 1 is going quickly between 1 and 0 due to the nature of the combo being re run while the right trigger is being held this is normal and what to look for when using a trace to verify the combo is running when the right trigger is not held the right trigger has a value of 0 and thus the value of the trace is 0 and with this information, we can determine the combo is running when it should be 32bit example gpc int ouput strength; main { set val(trace 1,ouput strength); ouput strength = get polar(polar rs,polar radius) 1000; if(get val(xb1 lt)){ if(abs(get ival(xb1 rx) < 20 && abs(get ival(xb1 rx)) < 20)) { set val(xb1 ry,20); } if(abs(get ival(xb1 rx) < 20 && abs(get ival(xb1 rx)) >= 20)) { set val(polar ry, ouput strength / 1000); } } } in this example is code of a basic dynamic anti recoil which takes advantage of the higher value limits of 32bit to scale a value up then back down to be accepted as a value to be used with a polar constant for a much greater degree of accuracy the value being traced is the radius of the right stick scaled up higher before being scaled back as the right stick is moved the value of the trace changes accordingly [PREVIOUS\ \ DF Pro](https://guide.cronus.support/gpc/gpc-scripting-df-pro-identifiers "DF Pro") [NEXT\ \ Memory](https://guide.cronus.support/gpc/gpc-scripting-memory-constants "Memory") [Docs powered by Archbee](https://www.archbee.com/?utm_campaign=hosted-docs&utm_medium=referral&utm_source=guide.cronus.support) [Docs powered by Archbee](https://www.archbee.com/?utm_campaign=hosted-docs&utm_medium=referral&utm_source=guide.cronus.support) --- # GPC Scripting - Xbox Series X/S Controller Identifiers - GPC Script Guide Navigate through spaces K [👋GPC: An Introduction](https://guide.cronus.support/gpc) [🚀New 32-bit Updates](https://guide.cronus.support/gpc/new-32bit-updates) 📑GPC Developer Guides [Basic Syntax](https://guide.cronus.support/gpc/basic-syntax) [Basic GPC Structure](https://guide.cronus.support/gpc/basic-gpc-structure-with-gpc-scripting) [A Simple Tutorial](https://guide.cronus.support/gpc/a-simple-tutorial) [Variables](https://guide.cronus.support/gpc/gpc-scripting-variables) [Definitions](https://guide.cronus.support/gpc/gpc-scripting-definitions) [Data Section](https://guide.cronus.support/gpc/data-section) [Remapping](https://guide.cronus.support/gpc/remapping) [Const Arrays](https://guide.cronus.support/gpc/gpc-scripting-const-arrays) [Init Section](https://guide.cronus.support/gpc/gpc-scripting-init-section) [Main Section](https://guide.cronus.support/gpc/gpc-scripting-main-section) [Combo Section](https://guide.cronus.support/gpc/gpc-scripting-combo-section) [User Created Functions](https://guide.cronus.support/gpc/gpc-scripting-user-created-functions) [Identifiers](https://guide.cronus.support/gpc/identifiers) [Flow Control](https://guide.cronus.support/gpc/flow-control) [Operator Types](https://guide.cronus.support/gpc/operator-types) [Constants](https://guide.cronus.support/gpc/gpc-scripting-constants) [Functions](https://guide.cronus.support/gpc/gpc-scripting-functions) [Device Functions](https://guide.cronus.support/gpc/gpc-scripting-device-functions) [Remapping](https://guide.cronus.support/gpc/gpc-scripting-remapping) [Advanced Samples](https://guide.cronus.support/gpc/gpc-scripting-advanced-samples) [API Samples](https://guide.cronus.support/gpc/gpc-scripting-api-samples) [Docs powered by Archbee](https://www.archbee.com/?utm_campaign=hosted-docs&utm_medium=referral&utm_source=guide.cronus.support) GPC Developer Guides ... Controller Xbox Series X/S =============== this is a list of all xbox series x/s input identifiers, values, and ranges these also work for the xbox one controller name description value range xb1 xbox xbox/guide button 0 0 | 100 xb1 guide xbox/guide button 0 0 | 100 xb1 view view button (left of xbox button) 1 0 | 100 xb1 menu menu button (right of xbox button) 2 0 | 100 xb1 rb right bumper 3 0 | 100 xb1 rt right trigger 4 0 100 xb1 rs right stick (click) 5 0 | 100 xb1 lb left bumper 6 0 | 100 xb1 lt left trigger 7 0 100 xb1 ls left stick (click) 8 0 | 100 xb1 rx right stick x axis (left/right) 9 100 100 xb1 ry right stick y axis (up/down) 10 100 100 xb1 lx left stick x axis (left/right) 11 100 100 xb1 ly left stick y axis (up/down) 12 100 100 xb1 up d pad up button 13 0 | 100 xb1 down d pad down button 14 0 | 100 xb1 left d pad left button 15 0 | 100 xb1 right d pad right button 16 0 | 100 xb1 y y (yellow) button 17 0 | 100 xb1 b b (red) button 18 0 | 100 xb1 a a (green) button 19 0 | 100 xb1 x x (blue) button 20 0 | 100 xb1 share share button (series s|x middle button) 21 0 | 100 xb1 sync wireless sync button (next to usb port) 27 0 | 100 xb1 pr1 xbox elite series upper right paddle (p1) 34 0 | 100 xb1 pr2 xbox elite series lower right paddle (p2) 35 0 | 100 xb1 pl1 xbox elite series upper left paddle (p3) 36 0 | 100 xb1 pl2 xbox elite series lower left paddle (p4) 37 0 | 100 paddle identifiers will only work with the xbox elite v1 (1698) the elite s2 will only work if the controller firmware is 4 8 xxx 0 anything above that and the paddles can only be mapped using the default xbox software value range explanation range meaning 0 | 100 either 0 or 100 0 100 any value between 0 and 100 100 100 any value between 100 and 100 [PREVIOUS\ \ PlayStation 3](https://guide.cronus.support/gpc/gpc-scripting-ps3-identifiers "PlayStation 3") [NEXT\ \ Xbox One](https://guide.cronus.support/gpc/xbox-one "Xbox One") [Docs powered by Archbee](https://www.archbee.com/?utm_campaign=hosted-docs&utm_medium=referral&utm_source=guide.cronus.support) [Docs powered by Archbee](https://www.archbee.com/?utm_campaign=hosted-docs&utm_medium=referral&utm_source=guide.cronus.support) --- # Data Section - GPC Script Guide Navigate through spaces K [👋GPC: An Introduction](https://guide.cronus.support/gpc) [🚀New 32-bit Updates](https://guide.cronus.support/gpc/new-32bit-updates) 📑GPC Developer Guides [Basic Syntax](https://guide.cronus.support/gpc/basic-syntax) [Basic GPC Structure](https://guide.cronus.support/gpc/basic-gpc-structure-with-gpc-scripting) [A Simple Tutorial](https://guide.cronus.support/gpc/a-simple-tutorial) [Variables](https://guide.cronus.support/gpc/gpc-scripting-variables) [Definitions](https://guide.cronus.support/gpc/gpc-scripting-definitions) [Data Section](https://guide.cronus.support/gpc/data-section) [Remapping](https://guide.cronus.support/gpc/remapping) [Const Arrays](https://guide.cronus.support/gpc/gpc-scripting-const-arrays) [Init Section](https://guide.cronus.support/gpc/gpc-scripting-init-section) [Main Section](https://guide.cronus.support/gpc/gpc-scripting-main-section) [Combo Section](https://guide.cronus.support/gpc/gpc-scripting-combo-section) [User Created Functions](https://guide.cronus.support/gpc/gpc-scripting-user-created-functions) [Identifiers](https://guide.cronus.support/gpc/identifiers) [Flow Control](https://guide.cronus.support/gpc/flow-control) [Operator Types](https://guide.cronus.support/gpc/operator-types) [Constants](https://guide.cronus.support/gpc/gpc-scripting-constants) [Functions](https://guide.cronus.support/gpc/gpc-scripting-functions) [Device Functions](https://guide.cronus.support/gpc/gpc-scripting-device-functions) [Remapping](https://guide.cronus.support/gpc/gpc-scripting-remapping) [Advanced Samples](https://guide.cronus.support/gpc/gpc-scripting-advanced-samples) [API Samples](https://guide.cronus.support/gpc/gpc-scripting-api-samples) [Docs powered by Archbee](https://www.archbee.com/?utm_campaign=hosted-docs&utm_medium=referral&utm_source=guide.cronus.support) GPC Developer Guides Data Section ============ 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 of the data section is to store static information and its size of it is determined by the values within it the static values can be accessed in a gpc script through the use of an indexer you can use definitions in a data section as well if you like as shown in the example below gpc 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 = duint8(3); //a will have a value of 255 b = dint8(3); //b will have a value of 1 c = dint16(3); //c will have a value of 511 } functions the values placed within the data section are expressed in bytes (8 bit 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 you may put in a larger number into the data section as well, however they will cause the values coming after it to have an index of +1 for 16 bit ranged values and +3 for 32 bit ranged values a warning will be shown when you do this there are multiple functions to retrieve data of different ranges, the below table explains each of the functions they all have the same syntax gpc function(index) function name minimum value maximum value bytes read dint8 128 127 1 duint8 0 255 1 dint16 32 768 32 767 2 duint16 0 65 536 2 dint32 2 147 483 648 2 147 483 647 4 [PREVIOUS\ \ Definitions](https://guide.cronus.support/gpc/gpc-scripting-definitions "Definitions") [NEXT\ \ Remapping](https://guide.cronus.support/gpc/remapping "Remapping") [Docs powered by Archbee](https://www.archbee.com/?utm_campaign=hosted-docs&utm_medium=referral&utm_source=guide.cronus.support) [Docs powered by Archbee](https://www.archbee.com/?utm_campaign=hosted-docs&utm_medium=referral&utm_source=guide.cronus.support) --- # GPC Scripting - Console Functions - GPC Script Guide Navigate through spaces K [👋GPC: An Introduction](https://guide.cronus.support/gpc) [🚀New 32-bit Updates](https://guide.cronus.support/gpc/new-32bit-updates) 📑GPC Developer Guides [Basic Syntax](https://guide.cronus.support/gpc/basic-syntax) [Basic GPC Structure](https://guide.cronus.support/gpc/basic-gpc-structure-with-gpc-scripting) [A Simple Tutorial](https://guide.cronus.support/gpc/a-simple-tutorial) [Variables](https://guide.cronus.support/gpc/gpc-scripting-variables) [Definitions](https://guide.cronus.support/gpc/gpc-scripting-definitions) [Data Section](https://guide.cronus.support/gpc/data-section) [Remapping](https://guide.cronus.support/gpc/remapping) [Const Arrays](https://guide.cronus.support/gpc/gpc-scripting-const-arrays) [Init Section](https://guide.cronus.support/gpc/gpc-scripting-init-section) [Main Section](https://guide.cronus.support/gpc/gpc-scripting-main-section) [Combo Section](https://guide.cronus.support/gpc/gpc-scripting-combo-section) [User Created Functions](https://guide.cronus.support/gpc/gpc-scripting-user-created-functions) [Identifiers](https://guide.cronus.support/gpc/identifiers) [Flow Control](https://guide.cronus.support/gpc/flow-control) [Operator Types](https://guide.cronus.support/gpc/operator-types) [Constants](https://guide.cronus.support/gpc/gpc-scripting-constants) [Functions](https://guide.cronus.support/gpc/gpc-scripting-functions) [Device Functions](https://guide.cronus.support/gpc/gpc-scripting-device-functions) [Remapping](https://guide.cronus.support/gpc/gpc-scripting-remapping) [Advanced Samples](https://guide.cronus.support/gpc/gpc-scripting-advanced-samples) [API Samples](https://guide.cronus.support/gpc/gpc-scripting-api-samples) [Docs powered by Archbee](https://www.archbee.com/?utm_campaign=hosted-docs&utm_medium=referral&utm_source=guide.cronus.support) GPC Developer Guides Functions Console Functions ================= here is the list of the console functions core console functions function name description get console gets which console is currently connected set val sets the output value to send to the console block all inputs blocks all output from being sent to the console this cycle of main ps4 authtimeout check if ps4 authentication is timed out output reconnection check the output if reconnected output protocol sets output protocol get led returns the current state of a specified led get rumble returns the current value of a rumble motor console functions for core console functions can be found here docid\\ wvb2 qghsaqjugxchqsvv [PREVIOUS\ \ OLED Display Functions](https://guide.cronus.support/gpc/gpc-scripting-oled-display-functions "OLED Display Functions") [NEXT\ \ Core Console Functions](https://guide.cronus.support/gpc/gpc-scripting-core-console-functions "Core Console Functions") [Docs powered by Archbee](https://www.archbee.com/?utm_campaign=hosted-docs&utm_medium=referral&utm_source=guide.cronus.support) [Docs powered by Archbee](https://www.archbee.com/?utm_campaign=hosted-docs&utm_medium=referral&utm_source=guide.cronus.support) --- # GPC Scripting - Core Keyboard Functions - GPC Script Guide Navigate through spaces K [👋GPC: An Introduction](https://guide.cronus.support/gpc) [🚀New 32-bit Updates](https://guide.cronus.support/gpc/new-32bit-updates) 📑GPC Developer Guides [Basic Syntax](https://guide.cronus.support/gpc/basic-syntax) [Basic GPC Structure](https://guide.cronus.support/gpc/basic-gpc-structure-with-gpc-scripting) [A Simple Tutorial](https://guide.cronus.support/gpc/a-simple-tutorial) [Variables](https://guide.cronus.support/gpc/gpc-scripting-variables) [Definitions](https://guide.cronus.support/gpc/gpc-scripting-definitions) [Data Section](https://guide.cronus.support/gpc/data-section) [Remapping](https://guide.cronus.support/gpc/remapping) [Const Arrays](https://guide.cronus.support/gpc/gpc-scripting-const-arrays) [Init Section](https://guide.cronus.support/gpc/gpc-scripting-init-section) [Main Section](https://guide.cronus.support/gpc/gpc-scripting-main-section) [Combo Section](https://guide.cronus.support/gpc/gpc-scripting-combo-section) [User Created Functions](https://guide.cronus.support/gpc/gpc-scripting-user-created-functions) [Identifiers](https://guide.cronus.support/gpc/identifiers) [Flow Control](https://guide.cronus.support/gpc/flow-control) [Operator Types](https://guide.cronus.support/gpc/operator-types) [Constants](https://guide.cronus.support/gpc/gpc-scripting-constants) [Functions](https://guide.cronus.support/gpc/gpc-scripting-functions) [Device Functions](https://guide.cronus.support/gpc/gpc-scripting-device-functions) [Remapping](https://guide.cronus.support/gpc/gpc-scripting-remapping) [Advanced Samples](https://guide.cronus.support/gpc/gpc-scripting-advanced-samples) [API Samples](https://guide.cronus.support/gpc/gpc-scripting-api-samples) [Docs powered by Archbee](https://www.archbee.com/?utm_campaign=hosted-docs&utm_medium=referral&utm_source=guide.cronus.support) GPC Developer Guides ... Keyboard Functions Core Keyboard Functions ======================= function description get keyboard checks if a chosen keyboard key is held down get modifiers checks if a chosen keyboard modifier is held down (alt, shift, ctrl, etc ) get keyboard get keyboard checks to see if a chosen keyboard key is pressed gpc main { if(get keyboard(key a)){ combo run(jump); } } combo jump { wait(20); set val(xb1 a, 100); wait(20); } 🔴 syntax get keyboard( \\ ); ⚪ parameters \\ any defined keyboard constant 🔵 returns nothing get modifiers get modifiers checks if a chosen keyboard modifier is held down (alt, shift, ctrl, etc ) gpc if (get modifiers(mod lctrl | mod lalt) == mod lctrl | mod lalt) { / both left alt and left ctrl are pressed / } 🔴 syntax get modifiers( \\ , \\ ); ⚪ parameters \\ any defined variable \\ index point of the bit to if held 🔵 returns nothing [PREVIOUS\ \ Keyboard Functions](https://guide.cronus.support/gpc/gpc-scripting-keyboard-functions "Keyboard Functions") [NEXT\ \ Device Functions](https://guide.cronus.support/gpc/device-functions "Device Functions") [Docs powered by Archbee](https://www.archbee.com/?utm_campaign=hosted-docs&utm_medium=referral&utm_source=guide.cronus.support) [Docs powered by Archbee](https://www.archbee.com/?utm_campaign=hosted-docs&utm_medium=referral&utm_source=guide.cronus.support) --- # GPC Scripting - LED Constants - GPC Script Guide Navigate through spaces K [👋GPC: An Introduction](https://guide.cronus.support/gpc) [🚀New 32-bit Updates](https://guide.cronus.support/gpc/new-32bit-updates) 📑GPC Developer Guides [Basic Syntax](https://guide.cronus.support/gpc/basic-syntax) [Basic GPC Structure](https://guide.cronus.support/gpc/basic-gpc-structure-with-gpc-scripting) [A Simple Tutorial](https://guide.cronus.support/gpc/a-simple-tutorial) [Variables](https://guide.cronus.support/gpc/gpc-scripting-variables) [Definitions](https://guide.cronus.support/gpc/gpc-scripting-definitions) [Data Section](https://guide.cronus.support/gpc/data-section) [Remapping](https://guide.cronus.support/gpc/remapping) [Const Arrays](https://guide.cronus.support/gpc/gpc-scripting-const-arrays) [Init Section](https://guide.cronus.support/gpc/gpc-scripting-init-section) [Main Section](https://guide.cronus.support/gpc/gpc-scripting-main-section) [Combo Section](https://guide.cronus.support/gpc/gpc-scripting-combo-section) [User Created Functions](https://guide.cronus.support/gpc/gpc-scripting-user-created-functions) [Identifiers](https://guide.cronus.support/gpc/identifiers) [Flow Control](https://guide.cronus.support/gpc/flow-control) [Operator Types](https://guide.cronus.support/gpc/operator-types) [Constants](https://guide.cronus.support/gpc/gpc-scripting-constants) [Functions](https://guide.cronus.support/gpc/gpc-scripting-functions) [Device Functions](https://guide.cronus.support/gpc/gpc-scripting-device-functions) [Remapping](https://guide.cronus.support/gpc/gpc-scripting-remapping) [Advanced Samples](https://guide.cronus.support/gpc/gpc-scripting-advanced-samples) [API Samples](https://guide.cronus.support/gpc/gpc-scripting-api-samples) [Docs powered by Archbee](https://www.archbee.com/?utm_campaign=hosted-docs&utm_medium=referral&utm_source=guide.cronus.support) GPC Developer Guides ... Controller LED === the below table outlines all of the led which is defined, with value and what character they represent name description value led none set ledx identifier used to turn off all blinks 1 led 1 get/set led/x identifier for player 1/upper left quadrant 0 led 2 get/set led/x identifier for player 2/upper right quadrant 1 led 3 get/set led/x identifier for player 3//lower left quadrant 2 led 4 get/set led/x identifier for player 4/lower right quadrant 3 ps4 red get ps4 lbar identifier for the red color coming from the console 1 ps4 green get ps4 lbar identifier for the green color coming from the console 2 ps4 blue get ps4 lbar identifier for the blue color coming from the console 0 ds4 red get ps4 lbar identifier for the red color currently being sent to the controller 5 ds4 green get ps4 lbar identifier for the green color currently being sent to the controller 6 ds4 blue get ps4 lbar identifier for the blue color currently being sent to the controller 4 [PREVIOUS\ \ Polar](https://guide.cronus.support/gpc/gpc-scripting-polar-constants "Polar") [NEXT\ \ Rumble](https://guide.cronus.support/gpc/gpc-scripting-rumble-constants "Rumble") [Docs powered by Archbee](https://www.archbee.com/?utm_campaign=hosted-docs&utm_medium=referral&utm_source=guide.cronus.support) [Docs powered by Archbee](https://www.archbee.com/?utm_campaign=hosted-docs&utm_medium=referral&utm_source=guide.cronus.support) --- # A Simple Tutorial - GPC Script Guide Navigate through spaces K [👋GPC: An Introduction](https://guide.cronus.support/gpc) [🚀New 32-bit Updates](https://guide.cronus.support/gpc/new-32bit-updates) 📑GPC Developer Guides [Basic Syntax](https://guide.cronus.support/gpc/basic-syntax) [Basic GPC Structure](https://guide.cronus.support/gpc/basic-gpc-structure-with-gpc-scripting) [A Simple Tutorial](https://guide.cronus.support/gpc/a-simple-tutorial) [Variables](https://guide.cronus.support/gpc/gpc-scripting-variables) [Definitions](https://guide.cronus.support/gpc/gpc-scripting-definitions) [Data Section](https://guide.cronus.support/gpc/data-section) [Remapping](https://guide.cronus.support/gpc/remapping) [Const Arrays](https://guide.cronus.support/gpc/gpc-scripting-const-arrays) [Init Section](https://guide.cronus.support/gpc/gpc-scripting-init-section) [Main Section](https://guide.cronus.support/gpc/gpc-scripting-main-section) [Combo Section](https://guide.cronus.support/gpc/gpc-scripting-combo-section) [User Created Functions](https://guide.cronus.support/gpc/gpc-scripting-user-created-functions) [Identifiers](https://guide.cronus.support/gpc/identifiers) [Flow Control](https://guide.cronus.support/gpc/flow-control) [Operator Types](https://guide.cronus.support/gpc/operator-types) [Constants](https://guide.cronus.support/gpc/gpc-scripting-constants) [Functions](https://guide.cronus.support/gpc/gpc-scripting-functions) [Device Functions](https://guide.cronus.support/gpc/gpc-scripting-device-functions) [Remapping](https://guide.cronus.support/gpc/gpc-scripting-remapping) [Advanced Samples](https://guide.cronus.support/gpc/gpc-scripting-advanced-samples) [API Samples](https://guide.cronus.support/gpc/gpc-scripting-api-samples) [Docs powered by Archbee](https://www.archbee.com/?utm_campaign=hosted-docs&utm_medium=referral&utm_source=guide.cronus.support) GPC Developer Guides A Simple Tutorial ================= step 1 load zen studio and click file > new > empty file step 2 copy and paste the following code into the gpc code editor within zen studio gpc 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); } 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 the output window below the gpc editor should give you this message; gpc 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%) 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 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 analyze 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 the main section gpc main{ if(get val(xb1 rt)){ combo run(rapid fire); } } as explained here , 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 gpc if (get val(xb1 rt)) 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 gpc { combo run(rapid fire); } 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 gpc combo run(rapid fire); 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 the combo section gpc combo rapid fire{ set val(xb1 rt, 100); wait(40); set val(xb1 rt, 0); wait(30); set val(xb1 rt, 0); } this is the combo that 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 gpc set val(xb1 rt, 100); wait(40); these lines instruct the combo to set the value of the right trigger to 100 (or fully pressed) for 40 milliseconds gpc set val(xb1 rt, 0); wait(30); 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 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 gpc if(get val(xb1 rt)){ and change it to gpc if(get val(xb1 rt) && !get val(xb1 lt)){ by introducing && !get val(xb1 lt) into 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 this 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 [PREVIOUS\ \ Basic GPC Structure](https://guide.cronus.support/gpc/basic-gpc-structure-with-gpc-scripting "Basic GPC Structure") [NEXT\ \ Variables](https://guide.cronus.support/gpc/gpc-scripting-variables "Variables") [Docs powered by Archbee](https://www.archbee.com/?utm_campaign=hosted-docs&utm_medium=referral&utm_source=guide.cronus.support) [Docs powered by Archbee](https://www.archbee.com/?utm_campaign=hosted-docs&utm_medium=referral&utm_source=guide.cronus.support) --- # GPC Scripting - G29 Identifiers - GPC Script Guide Navigate through spaces K [👋GPC: An Introduction](https://guide.cronus.support/gpc) [🚀New 32-bit Updates](https://guide.cronus.support/gpc/new-32bit-updates) 📑GPC Developer Guides [Basic Syntax](https://guide.cronus.support/gpc/basic-syntax) [Basic GPC Structure](https://guide.cronus.support/gpc/basic-gpc-structure-with-gpc-scripting) [A Simple Tutorial](https://guide.cronus.support/gpc/a-simple-tutorial) [Variables](https://guide.cronus.support/gpc/gpc-scripting-variables) [Definitions](https://guide.cronus.support/gpc/gpc-scripting-definitions) [Data Section](https://guide.cronus.support/gpc/data-section) [Remapping](https://guide.cronus.support/gpc/remapping) [Const Arrays](https://guide.cronus.support/gpc/gpc-scripting-const-arrays) [Init Section](https://guide.cronus.support/gpc/gpc-scripting-init-section) [Main Section](https://guide.cronus.support/gpc/gpc-scripting-main-section) [Combo Section](https://guide.cronus.support/gpc/gpc-scripting-combo-section) [User Created Functions](https://guide.cronus.support/gpc/gpc-scripting-user-created-functions) [Identifiers](https://guide.cronus.support/gpc/identifiers) [Flow Control](https://guide.cronus.support/gpc/flow-control) [Operator Types](https://guide.cronus.support/gpc/operator-types) [Constants](https://guide.cronus.support/gpc/gpc-scripting-constants) [Functions](https://guide.cronus.support/gpc/gpc-scripting-functions) [Device Functions](https://guide.cronus.support/gpc/gpc-scripting-device-functions) [Remapping](https://guide.cronus.support/gpc/gpc-scripting-remapping) [Advanced Samples](https://guide.cronus.support/gpc/gpc-scripting-advanced-samples) [API Samples](https://guide.cronus.support/gpc/gpc-scripting-api-samples) [Docs powered by Archbee](https://www.archbee.com/?utm_campaign=hosted-docs&utm_medium=referral&utm_source=guide.cronus.support) GPC Developer Guides ... Racing Wheel G29 === the below table outlines all of the g29 identifiers which are defined, with value 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 value range explanation range meaning 0 | 100 either 0 or 100 0 100 any value between 0 and 100 100 100 any value between 100 and 100 [PREVIOUS\ \ Racing Wheel](https://guide.cronus.support/gpc/gpc-scripting-racing-wheel-constants "Racing Wheel") [NEXT\ \ G27](https://guide.cronus.support/gpc/gpc-scripting-g27-identifiers "G27") [Docs powered by Archbee](https://www.archbee.com/?utm_campaign=hosted-docs&utm_medium=referral&utm_source=guide.cronus.support) [Docs powered by Archbee](https://www.archbee.com/?utm_campaign=hosted-docs&utm_medium=referral&utm_source=guide.cronus.support) --- # GPC Scripting - Controller Constants - GPC Script Guide Navigate through spaces K [👋GPC: An Introduction](https://guide.cronus.support/gpc) [🚀New 32-bit Updates](https://guide.cronus.support/gpc/new-32bit-updates) 📑GPC Developer Guides [Basic Syntax](https://guide.cronus.support/gpc/basic-syntax) [Basic GPC Structure](https://guide.cronus.support/gpc/basic-gpc-structure-with-gpc-scripting) [A Simple Tutorial](https://guide.cronus.support/gpc/a-simple-tutorial) [Variables](https://guide.cronus.support/gpc/gpc-scripting-variables) [Definitions](https://guide.cronus.support/gpc/gpc-scripting-definitions) [Data Section](https://guide.cronus.support/gpc/data-section) [Remapping](https://guide.cronus.support/gpc/remapping) [Const Arrays](https://guide.cronus.support/gpc/gpc-scripting-const-arrays) [Init Section](https://guide.cronus.support/gpc/gpc-scripting-init-section) [Main Section](https://guide.cronus.support/gpc/gpc-scripting-main-section) [Combo Section](https://guide.cronus.support/gpc/gpc-scripting-combo-section) [User Created Functions](https://guide.cronus.support/gpc/gpc-scripting-user-created-functions) [Identifiers](https://guide.cronus.support/gpc/identifiers) [Flow Control](https://guide.cronus.support/gpc/flow-control) [Operator Types](https://guide.cronus.support/gpc/operator-types) [Constants](https://guide.cronus.support/gpc/gpc-scripting-constants) [Functions](https://guide.cronus.support/gpc/gpc-scripting-functions) [Device Functions](https://guide.cronus.support/gpc/gpc-scripting-device-functions) [Remapping](https://guide.cronus.support/gpc/gpc-scripting-remapping) [Advanced Samples](https://guide.cronus.support/gpc/gpc-scripting-advanced-samples) [API Samples](https://guide.cronus.support/gpc/gpc-scripting-api-samples) [Docs powered by Archbee](https://www.archbee.com/?utm_campaign=hosted-docs&utm_medium=referral&utm_source=guide.cronus.support) GPC Developer Guides Constants Controller ========== these are the different categories of controller constants docid\\ jdplommcuzukudlsmc9t6 docid\\ a jkghocbbs9nrw34b5i docid\\ qbln5mjgb7 ofwzjzmzhj docid\\ qjahnympio3kkxz 4wre6 docid\\ il3j ofhdumq4q3xlyct0 docid\\ ouwtuqeewk9eyis t4pl docid\\ iy5yxuud30km4b3z6p6y6 docid\\ k2d2z1b fe6z1gglw3wr2 docid\\ kmbxxdfthkqttjcx0el9s docid\\ mmg5rixiupbnzn tnmz p [PREVIOUS\ \ Keyboard](https://guide.cronus.support/gpc/gpc-scripting-keyboard-constants "Keyboard") [NEXT\ \ Polar](https://guide.cronus.support/gpc/gpc-scripting-polar-constants "Polar") [Docs powered by Archbee](https://www.archbee.com/?utm_campaign=hosted-docs&utm_medium=referral&utm_source=guide.cronus.support) [Docs powered by Archbee](https://www.archbee.com/?utm_campaign=hosted-docs&utm_medium=referral&utm_source=guide.cronus.support) --- # GPC Scripting - Nintendo WII Identifiers - GPC Script Guide Navigate through spaces K [👋GPC: An Introduction](https://guide.cronus.support/gpc) [🚀New 32-bit Updates](https://guide.cronus.support/gpc/new-32bit-updates) 📑GPC Developer Guides [Basic Syntax](https://guide.cronus.support/gpc/basic-syntax) [Basic GPC Structure](https://guide.cronus.support/gpc/basic-gpc-structure-with-gpc-scripting) [A Simple Tutorial](https://guide.cronus.support/gpc/a-simple-tutorial) [Variables](https://guide.cronus.support/gpc/gpc-scripting-variables) [Definitions](https://guide.cronus.support/gpc/gpc-scripting-definitions) [Data Section](https://guide.cronus.support/gpc/data-section) [Remapping](https://guide.cronus.support/gpc/remapping) [Const Arrays](https://guide.cronus.support/gpc/gpc-scripting-const-arrays) [Init Section](https://guide.cronus.support/gpc/gpc-scripting-init-section) [Main Section](https://guide.cronus.support/gpc/gpc-scripting-main-section) [Combo Section](https://guide.cronus.support/gpc/gpc-scripting-combo-section) [User Created Functions](https://guide.cronus.support/gpc/gpc-scripting-user-created-functions) [Identifiers](https://guide.cronus.support/gpc/identifiers) [Flow Control](https://guide.cronus.support/gpc/flow-control) [Operator Types](https://guide.cronus.support/gpc/operator-types) [Constants](https://guide.cronus.support/gpc/gpc-scripting-constants) [Functions](https://guide.cronus.support/gpc/gpc-scripting-functions) [Device Functions](https://guide.cronus.support/gpc/gpc-scripting-device-functions) [Remapping](https://guide.cronus.support/gpc/gpc-scripting-remapping) [Advanced Samples](https://guide.cronus.support/gpc/gpc-scripting-advanced-samples) [API Samples](https://guide.cronus.support/gpc/gpc-scripting-api-samples) [Docs powered by Archbee](https://www.archbee.com/?utm_campaign=hosted-docs&utm_medium=referral&utm_source=guide.cronus.support) GPC Developer Guides ... Controller Nintendo WII ============ this is a list of all nintendo wii input identifiers, values, and ranges name value range 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 value range explanation range meaning 0 | 100 either 0 or 100 0 100 any value between 0 and 100 100 100 any value between 100 and 100 note for accelerometers, every 25% represents 1g [PREVIOUS\ \ Nintendo Switch](https://guide.cronus.support/gpc/gpc-scripting-nintendo-switch-identifiers "Nintendo Switch") [NEXT\ \ Racing Wheel](https://guide.cronus.support/gpc/gpc-scripting-racing-wheel-constants "Racing Wheel") [Docs powered by Archbee](https://www.archbee.com/?utm_campaign=hosted-docs&utm_medium=referral&utm_source=guide.cronus.support) [Docs powered by Archbee](https://www.archbee.com/?utm_campaign=hosted-docs&utm_medium=referral&utm_source=guide.cronus.support) --- # GPC Scripting - Core Console Functions - GPC Script Guide Navigate through spaces K [👋GPC: An Introduction](https://guide.cronus.support/gpc) [🚀New 32-bit Updates](https://guide.cronus.support/gpc/new-32bit-updates) 📑GPC Developer Guides [Basic Syntax](https://guide.cronus.support/gpc/basic-syntax) [Basic GPC Structure](https://guide.cronus.support/gpc/basic-gpc-structure-with-gpc-scripting) [A Simple Tutorial](https://guide.cronus.support/gpc/a-simple-tutorial) [Variables](https://guide.cronus.support/gpc/gpc-scripting-variables) [Definitions](https://guide.cronus.support/gpc/gpc-scripting-definitions) [Data Section](https://guide.cronus.support/gpc/data-section) [Remapping](https://guide.cronus.support/gpc/remapping) [Const Arrays](https://guide.cronus.support/gpc/gpc-scripting-const-arrays) [Init Section](https://guide.cronus.support/gpc/gpc-scripting-init-section) [Main Section](https://guide.cronus.support/gpc/gpc-scripting-main-section) [Combo Section](https://guide.cronus.support/gpc/gpc-scripting-combo-section) [User Created Functions](https://guide.cronus.support/gpc/gpc-scripting-user-created-functions) [Identifiers](https://guide.cronus.support/gpc/identifiers) [Flow Control](https://guide.cronus.support/gpc/flow-control) [Operator Types](https://guide.cronus.support/gpc/operator-types) [Constants](https://guide.cronus.support/gpc/gpc-scripting-constants) [Functions](https://guide.cronus.support/gpc/gpc-scripting-functions) [Device Functions](https://guide.cronus.support/gpc/gpc-scripting-device-functions) [Remapping](https://guide.cronus.support/gpc/gpc-scripting-remapping) [Advanced Samples](https://guide.cronus.support/gpc/gpc-scripting-advanced-samples) [API Samples](https://guide.cronus.support/gpc/gpc-scripting-api-samples) [Docs powered by Archbee](https://www.archbee.com/?utm_campaign=hosted-docs&utm_medium=referral&utm_source=guide.cronus.support) GPC Developer Guides ... Console Functions Core Console Functions ====================== function name description get console gets which console is currently connected set val sets the output value to send to the console set polar sets the stick output at a given angle and radius with a high resolution value block all inputs blocks all output from being sent to the console this cycle of main ps4 authtimeout check if ps4 authentication is timed out output reconnection check the output if reconnected output protocol sets output protocol get led returns the current state of a specified led get rumble returns the current value of a rumble motor get console get console gets which console is currently connected gpc main { if(get console() == pio ps4){ // if playstation console detected if(get controller() == pio ps4){ // if playstation controller detected set rgb(0,0,255); // set blue led } else { if(get controller() == pio xb1){ // if xbox controller detected set rgb(0,255,0); // set green led } } } if(get console() == pio xb1){ // if xbox console detected if(get controller() == pio xb1){ // if xbox controller detected set rgb(0,255,0); // set green led } else { if(get controller() == pio ps4){ set rgb(0,0,255); // set blue led } } } } 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 gpc 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) } } 🔴 syntax set val ( \\ ); ⚪ parameters \\ the identifier of a controller entry set polar set polar sets the stick output at a given angle and radius with a high resolution value gpc set polar(polar ls,250, 32000); 🔴 syntax set polar( \\ , \\ , \\ ); ⚪ parameters \\ defined stick \\ index point of the bit to be set with a range of 0 to 359 \\ index point of the bit to be set with a range of 32768 to 32767 🔵 returns nothing block all inputs block all input blocks all output from being sent to the console this cycle of main gpc main { if(get ival(ps4 ps)) { block all inputs(); } } 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 gpc 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); } 🔴 syntax ps4 authtimeout ( ); ⚪ parameters none 🔵 returns the ps4 authentication timeout status this is a decedent count down with 1 being the last value returned before an automatic reconnection is performed by the cronuszen output reconnection output reconnection sets output protocol gpc if(out reconnection()) == pio ps4 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 gpc main { if(get led(led 2) == 1) { // if led 2 is on // do something } } 🔴 syntax get led ( \\ ); ⚪ parameters \\ the identifier of an led 🔵 returns an int ranging from 0 3 which represents the current state 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 gpc main { if(get rumble(rumble a) > 50) { // if rumble motor a is running greater than 50% speed // do something } } 🔴 syntax get rumble ( \\ ); ⚪ parameters \\ the identifier of a rumble motor 🔵 returns an int ranging from 0 255 which represents the current speed of the chosen motor [PREVIOUS\ \ Console Functions](https://guide.cronus.support/gpc/gpc-scripting-console-functions "Console Functions") [NEXT\ \ Controller Functions](https://guide.cronus.support/gpc/gpc-scripting-controller-functions "Controller Functions") [Docs powered by Archbee](https://www.archbee.com/?utm_campaign=hosted-docs&utm_medium=referral&utm_source=guide.cronus.support) [Docs powered by Archbee](https://www.archbee.com/?utm_campaign=hosted-docs&utm_medium=referral&utm_source=guide.cronus.support) ---