Gunslinger/Deadeye Stance Switch Controls

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

If you need AHK to play gunslinger or deadeye, you may as well not play them at all if it’s too complicated for you…

1 Like

Its not so much needing it, but exploring alternate control schemes and how much more simple it could have been. I’m not the greatest gunslinger, not by a longshot, but there are definitely times where I sometimes press the wrong identity button and press a skill expecting one thing but getting another so was just food for thought. But testing it actually does feel like some alternate control schemes would have been better.

This looks interesting I might give it a try. I’ve been wanting alternate controls for my Deadeye ever since I started playing him. The way it’s currently set up in game is so terrible.

Some notes: not really sure if its actually allowed. I spoke with support and while they did not have a direct answer of whether or not it was allowed, with the recent increase in bot detection and banning, they said they couldn’t guarantee this wouldn’t be seen as something by the game and flagged.

Also, its not really meant to actually use in actual combat, just getting a feel of how it could be with alternate controls since it gets out of sync super easily.

Main issue is that when you press Z/X in certain scenarios, nothing happens (such as when you’re CC’d, during cutscenes, in the middle of a skill animation that can’t be cancelled, etc). The script doesn’t know that the game ignored the button press and did not change stances since the script is running purely based on keyboard presses.

Someone could probably take the script further by having it partially synced with the game (such as looking at the color of the middle circle to know the stance you’re actually in), but for now, was just used for testing and fun. Would not recommend actually using it for anything that actually matters since it’ll get out of and really screw with you.

Tbh this is pretty cool. Having alternative weapon switching schemes in game would be nice, but I doubt SG will ever bother with it even though cycling through the weapons is objectively bad.

very cool! while i don’t plan to use this due to developed muscle memory, this will be useful to those that want to try de/gs but find the weapon cycling mechanism too clunky. why gate keep players with the artificial difficulty resulted from clunky design?