---
title: Combo Section
slug: gpc/gpc-scripting-combo-section
description: 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.  
docTags: 
createdAt: 2022-02-05T14:50:02.000Z
---

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 byte-code space.  A combo is ideally suited to set 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 combo name can start with either an underscore ( \_ ) or a letter and can be followed by any combination of letters, digits, or underscores.

:::CodeblockTabs
GPC

```apex
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);
}
```
:::

