Skip to content

Instantly share code, notes, and snippets.

@waggz81
Created June 15, 2021 14:07
Show Gist options
  • Save waggz81/bb2aa12c7ab6c1bfebce3fd956eb4fef to your computer and use it in GitHub Desktop.
Save waggz81/bb2aa12c7ab6c1bfebce3fd956eb4fef to your computer and use it in GitHub Desktop.
AHK Script to add all items in Phasmophobia
;only activate when phasmo is active window
#ifWinActive ahk_exe Phasmophobia.exe
F9::
;script options for delays
SetBatchLines -1
SetMouseDelay, 1
SetDefaultMouseSpeed, 0
;makes mouse coordinates to be relative to client.
CoordMode, Mouse, Client
;get the dimensions and fullscreen status
WinGetPos, xx, yy, W, H, ahk_exe Phasmophobia.exe
WinGet, vWinStyle, Style, ahk_exe Phasmophobia.exe
SysGet, CaptionHeight, 4
If !(vWinStyle & 0xC00000) ; if the window doesn't have a title bar
{
;No Caption
TitleBar := 0
}
else {
;Caption
TitleBar := CaptionHeight
H := H - CaptionHeight ;adjust height to compensate for title bar
}
;list of rows of equipment in array
YCoords := Array(.325, .35, .38, .41, .435, .465, .49, .515, .545, .57, .595, .625, .65, .675, .70)
;loop through rows
for index, YCoords in Ycoords
{
;first column position
CoordX := W * .47
CoordY := (H * YCoords)
Click, %CoordX% %CoordY%
;second column is rows 1-7, so only move to this column for those rows
if (index < 8) {
;second column position
CoordX := W * .74
Click, %CoordX% %CoordY%
}
}
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment