Finding text in game by scrolling mouse button. Topic is solved

Ask gaming related questions (AHK v1.1 and older)
Alex93

Finding text in game by scrolling mouse button.

11 Jul 2018, 14:50

Hello folks,

i'd like to ask you for help to write a macro. I hope it should be simple but i have no idea how to write it. Simply if i press the "T" key (for example) on my keyboard it should starts scrolling wheel down or up ( it doesn't matter probably because if the cursor is at the end of line it begins again from above) until it finds the entered text and stops scrolling. Even it doesn't matter if the entered text does exist in the table or not because i'm 100% sure it will be there.

Is it possible in AHK?
I'm for any advice and thank you a lot for help

P.S.: ( I'm sorry for my english)
Qysh
Posts: 143
Joined: 24 Apr 2018, 09:16

Re: Finding text in game by scrolling mouse button.

12 Jul 2018, 06:36

Read this if you never used ImageSearch (https://autohotkey.com/docs/commands/ImageSearch.htm)

Code: Select all

scrollLoops := 100

ImageSearch, sX, sY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, image.png
while(ErrorLevel)
{
	Loop, % scrollLoops
	{
		ImageSearch, sX, sY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, image.png
		if(!ErrorLevel)
			break
		Send, {WheelDown}
	}
	
	Loop, % scrollLoops
	{
		ImageSearch, sX, sY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, image.png
		if(!ErrorLevel)
			break
		Send, {WheelUp}
	}
}

MsgBox, found at %sX%:%sY%
Alex93

Re: Finding text in game by scrolling mouse button.

12 Jul 2018, 12:01

Ah thanks, but unfortunately it doesn't work. I made a screenshot of the text where should the macro stop on and i saved it on my desktop. Then i've set the coordinates of the corner of my monitor and set the file's name at the end. It seems the macro works in game but it's not able to stop scrolling even when the text has been already shown and it keep scrolling untill i stop the macro manually in Windows.

I guess there is missing something like "if the text is found, then stop scrolling".

If do you want then i can record a video what exactly i mean.

Thank you a lot :)
Qysh
Posts: 143
Joined: 24 Apr 2018, 09:16

Re: Finding text in game by scrolling mouse button.  Topic is solved

13 Jul 2018, 05:54

Alex93 wrote:Ah thanks, but unfortunately it doesn't work. I made a screenshot of the text where should the macro stop on and i saved it on my desktop. Then i've set the coordinates of the corner of my monitor and set the file's name at the end. It seems the macro works in game but it's not able to stop scrolling even when the text has been already shown and it keep scrolling untill i stop the macro manually in Windows.

I guess there is missing something like "if the text is found, then stop scrolling".

If do you want then i can record a video what exactly i mean.

Thank you a lot :)
It automatically stops scrolling and displays the coordinates where the picture was found.
you can try to run it as administrator

i tested it and it works fine btw

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: ReyAHK and 53 guests