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)
Finding text in game by scrolling mouse button. Topic is solved
Re: Finding text in game by scrolling mouse button.
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%
Re: Finding text in game by scrolling mouse button.
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
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
Re: Finding text in game by scrolling mouse button. Topic is solved
It automatically stops scrolling and displays the coordinates where the picture was found.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
you can try to run it as administrator
i tested it and it works fine btw
Who is online
Users browsing this forum: ReyAHK and 78 guests