Syntax
get_val, set_val, combos, and wait
get_val reads what the controller is doing right now. set_val writes what the console should see instead. If you set_val a stick every loop without caring what the player is doing, you have taken that axis away from them.
main {
if (get_val(PS4_R2) > 50) {
set_val(PS4_RY, get_val(PS4_RY) - 15);
}
}The sketch above is the idea of a stick correction while a trigger is down. The 15 is a made-up step for the example. A real file uses a value someone tested on a weapon, and it will be wrong on the next weapon. That is why anti-recoil scripts are tables, not one subtraction.
Combos
A combo is a named block. combo_run starts it. Inside it, wait pauses that sequence for the number of milliseconds you pass. Call or run patterns differ by which function the compiler you are using documents. Stick to combo_run unless the file you are editing already uses another entry point.
combo burst {
set_val(PS4_R2, 100);
wait(50);
set_val(PS4_R2, 0);
wait(50);
}Two waits make a cadence: down for 50 ms, up for 50 ms. Rapid fire and turbo are that shape on a button, gated by a toggle so it does not run forever. The toggle is a variable you flip when you see a fresh press, not a value you set every loop.
Milliseconds
wait takes milliseconds. A hold of 660 is a bit over half a second. Loops in main do not use wait if you still need to read the controller during that time. Put the wait in the combo. A timed jumper is this idea pointed at Square or X: press, wait N, release. The calibration is the part no sketch can finish for you, because N depends on the animation.
Identifiers such as PS4_R2 have to match the compiler's list. If a name fails to compile, it is the wrong identifier, not a broken wait.