Cronus GPC Documentation
Cronus CommunityGPC LibraryGPC Guide
  • Welcome
  • Introduction
    • GPC Explained
    • What's New with Zen?
  • Basic Syntax
  • A Simple Tutorial
  • Style Guide
  • GPC Structure
  • Basic GPC Structure
  • Definitions
  • Data Section
  • Remapping
  • Variables
  • Init Section
  • Main Section
  • Combo Section
  • User Created Functions
  • GPC Programming Basics
  • Constants
    • Zen
      • OLED
      • ASCII Constants
      • PIO
    • Keyboard
      • Keyboard
    • Controller
      • Polar
      • LED
      • Rumble
      • PS3
      • PS4
      • XBox 360
      • Xbox One
      • Nintendo WII
      • Nintendo Switch
    • Racing Wheel
      • G29
      • G27
      • G25
      • DF
      • DF GT
      • DF Pro
    • Trace
    • Memory
    • Misc
  • Flow Control
  • Persistent Memory
  • Operator Types
  • Identifiers
  • Functions & Commands
    • Internal Functions
      • Bit Functions
      • Combo Functions
      • Math Functions
      • Device Functions
      • OLED Display Functions
    • Console Functions
      • Core Console Functions
    • Controller Functions
      • Core Controller Functions
      • Rumble Functions
      • LED Functions
    • Keyboard Functions
      • Core Keyboard Functions
  • GPC Examples
    • #1
Powered by GitBook
On this page

Was this helpful?

Combo Section

PreviousMain SectionNextUser Created Functions

Last updated 4 years ago

Was this helpful?

A combo (short for combination) is a combination of pre-programmed instructions which are executed in sequence. Just like the 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 , a combos name can start with either an underscore ( _ ) or a letter and can be followed by any combination of letters, digits or underscores.

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);
}
main
variables
Combo Functions