Toggle Sprint Script - best/easiest way to make one?
I was looking at trying to make a script for Elden Ring on PC with an xbox controller to toggle sprint so that I don't have to constantly use claw grip when exploring (rip the side of my index finger). I'm fine with not using the script during normal combat so I dont want to replace the standard sprint functionality completely.
I was looking at trying to use autohotkey but I'm not sure if its the most optimal way to write this code.
I'm trying to make the script activate when I click L3 + circle/b. The script would deactivate when I click L3 again OR stop inputting a control stick input for .25 seconds (ideally with possible degrees of how far its been pushed so if im barely moving the stick it stops triggering) OR if I press Y/triangle.
I found this script as a base but it was formatted for a different language. https://www.consoletuner.com/forum/viewtopic.php?f=6&t=919&sid=6e9f75890669c9eccce85b697d883fd1&start=10
Main questions:
-
Is autohotkey the best option or is there a better way to do this?
-
I changed the original scripts usage of A (the old interact button) to Y (the new interact button for Elden Ring). Did I miss things up there?
-
Do I need the 360 part of this script or will it cause complications?
If the answer is yes to using AHK:
-
How do i send an L3 input / is it possible? I found https://www.reddit.com/r/AutoHotkey/comments/q4dtn1/dualshock4_l3_input_hey_dear_community_i_want_to/ and one person says its not but the OP says they did it with "Send {Joy 12}"
-
How do I do functions / name them? the Combo roll code and one after wont execute. I found https://www.autohotkey.com/docs/Functions.htm#DynCall but dont understand how to specify it.
This is what I had pre-figuring out it was not written for AHK which I was trying to write it in. Any and all help would be greatly appreciated!
int sprint = FALSE;
main {
if(event_press(XB360_B) && get_ptime(XB360_B) < 500 && get_val(XB360_LY) <= -20) combo_run(Roll);
///Sets Sprint Toggle
if(get_val(XB360_LY) <= -20 || get_val(XB360_LY) >= 20 || get_val(XB360_LX) <= -20 || get_val(XB360_LX) >= 20)
{if(event_press(XB360_Y) && get_val(XB360_LY) < -20 || get_val(XB360_LY) > 20 ||
get_val(XB360_LX) < -20 || get_val(XB360_LX) > 20) sprint = TRUE;}
else if(sprint) sprint = FALSE;
if(sprint) set_val(XB360_B, 100);
///to fix unintentional rolling
if(get_val(XB360_Y) == 100 && get_val(XB360_LY) < -20 || get_val(XB360_LY) > 20 ||
get_val(XB360_LX) < -20 || get_val(XB360_LX) > 20) combo_run(ROLL_DELAY);
}
combo Roll {
set_val(XB360_B, 0);
wait(40);
set_val(XB360_B, 100);
}
combo ROLL_DELAY{
set_val(XB360_B, 100);
wait(500);
}
Posted Feb 24, 2022, 5:17 PM UTC
Been looking for an answer to this same exact issue, thanks for the hookup. Wondering if it might be easier to set something in steam big picture mode? I'm gonna try it and report back if I remember to.
Good luck and let me know what you find! My search was kind of fruitless sadly. I learned autohotkey isnt set up to do this and I didnt feel like paying for a software.
I will say though that with 60 hours into ER, that its a looooot less annoying than when doing in DS1-3 because theres not as much sprinting and more riding torrent so its a lot easier on the side of my fingers. and when I am sprinting a lot of the paths are pretty straight anyway :)