Doesn't work on a well configured system (both AHK v1 and v2 installed, which you should since the vast majority of scripts out there are written in v1). They thought of this and set it up so the script interpreter will recognize v2 scripts, but you have to tell its its v2, by default it loads it in v1 and it errors out. Plus your code runs globally, messing up your mouse keys/etc all the time, not just when playing oblivion. I've fixed it to only work in game and work on v1+v2 systems for you:
#Requires AutoHotkey v2.0 SetTitleMatchMode 3 ; Exact window match mode, though we use exe for now #SingleInstance Force ; Ensure the script only runs for Oblivion Remastered #HotIf WinActive("ahk_exe OblivionRemastered-Win64-Shipping.exe") Cooldown_duration := 550 ; milliseconds global last_activation_time := 0 ~XButton1:: { global last_activation_time if (A_TickCount - last_activation_time < Cooldown_duration) return ; Ignore if within cooldown last_activation_time := A_TickCount Send "{RButton down}" Sleep 30 Send "{Space down}" KeyWait "XButton1" Send "{RButton up}" Send "{Space up}" } #HotIf
Here is a version for AHK v1 that works also for XInput controllers and additionally maps the dpad keys to number keys (1,2,3,4) for quick use of potions / items on the wheel.
CTRL+0 = Enable / Disable Script f = Enter Middle Mouse Button = Dodge Right Analog Trigger = Dodge dpad up = 1 dpad right = 2 dpad left = 3 dpad down = 4 (disabled by default because I use dpad down for sneak)
To change the button for controller, simply move the Dodge() function into the corresponding section in the script.
To disable / enable functionality use semicolon ; to comment out the corresponding functions.
No need for two versions to have it be only active when the game exe is running. I dunno what the gamepass .exe is called, but you can use a pipe like this to have it work on two different execs:
Level up acrobats to 25, then you can dodge by pressing the Block button and the Jump button, along with a directional button. It's ass and is completely pointless when you can just jump away in any direction twice as far without movement penalty. Won't be useful until someone makes a mod that gives it i-frames.
This is interesting. I'm not good with AHK, do you think it'd be possible to make a script that does the sequence when a directional button is pressed twice in quick succession like in some other games?
Play on m&k and don't understand why they chose a somewhat convoluted key combo for dodge. If able, would appreciate a version for double-tap W, A, S, or D to initiate dodge.
Edit one of the files using text pad and replace all the text with this:
Cooldown_duration := 550 ; milliseconds global last_activation_time := 0 ; Explicitly declare and initialize as global
~LAlt:: { global last_activation_time ; Declare it as global within the hotkey as well if (A_TickCount - last_activation_time < cooldown_duration) { return ; Ignore the key press if within the cooldown period } last_activation_time := A_TickCount
Send("{RButton down}") Sleep(30) ; Pause for 30 milliseconds (0.03 seconds), corrected value Send("{Space down}") KeyWait("LAlt") Send("{RButton up}") Send("{Space up}") }
33 comments
#Requires AutoHotkey v2.0
SetTitleMatchMode 3 ; Exact window match mode, though we use exe for now
#SingleInstance Force
; Ensure the script only runs for Oblivion Remastered
#HotIf WinActive("ahk_exe OblivionRemastered-Win64-Shipping.exe")
Cooldown_duration := 550 ; milliseconds
global last_activation_time := 0
~XButton1::
{
global last_activation_time
if (A_TickCount - last_activation_time < Cooldown_duration)
return ; Ignore if within cooldown
last_activation_time := A_TickCount
Send "{RButton down}"
Sleep 30
Send "{Space down}"
KeyWait "XButton1"
Send "{RButton up}"
Send "{Space up}"
}
#HotIf
Yeah a shoddy attempt on my behalf, ill update them with your version.
Script is too long to post here -> https://pastebin.com/jMFFQvLs
CTRL+0 = Enable / Disable Script
f = Enter
Middle Mouse Button = Dodge
Right Analog Trigger = Dodge
dpad up = 1
dpad right = 2
dpad left = 3
dpad down = 4 (disabled by default because I use dpad down for sneak)
To change the button for controller, simply move the Dodge() function into the corresponding section in the script.
To disable / enable functionality use semicolon ; to comment out the corresponding functions.
#HotIf WinActive("ahk_exe OblivionRemastered-Win64-Shipping.exe") || WinActive("ahk_exe oblivion.exe")
I think OCPA(One Click Power Attack) is also a need.Could you make one?
Thanks either way.
Cooldown_duration := 550 ; milliseconds
global last_activation_time := 0 ; Explicitly declare and initialize as global
~LAlt:: {
global last_activation_time ; Declare it as global within the hotkey as well
if (A_TickCount - last_activation_time < cooldown_duration) {
return ; Ignore the key press if within the cooldown period
}
last_activation_time := A_TickCount
Send("{RButton down}")
Sleep(30) ; Pause for 30 milliseconds (0.03 seconds), corrected value
Send("{Space down}")
KeyWait("LAlt")
Send("{RButton up}")
Send("{Space up}")
}