Jump to content

How to get the correct mouse coord between pixels

Recommended Posts


Hi there,

The purpouse of this thread is just educational since i really want to learn some maths.

What i'm doing is searching using pixelsearch the color of the name below the characters, after getting it i'm positioning the mouse -30 pixels up their name.

The problem is that when their name is too long, the program following the logic finds a pixel, goes up 30 pixels up, but because of the name being too long it will not target the character.

Summing it up: since the X coordinate is displaced by the pixel which is far away from the character due to their name being too long it will not proper set the mouse pointer on the character.

Any helps?

I thought that i could search for the first pixel colour of the name, and the last, and then get the mid-point so i get exactly the X coordinate where the character is...

The problem is that the pixel search is looking for a pixel around an invisible rectangle around my mouse pointer so i can't get exactly the first and last pixel around the name...




If you see the name Leminer, if the pixelsearch gets the "L" blue pixel colour it will not set the mouse on the character, instead it will set the mouse on the grass.help me.png



Thanks you in advance,

Yours sincerely: Eragon

Share this post

Link to post
Share on other sites

What makes you think that this is a legit question? :huh:
The forum rules clearly state: "Launching, automation or script interaction with games or game servers, regardless of the game."
What you ask for is script interaction with a game - may it be for "educational purpose" or not.
When you search the forum you will find a few threads asking for help on game automation - just for "education purpose". They all have been locked.

My UDFs and Tutorials:


Active Directory (NEW 2017-04-18 - Version - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version - Download - General Help & Support

ADO - Wiki


Share this post

Link to post
Share on other sites
This topic is now closed to further replies.


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.