---
title: Combo Functions
slug: gpc/gpc-scripting-combo-functions
description: Here is the list of the Combo Functions and Commands.
icon: ◽
docTags: 
createdAt: 2021-12-08T18:02:05.000Z
---

Here is the list of the Combo Functions and Commands.

# Combo Functions and Commands

| Function                | Description                                        |
| ----------------------- | -------------------------------------------------- |
| combo\_run              | Runs a combo.                                      |
| combo\_running          | Checks if a combo is running.                      |
| combo\_stop             | Stops a running combo.                             |
| combo\_restart          | Restarts a running combo.                          |
| combo\_suspend          | Suspends (pauses) a combo.                         |
| combo\_suspended        | Checks if a combo is in the suspended state.       |
| combo\_current\_step    | Gets the current step.                             |
| combo\_step\_time\_left | Gets the time left of the currently executed step. |
| combo\_stop\_all        | Stops all combos.                                  |
| combo\_suspend\_all     | Suspends (pauses) all combos.                      |
| combo\_resume           | Resumes the suspended combo.                       |
| combo\_resume\_all      | Resumes all suspended combos.                      |

# combo\_run

`combo_run` does precisely what the name suggests and runs a combo. However, unlike the **combo\_restart&#x20;**&#x63;ommand, it has no effect if the combo is currently running. It will only start a combo if it is not already running.

:::CodeblockTabs
GPC

```apex
combo_run(MyCombo);
```
:::

🔴 **Syntax**

:::BlockQuote
combo\_run( \<combo\_name> );
:::

⚪ **Parameters**
\<combo\_name> : The name assigned to a combo

🔵 **Returns**

Nothing

# combo\_running

`combo_running` is a function that 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**.

:::CodeblockTabs
GPC

```apex
combo_running(MyCombo);
```
:::

🔴 **Syntax**

:::BlockQuote
combo\_running( \<combo\_name>);
:::

⚪ **Parameters**

\<combo\_name> : The name assigned to a combo

🔵 **Returns**

TRUE if the combo is currently running and FALSE if it is not.

# combo\_stop

`combo_stop` does precisely what the name suggests and will stop a combo if it is running. As with **combo\_run**, it has no effect if the combo is currently not running.

:::CodeblockTabs
GPC

```apex
combo_stop(MyCombo);
```
:::

🔴 **Syntax**

:::BlockQuote
combo\_stop( \<combo\_name> );
:::


​⚪&#x20;**Parameters**

\<combo\_name> : The name assigned to a combo

🔵&#x20;**Returns**

Nothing

# 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.

:::CodeblockTabs
GPC

```apex
combo_restart(MyCombo);
```
:::

🔴 **Syntax**

:::BlockQuote
combo\_restart( \<combo\_name> );
:::

⚪ **Parameters**

\<combo\_name> : The name assigned to a combo

🔵 **Returns**

Nothing

# combo\_suspend

`combo_suspend` command suspends (pauses) a combo from running.

:::CodeblockTabs
GPC

```apex
combo_suspend(MyCombo);
```
:::

🔴 **Syntax**

:::BlockQuote
combo\_suspend( \<combo\_name> );
:::

**⚪ Parameters**

\<combo\_name> : The name assigned to a combo

🔵 **Returns**

Nothing

# combo\_suspended

`combo_suspended` Check to see if a combo is suspended.

:::CodeblockTabs
GPC

```apex
combo_suspended(MyCombo);
```
:::

🔴&#x20;**Syntax**

:::BlockQuote
combo\_suspended( \<combo\_name> );
:::


​⚪&#x20;**Parameters**

\<combo\_name> : Checks the name assigned to a combo if suspended

🔵&#x20;**Returns**

Nothing

combo\_current\_step
====================

`combo_current_step`  keywords returning the current step

:::CodeblockTabs
GPC

```apex
combo_current_step(MyCombo)
```
:::

�&#xDD34;***&#xD;Syntax***

:::BlockQuote
combo\_current\_step ( \<combo\_name> );
:::

​⚪**Parameters**

\<combo\_name> : Checks the name assigned keywords returning the current step

🔵**Returns**

Nothing

# combo\_step\_time\_left

`combo_step_time_left` Checks the time left of the currently executed step

:::CodeblockTabs
GPC

