Skip to content
This repository was archived by the owner on Aug 10, 2025. It is now read-only.

Commit c9fe218

Browse files
authored
Bug Fixes (#23)
* Fix windows detection - Change Title Match Mode to be 3 which is exact match. * Fixed Error with SetTitleMatchMode * Improvements to the Reconnect. This seems to work 100% of the time on 1920x1080, a smaller window seems to work 2nd try. * Reconnection working 100% on all screens. - Closes #16 * Requested Changes - Added a comment block explaining why it's done this way and why we change SendMode.
1 parent fb93ebe commit c9fe218

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

AFB.ahk

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
; AHK v2
22
#SingleInstance Force
3+
SetTitleMatchMode 3
34

45
/*
56
constants
@@ -126,9 +127,18 @@ ClickImageMidPoint(imageFile, xOffset, yOffset){
126127
clickX := imageMidPoint[1] + xOffset
127128
clickY := imageMidPoint[2] + yOffset
128129

129-
; ! Clicks seems to be flakey, this is why using two Click() instead of the 3rd parameter
130-
Click(clickX, clickY)
131-
Sleep(350)
130+
/*
131+
Teleports Mouse to the corner of the button, offset -100pxs to get further away from the button.
132+
Then setting SendMode to Event allows us to "Side" the mouse onto the Reconnect button, therefore creating a hover event.
133+
Then resetting the SendMode and in the end, clicking the button.
134+
135+
The reason we "Slide" onto the Reconnect Button is because Roblox refuses to detect a MouseClick if the Mouse snapped onto the button.
136+
This code here fixes https://github.com/UpDownLeftDie/AwayFromBlox/issues/16
137+
*/
138+
MouseMove(xOffset - 100, yOffset - 100, 0)
139+
SendMode("Event")
140+
MouseMove(clickX, clickY, 10)
141+
SendMode("Input")
132142
Click(clickX, clickY)
133143
}
134144

0 commit comments

Comments
 (0)