Victoria 2 autohotkey helper

2024年8月24日
;#Requires AutoHotkey v2.0

; SetMouseDelay 800

#HotIf WinActive("ahk_exe v2game.exe")
j::
{
click "WheelDown", 1
sleep 1000
click "Left", 1
}

p::send "{space}"

monitorCount := MonitorGetCount()
if(monitorCount = 2)
{
	MonitorGetWorkArea(1, &Left1, &Top1, &Right1, &Bottom1)
	MonitorGetWorkArea(2, &Left2, &Top2, &Right2, &Bottom2)

	s::
	{
		MouseGetPos &curX, &curY
		;MsgBox(Format("x={1}, y={2}", curX, curY))
		;ListVars
	  
		if (Left1 < curX && curX < Right1 && Top1 < curY && curY < Bottom1)
		  MouseMove (Left2 + Right2) // 2, (Top2 + Bottom2) // 2
		else if (Left2 < curX && curX < Right2 && Top2 < curY && curY < Bottom2)
		  MouseMove (Left1 + Right1) // 2, (Top1 + Bottom1) // 2
	}
}

#HotIf