```apex
combo_step_time_left(MyCombos)
```
:::

🔴**Syntax**

:::BlockQuote
combo\_step\_time\_left( \<combo\_name> );
:::

​⚪**Parameters**

\<combo\_name> : Checks the time left of the currently executed step

�&#xDD35;**&#xD;Returns**

Nothing

# combo\_stop\_all

`combo_stop_all` Stops all combos from running.

:::CodeblockTabs
GPC

```apex
combo_stop_all(MyCombos);
```
:::

�&#xDD34;**&#xD;Syntax**

:::BlockQuote
combo\_stop\_all ( \<combo\_name> );
:::


⚪**&#xD;Parameters**

\<combo\_name> : Stops all combos from running.

�&#xDD35;**&#xD;Returns**

Nothing

# combo\_suspend\_all

`combo_suspend_all` Suspends all combos that is running.

:::CodeblockTabs
GPC

```apex
combo_suspend_all(MyCombos);
```
:::

🔴**Syntax**

:::BlockQuote
combo\_suspend\_all ( \<combo\_name> );
:::

⚪**Parameters**

\<combo\_name> : Suspends all combos that is running.

�&#xDD35;**&#xD;Returns**

Nothing

# combo\_resume

`combo_resume` Will resume a combo if it is suspended or a running combo.

:::CodeblockTabs
GPC

```apex
combo_resume(MyCombo);
```
:::

🔴**Syntax**

:::BlockQuote
combo\_resume ( \<combo\_name> );
:::

⚪**Parameters**

\<combo\_name> : resume a combo if it is suspended or a running combo.

�&#xDD35;**&#xD;Returns**

Nothing

# combo\_resume\_all

`combo_resume_all` Will resume all combos if it is suspended or running combos.

:::CodeblockTabs
GPC

```apex
combo_resume_all(MyCombo);
```
:::

�&#xDD34;**&#xD;Syntax**

:::BlockQuote
combo\_resume\_all ( \<combo\_name> );
:::

⚪**&#xD;Parameters**

\<combo\_name> : resume all combos if it is suspended or a running combos.

🔵**Returns**

Nothing

# Combo Specific Commands

# 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 is represented in milliseconds and can rand from 1ms to 32767ms (That's 1 millisecond to just over 32 seconds).&#x20;
The commands executed during the wait time are those placed between the current wait and the previous wait time, the current wait time and the previous call command, or the start of the combo, whichever comes first. As shown in the example below:

:::CodeblockTabs
GPC

```apex
combo MyCombo {
 
    set_val(19, 100);//¯¯|
    set_val(18, 100);//  | These two buttons will be held
    wait(1000);      //←_| for 1000 milliseconds (1 second)
 
    set_val(3, 100);//¯¯|
    set_val(7, 100);//  | These two buttons will be held
    wait(1500);     //←_| for 1500 milliseconds (1.5 seconds)
 
    set_val(9, -100);//¯¯| This axis will be held
    wait(2000);      //←_| for 2000 milliseconds (2 seconds)
 
}
```
:::

:::hint{type="info"}
🔎 **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.&#x20;
:::

:::CodeblockTabs
GPC

```apex
wait(300); // wait 300ms
```
:::

🔴**Syntax**

:::BlockQuote
wait( \<time> );
:::

⚪**Parameters**

\<time> : The length of time the last commands should be executed for represented in milliseconds ranging from 10 to 4000.

🔵**Returns**

Nothing

# call

`call `command can only be used in combos and pauses the current combo to execute the combo called.   Once the combo has finished, the previous combo is resumed. &#x20;

:::CodeblockTabs
GPC

```apex
combo _1st_combo {
 
    set_val(XB1_B, 100);
    wait(100);
    wait(200);
    call(_2nd_combo);   //_1st_combo is paused until _2nd_combo is finished
    set_val(XB1_Y, 100);
    wait(100);
    wait(200);
 
}
 
combo _2nd_combo {
 
    set_val(XB1_RB, 100);
    wait(100);
    wait(200);
 
}   //Once this combo has ended, the combo is was called from can resume
```
:::

&#x20;🔴 **Syntax**

:::BlockQuote
call( \<combo\_name );
:::

⚪ **Parameters**

\<combo\_name> : The name assigned to a combo

🔵 **Returns**

Nothing

