Combo Section
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 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.
1
main {
2
if (event_press(XB1_A) {
3
combo_run(mycombo);
4
}
5
if (event_press(XB1_B) {
6
if(combo_running(mycombo)) {
7
combo_stop(mycombo);
8
}
9
}
10
if (event_press(XB1_X) {
11
combo_restart(mycombo);
12
}
13
}
14
15
combo mycombo {
16
set_val(XB1_A, 100);
17
wait(200);
18
wait(4000);
19
set_val(XB1_B, 100);
20
wait(200);
21
wait(4000);
22
set_val(XB1_X, 100);
23
wait(200);
24
wait(4000);
25
set_val(XB1_Y, 100);
26
wait(200);
27
wait(4000);
28
set_val(XB1_LB, 100);
29
wait(200);
30
wait(4000);
31
call(mycombo2);
32
}
33
34
combo mycombo2 {
35
set_val(XB1_RB,100);
36
wait(100);
37
wait(2000);
38
}
Copied!
Last modified 6mo ago
Copy link