Need Help With Syntax and Array Iteration
Posted: Wed Sep 21, 2022 3:48 pm
Hello,
I have some questions about scripting.
I am wanting to assign a number for each button like
#define 0 = PS4_OPTIONS
#define 1 = PS4_L2
#define 2 = PS4_SQUARE
#define 3 = PS4_R2
#define 4 = PS4_L1
#define 5 = PS4_TRIANGLE
#define 6 = PS4_R1
#define 7 = PS4_L3
#define 8 = PS4_TOUCH
#define 9 = PS4_R3
Thus assigning a button to each number 0 thru 9.
I then want to set an array of four-digit numbers.
const curated_list[] = { 1234, 1111, 5678 }
I want to have an activation button that begins to iterate the list.
what is the syntax to use a for loop?
for(i=0; i < curated_list - 1; i++) I am unsure.
I also am unsure how it will equate each number in the list to a button press.
[UPDATE]
So I can take the i and split it to read it?
1,2,3,4
then press each button
and move on
So when it grabs i it would have to do a combo that could be dynamic based on each number of the element in the array.
Does anyone know how to do these things using the Titan Two syntax???
I have some questions about scripting.
I am wanting to assign a number for each button like
#define 0 = PS4_OPTIONS
#define 1 = PS4_L2
#define 2 = PS4_SQUARE
#define 3 = PS4_R2
#define 4 = PS4_L1
#define 5 = PS4_TRIANGLE
#define 6 = PS4_R1
#define 7 = PS4_L3
#define 8 = PS4_TOUCH
#define 9 = PS4_R3
Thus assigning a button to each number 0 thru 9.
I then want to set an array of four-digit numbers.
const curated_list[] = { 1234, 1111, 5678 }
I want to have an activation button that begins to iterate the list.
what is the syntax to use a for loop?
for(i=0; i < curated_list - 1; i++) I am unsure.
I also am unsure how it will equate each number in the list to a button press.
[UPDATE]
So I can take the i and split it to read it?
1,2,3,4
then press each button
and move on
So when it grabs i it would have to do a combo that could be dynamic based on each number of the element in the array.
Does anyone know how to do these things using the Titan Two syntax???