Help for a disabled gamer!

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Darkspatter
Posts: 6
Joined: 22 Jun 2017, 09:45

Help for a disabled gamer!

22 Jun 2017, 10:32

I'm physically disabled, being paralyzed from the neck down due to a spinal cord injury. I'm a bit of a PC gaming enthusiast, and play games (mostly first-person shooters) using a 'mouthstick'. If you're interested feel free to see how I play on my Youtube channel:

https://www.youtube.com/channel/UC9zWpB ... sdl9pxQt5Q

AHK is pretty much an essential utility forr me, as I use it to allow me to fire semi-automatic weapons in games (I have a toggle button on my trackball, and Autohotkey automatically clicks the mouse for me). AHK also allows me to turn any keyboard key into a 'toggle' key, so I can get around the problem of not being able to hold more than one button down at a time (I effectively have just one 'finger'!).

Here the AHK script I'm currently using for Battlefield 1:

Code: Select all

;  Combined BF1 Key Mods (auto & semi-auto)

SetTitleMatchMode, 3
SetTitleMatchMode, Slow
#IfWinActive, ahk_class Battlefield™ 1

	SetCapsLockState, AlwaysOff ;turns capslock off so not distracting in-game.

	$tab::SendInput, % "{tab " ((X := !X) ? "Down" : "Up") "}"  ;toggles the tab button.
	
	$`::f ;maps the console key to the 'F' button.

	$v::SendInput, % "{v " ((X := !X) ? "Down" : "Up") "}"  ; toggles v button.

	LWin::Return ;disables left windows key.

	tog:=0    ;set to 1 if you want tapfire on when script starts.

	F1::tog:=!tog    ;F1 hotkey to toggle tapfire on/off.

		#If (tog)

		*$LButton::
 	 	While GetKeyState("LButton", "P"){
			Click down
     			Sleep 175 ; milliseconds.
			Click up
			Sleep 125 ; milliseconds.
	 	}
		return
I should state at this point that I know almost nothing about writing AHK scripts from scratch - the above script was cobbled together having been cut and pasted from other people's scripts I've found through quite a bit of Googling! Having used the above script for some time with BF1 (and BF4 and BF3 before it), I'm sure it could be improved, specifically, where the automatic mouse clicking or 'tap-fire' section. At the moment, the tap-fire mouse clicking works at the same interval whether I'm using a bolt-action rifle (the primary gun) or a pistol (the secondary gun). What would be great would be if I could have different click-rates for the two guns: so when I press 1 on the keyboard to select the primary weapon, it clicks at a slower rate for more accurate aiming, but when I press 2 on the keyboard to select the pistol, it clicks at the maximum rate possible (since pistols are mostly used at close range).

Another useful feature would be if it might be possible to have some sort of overlay visible in a game, to tell me when I've got the tap-fire mode on or off? I've gotten killed so many times before because I've forgotten to press 'F1' to enable the tapfire mode!

Anyway guys, I'd REALLY appreciate any help you can give me? And if not, thanks for taking a look at my post :)
Stuff n Things
Posts: 18
Joined: 23 Jan 2017, 12:42

Re: Help for a disabled gamer!

22 Jun 2017, 14:47

I don't play BF1 so..I'm not sure if this will work but give it a try!
If it works, you should see a tooltip in the upper left hand corner of the window when the toggle is on (Toggle Active) or nothing when it is off. And, you should have a faster rate of fire after swapping to your pistol (2)

Code: Select all

#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.

;  Combined BF1 Key Mods (auto & semi-auto)

SetTitleMatchMode, 3
SetTitleMatchMode, Slow
tog := 0    ;set to 1 if you want tapfire on when script starts.
prim_del := 175 ;time delay for primary weapon.
secon_del := 85 ;time delay for secondary weapon.
set_del := prim_del

#IfWinActive, ahk_class Battlefield™ 1

	SetCapsLockState, AlwaysOff ;turns capslock off so not distracting in-game.

	$tab::SendInput, % "{tab " ((X := !X) ? "Down" : "Up") "}"  ;toggles the tab button.
	
	$`::f ;maps the console key to the 'F' button.

	$v::SendInput, % "{v " ((X := !X) ? "Down" : "Up") "}"  ; toggles v button.

	LWin::Return ;disables left windows key.

	F1::
	tog:=!tog    ;F1 hotkey to toggle tapfire on/off.
	if (tog)
		tooltip, Toggle Active, 75, 75
	else
		tooltip
	return
	~1::set_del:=prim_del
	~2::set_del:=secon_del




		#If (tog)
		tooltip, 50, 50 , stuff
		*$LButton::
 	 	While GetKeyState("LButton", "P"){
			Click down
     			Sleep, %set_del% ; milliseconds.
			Click up
			Sleep, (set_del * .713) ; milliseconds.
	 	}
		return
Darkspatter
Posts: 6
Joined: 22 Jun 2017, 09:45

Re: Help for a disabled gamer!

23 Jun 2017, 06:02

Thanks ever so much for taking the trouble to help me out! I'm busy this afternoon, but I'll give your revised script a go this evening, & will let you know how I get on :)
Darkspatter
Posts: 6
Joined: 22 Jun 2017, 09:45

Re: Help for a disabled gamer!

23 Jun 2017, 13:30

Hi Stuff n Things, I've just had chance to try out your amended script, and there is one small problem. When I activate the tap-fire mode by pressing F1, so that the 'Toggle Active' tooltip appears, the games goes from full-screen into a small window. When I press Alt-Enter to put it back to full-screen, the 'Toggle Active' indicator disappears. Other than that, the script seems to work very well, thank you! :)

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], hedehede81 and 275 guests