i would like to get a script that search a name on my game screen and move my mouse on this name, remeber that this name can be in any cordinate of my screen, i tried some scripts below but i cant think how to do this... Can someone help me?
Haystack = arroz
Needle = def
StringGetPos, pos, Haystack, %Needle%
CoordMode, Mouse
MouseMove, X, Y
Find name in screen and move mouse on it
-
- Posts: 3
- Joined: 17 May 2018, 08:34
Re: Find name in screen and move mouse on it
yeah uhhh, i dont think you can do it like that. can u post a screenshot of what this name looks like, also what game
if i had to guess, i think youd need to OCR the entire screen looking for the name(not exactly the most viable of methods, but may be the only one applicable)
if i had to guess, i think youd need to OCR the entire screen looking for the name(not exactly the most viable of methods, but may be the only one applicable)
-
- Posts: 3
- Joined: 17 May 2018, 08:34
Re: Find name in screen and move mouse on it
https://imgur.com/a/RJkVrz3
The image is on link above, and the name of game is Tibia.
The name of target is Bexten.
The script must find this name in any part of screen and must stop mouse on it, is this possible?
The image is on link above, and the name of game is Tibia.
The name of target is Bexten.
The script must find this name in any part of screen and must stop mouse on it, is this possible?
Re: Find name in screen and move mouse on it
You can try image search using *Trans and some variation to find anything.
Example based on the image in your link (not zoomed in)
This example is using *TransBlack the trick is to black out any colors that you dont want in the image search. ie: antialiasing and shifting colors.
Zoom in on the attached image to see the blacked out parts. This is nothing complicated it can be done in paint.
HTH
Example based on the image in your link (not zoomed in)
Code: Select all
#NoEnv
CoordMode, Pixel, Screen
CoordMode, Mouse, Screen
1::
ImageSearch, FoundX, foundY, 0, 0, A_ScreenWidth, A_ScreenHeight, *TransBlack *30 %A_ScriptDir%\Bexten.png
if (ErrorLevel = 0)
MouseMove, FoundX+32, foundY+7 ; Offset to click in the middle of found image.
else
MsgBox % ErrorLevel
return
Zoom in on the attached image to see the blacked out parts. This is nothing complicated it can be done in paint.
HTH
- Attachments
-
- Bexten.png (1.55 KiB) Viewed 1718 times
-
- Posts: 3
- Joined: 17 May 2018, 08:34
Re: Find name in screen and move mouse on it
Do not worked brother, i think its because the function must scanner the screen every time, this is not a static image, its a online game that de name is mooving on screen every time. Im stating to think this is not possible. And sorry about my english, im not so good yet.
Re: Find name in screen and move mouse on it
I was only providing an example script method of how you could go about scripting what you want to do.
It is not plug and play use.
You most likely would need to create an image from the game window and use a loop or timer to run the routine to do what you want.
Once that works if it doesn't run fast enough there are options you can use to speed it up.
Anyways maybe someone else will find this technique useful.
It is not plug and play use.
You most likely would need to create an image from the game window and use a loop or timer to run the routine to do what you want.
Once that works if it doesn't run fast enough there are options you can use to speed it up.
Anyways maybe someone else will find this technique useful.
Re: Find name in screen and move mouse on it
disregarding the fact these name tags seems to get occluded whenever there's crap being spammed on the screen, i dont think Xtra's solution, though an elegant one, would work even if you were to code it in properly. I personally havent had much success in employing TransColor + Variation with image searches. Nevertheless, do try it out, im curious to see how it goes.
Instead, i was thinking more along the lines of finding something unique about the nametag, maybe the vertical bar in B or something, and searching for that instead.
Provided u manage to do all of that, youre still facing the issue of Imagesearching not a minuscule portion of the screen. If speed is of any importance, this method might yield poor results in the first place.
Idk what anticheat tibia has(if any at all), but another approach could be to read your target player's coordinated(if theyre at all provided) from memory, compare them with your own, triangulate the relative position of the target player based off of that, translate it into mouse coordinates and click with some unspecified degree of accuracy of your target player.
Anyway, i decided to test out ImgSearch TransColor for my own amusement in this mock example(see attachments)
Instead, i was thinking more along the lines of finding something unique about the nametag, maybe the vertical bar in B or something, and searching for that instead.
Provided u manage to do all of that, youre still facing the issue of Imagesearching not a minuscule portion of the screen. If speed is of any importance, this method might yield poor results in the first place.
Idk what anticheat tibia has(if any at all), but another approach could be to read your target player's coordinated(if theyre at all provided) from memory, compare them with your own, triangulate the relative position of the target player based off of that, translate it into mouse coordinates and click with some unspecified degree of accuracy of your target player.
Anyway, i decided to test out ImgSearch TransColor for my own amusement in this mock example(see attachments)
Spoiler
Who is online
Users browsing this forum: joedf and 43 guests