Clarified Macro scipting

Added more detailed instructions for your average user in laymen words.
This commit is contained in:
Dummydude 2023-06-21 20:44:31 -04:00 • committed by GitHub
commit 24a0051b29
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,17 +1,27 @@
# NXBT Macros
# Writing an NXBT Macro
## Writing an NXBT Macro
### Basic Macro script
Each NXBT macro line is composed of the buttons/sticks being set and the amount of time they are set for. A simple macro follows:
Every macro script is composed of Button/Stick input followed by a set duration. Here is a sample of this.
```
B 0.1s
0.1s
```
The above macro is the B button being pressed for 0.1s and no controls being set for 0.1s. This is effectively a single B button press.
The above macro is setting the B button to be pressed for 0.1s (0.1 seconds).
A slightly more complicated example follows:
Oftentimes you'll need gaps between your inputs when no buttons should be pressed. This is easily scripted by making a new line and inserting a new time.
```
B 0.1s
1s
```
This is effectively a single B button press. NXBT will then wait 1 second before moving to the next action.
### Advanced Macros
To set multiple inputs simultaneously, we write our inputs on the same line, separated by a space, followed by the duration. This is how our script looks now.
```
A B 0.5s
@ -19,7 +29,7 @@ B 0.1s
0.1s
```
This new macro, first, has both the A and the B button being pressed for 0.5s. Next, the A button is released and the B button continues to be held for an additional 0.1s. Finally, no controls are set for 0.1s.
First, This new macro has both the A and B buttons pressed for 0.5s. Next, the A button is released and the B button continues to be held for an additional 0.1s. Finally, no buttons are pressed for 0.1s.
The above macros deal with only button-based input. A stick input example follows: