As per the following post, it seems like AutoHotKey (AHK) is okay to use if not for nefarious purposes to gain an advantage.
Post
If not allowed, let me know and I’ll delete this.
So I decided to look at some AHK tutorials and wrote 2 simple stance switch scripts to see how it would control if we had different control schemes. Now these scripts are super simple and can easily get out of sync with the game easily. If you mash the stance switch buttons too fast, it’ll ignore some of your inputs, but AHK will not be able to detect this and get out of sync.
[Update] Final script I used. I haven’t used it in awhile but someone messaged me about it, so might as well post it:
The problem is that autohotkey cannot detect what stance you’re in reliably. The closest thing I was able to do was for it to take a color pigment of the active stance and compare that (blue = shotgun, yellow = pistol, purple = rifle). However, that has issues if you need to switch stances really fast since it won’t be able to detect the proper color while the animation for switching stances is happening.
My final script before I decided it was too much of a headache is below. Has instructions to run if you want to test it out. Its also been awhile since I used it so I’m not sure if I remember things correctly, I’m going based off of reading the code.
Make sure your numlock is on.
Ctrl+Numpad0 causes you to exit the script
Ctrl+Numpad4 starts the learning process
Ctrl+Numpad5 resets the learning process
Ctrl+Numpad1 turns it on (only do that after you finished the learning process)
Ctrl+Numpad2 turns it off
Once you press Ctrl+Numpad4 to turn on the learning process, you much move your mouse pointer to the center/active stance indicator (those colored circles that indicate your stance) and left click in the colored area. Do this first for pistols (so switch to pistols and click anywhere in the yellow portion, do not click on the gun itself since you want to select a pixel with the yellow color), then switch to shotgun and click in colored area, and finally rifle and click in colored area. Once that’s done, you’re set. The learning process basically records the position of your mouse on the active stance and records the color at that location for each of the stances when its active. Press ctrl+numpad1 to turn it on and test it.
Z always switches to shotgun
X always switches to pistols
C always switches to rifle
Keep in mind that it doesn’t know when you’re in combat and when you’re not, so if you try to type with it on, it’ll screw it up. So you press ctrl+numpad2 to toggle it off and then when you want it back on, you press ctrl+numpad1. You do not need to redo the learning process if you already finished it.
Again those, say you’re in a position where you switched to rifle but noticed a counter opportunity so you immediately want to switch back to pistols. If the animation that happens when you’re switch guns is still happening (the circles swapping places), it will not switch you until it can detect the color in the pixel that you trained it on.
Anyway, again, I have since then stopped using this and not sure their official stance on autohotkey.
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
;#IfWinActive ahk_class EFLaunchUnrealUWindowsClient ahk_exe LOSTARK.exe
toggle := false
isShotgun := false
isRifle := false
isPistol := false
priming := false
primed := false
pistolColor := ""
shotgunColor := ""
rifleColor := ""
selectedX := ""
selectedY := ""
selectedXY := []
selectedXYCount := 0
selectedColor := ""
updateIsFlagsBySelected:
if (primed) {
PixelGetColor, currentPistolColor, selectedXY[0], selectedXY[1]
PixelGetColor, currentShotgunColor, selectedXY[2], selectedXY[3]
PixelGetColor, currentRifleColor, selectedXY[4], selectedXY[5]
isShotgun := currentShotgunColor = shotgunColor ? true : false
isRifle := currentRifleColor = rifleColor ? true : false
isPistol := currentPistolColor = pistolColor ? true : false
selectedColor = isPistol ? pistolColor : isShotgun ? shotgunColor : isRifle ? rifleColor : ""
;MsgBox, 0, , color %color% pistol %pistolColor% shotgun %shotgunColor% rifle %rifleColor% isshotgun %isShotgun% isrifle %isRifle% ispistol %isPistol%
}
return
resetFlags:
toggle := false
isShotgun := false
isRifle := false
isPistol := false
priming := false
return
resetPriming:
priming := false
primed := false
toggle := false
pistolColor := ""
shotgunColor := ""
rifleColor := ""
selectedXY := []
selectedXYCount := 0
selectedColor := ""
return
^Numpad1::
Gosub, resetFlags
toggle := true
KeyWait Numpad1
return
^Numpad2::
Gosub, resetFlags
toggle := false
KeyWait Numpad2
return
^Numpad0::
ExitApp
return
^Numpad4::
Gosub, resetFlags
Gosub, resetPriming
priming := true
KeyWait Numpad4
return
^Numpad5::
Gosub, resetFlags
Gosub, resetPriming
priming := false
KeyWait Numpad5
return
#If priming
~LButton::
MouseGetPos, xpos, ypos
PixelGetColor, color, %xpos%, %ypos%
If (pistolColor = "") {
pistolColor := color
selectedXY[0] := xpos
selectedXY[1] := ypos
selectedXYCount := 2
} else if (shotgunColor = "") {
shotgunColor := color
selectedXY[2] := xpos
selectedXY[3] := ypos
selectedXYCount := 4
} else if (rifleColor = "") {
rifleColor := color
selectedXY[4] := xpos
selectedXY[5] := ypos
selectedXYCount := 6
priming := false
primed := true
Gosub, updateIsFlagsBySelected
}
KeyWait LButton
return
#If
#If toggle
~enter::
toggle := false
isShotgun := false
isRifle := false
isPistol := false
priming := false
KeyWait enter
return
z::
if (primed) {
Gosub, updateIsFlagsBySelected
if (isPistol) {
Send {z}
} else if (isRifle) {
Send {x}
}
}
KeyWait z
return
x::
if (primed) {
Gosub, updateIsFlagsBySelected
if (isShotgun) {
Send {x}
} else if (isRifle) {
Send {z}
}
}
KeyWait x
return
c::
if (primed) {
Gosub, updateIsFlagsBySelected
if (isPistol) {
Send {x}
} else if (isShotgun) {
Send {z}
}
}
KeyWait c
return
#If
;#IfWinActive