The Wiki for Tale 4 is in read-only mode and is available for archival and reference purposes only. Please visit the current Tale 11 Wiki in the meantime.

If you have any issues with this Wiki, please post in #wiki-editing on Discord or contact Brad in-game.

User:Cegaiel/Macros/GetMousePosition

From A Tale in the Desert
Jump to navigationJump to search

Get Mouse Position and Color (Autohotkey)

Just launch the script and it will show you this tooltip wherever you move the mouse. All the information on tooltip updates in realtime as you move the mouse.

Cegcode1.jpg


I wrote this in case I need to find the mouse position that I need to click on or if I need to find the color of where my mouse is hovering.
I mainly added the color gathering portion in case I want to write a macro with the PixelSearch in autohotkey.


Get Code!


Example code for finding color:

This will search for the color 0xE1D4AC (same as html code #E1D4AC) at mouse position 540,341.
If it finds that color, at that position (within 25 shades) then if will return errorlevel = 0


PixelSearch, Px, Py, 540, 341, 540, 341, 0xE1D4AC, 25, Fast|RGB
if ErrorLevel = 0
{
MsgBox, Color detected 
}else{
Msgbox, Color not found
}

To see a simple, small macro of this function in action, look at my Pop up box closer macro. It looks for the yellowish color that occurs in a popup box (ie too tired) and clicks the OK button anytime it occurs.