Page 1 of 1

How to implement map mouse scrolling

Posted: Fri Feb 17, 2023 8:49 am
by MarkShot
This is just a sample of code which can be used at 1080p. Works great for me.

You would need AHK (auto hot key) which is an open source scripting language. It will run directly or can be compiled and run as an EXE.

How does it work. The game will open to screen position 0,0. It takes the full screen scrolling sense areas and creates larger windowed landing zones so that scrolling is triggered. In order, to stop the scrolling and free your mouse, you must cause the game to lose focus. (You hit the WIN key or ALT-TAB, whatever ...)

This was developed and tested under WIN10 64 using a many year old 32 bit version of AHK (mainly I have lots scripts and don't want to deal with migration issues). Enjoy! (sorry no option to use a monospace font below)

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#SingleInstance force
#Persistent
#NoTrayIcon
SetTitleMatchMode 3

Game01 = The Guns of August

TimerInterval = 1

SetTitleMatchMode 1
CoordMode, Mouse, Screen

Sleep, 15000
SetTimer, ScriptDone, %TimerInterval%
SetTimer, WatchCursor, %TimerInterval%
return

ScriptDone:

IfWinNotExist,%Game01%,
ExitApp

Return

WatchCursor:

CoordMode, Mouse, Screen,

IfWinActive, %Game01%
{
SysGet, Screen, Monitor,
MouseGetPos, XPOS, YPOS
If (YPOS < 13)
{
MouseMove, %XPOS%, 13
}
If (YPOS > 943) AND (YPOS < 1025)
{
MouseMove, %XPOS%, 943
}
If (XPOS < 9)
{
MouseMove, 9, %YPOS%
}
If (XPOS > 1894)
{
MouseMove, 1894, %YPOS%
}
}
return

#IfWinActive, The Guns of August,

; PrintScreen Alternate (Snagit)
PrintScreen::!b

Re: How to implement map mouse scrolling

Posted: Thu Mar 02, 2023 12:34 pm
by MarkShot
I developed this under WIN10, but I found that setting compatibility to XP SP3 game much quicker scrolling. I have not idea why.