OH MY GOD, I got it to work, and it doesn't even make sense.
So I had given up and reverted back to J2Kbr's original script which was good but only worked if you pressed reload before you began sprinting.
I thought I might as well take the moment to integrate the hair-trigger script from here:
viewtopic.php?f=9&t=3099And...that did the trick. It makes no sense but it works now, I can't believe it. Here's the code:
- Code: Select all
define ADS_BUTTON = PS4_R2;
define SPRINT_BUTTON = PS4_L3;
define MOV_Y_AXIS = PS4_LY;
define RELOAD_BUTTON = XB1_X;
int sprinting = FALSE;
main {
if(!get_val(ADS_BUTTON) && !get_val(RELOAD_BUTTON)) {
if(get_val(MOV_Y_AXIS) < -97) {
sprinting = TRUE;
combo_run(EasySprint);
}
} else {
combo_stop(EasySprint);
if(sprinting) combo_run(SprintCancel);
}
if(get_val(7) > 1) set_val(7, 100);
if(get_val(4) > 1) set_val(4, 100);
}
combo EasySprint {
set_val(SPRINT_BUTTON, 100);
wait(40); wait(40);
}
combo SprintCancel {
set_val(MOV_Y_AXIS, 0);
sprinting = FALSE;
wait(80);
}
I also reduced the delay from 400 to 10 because it created this weird jitter otherwise.
Also surprising is that it works regardless of whether Maintain Sprint is turned on or not.
I also created an alternate version for Rainbow Six Siege, swapping reload with weapon switching. This allows me to swap while pressing forward on the stick (you have to hold the switch weapon button though, you can't just tap it).
- Code: Select all
define ADS_BUTTON = PS4_R2;
define SPRINT_BUTTON = PS4_L3;
define MOV_Y_AXIS = PS4_LY;
define SWITCH_BUTTON = XB1_Y;
int sprinting = FALSE;
main {
if(!get_val(ADS_BUTTON) && !get_val(SWITCH_BUTTON)) {
if(get_val(MOV_Y_AXIS) < -97) {
sprinting = TRUE;
combo_run(EasySprint);
}
} else {
combo_stop(EasySprint);
if(sprinting) combo_run(SprintCancel);
}
if(get_val(7) > 1) set_val(7, 100);
if(get_val(4) > 1) set_val(4, 100);
}
combo EasySprint {
set_val(SPRINT_BUTTON, 100);
wait(40); wait(40);
}
combo SprintCancel {
set_val(MOV_Y_AXIS, 0);
sprinting = FALSE;
wait(10);
}
Anyway thanks so much to the both of you for this. It's a bloody life saver.