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.

Difference between revisions of "User:Cegaiel/Macros/ConvertMousePosition"

From A Tale in the Desert
Jump to navigationJump to search
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<pre>
 
<pre>
 +
;The next line is what tells the Active Windows Width and Height
 
WinGetActiveStats, Title, Width, Height, X, Y
 
WinGetActiveStats, Title, Width, Height, X, Y
 +
 
MsgBox Hover mouse over a position that will be clicked.`nPress the F2 key to copy the code into Clipboard.`n`nClick OK to continue...
 
MsgBox Hover mouse over a position that will be clicked.`nPress the F2 key to copy the code into Clipboard.`n`nClick OK to continue...
  
WinResX := Width - 8
 
WinResY := Height + 22
 
  
 
#Persistent
 
#Persistent
Line 15: Line 15:
 
ClickX := Width - xpos
 
ClickX := Width - xpos
 
ClickY := Height - ypos
 
ClickY := Height - ypos
 +
 +
 +
PixelGetColor, color, xpos, ypos, RGB
 +
  
 
GetKeyState, state, F2
 
GetKeyState, state, F2
 
if state = D
 
if state = D
 
{
 
{
 +
Clipboard = `;The below 2 lines are for information purposes only and can be erased.`n`;Current Color: %color%`n`;Mouse Position: %xpos%, %ypos%`n`n`;The below line only needs to be used once in a script, first line!`nWinGetActiveStats, Title, Width, Height, X, Y`n`n`;The next 3 lines is the required code, Width and Height variables is determined by the WinGetActiveStats line (above)`nClickX := Width - %ClickX%`nClickY := Height - %ClickY%`nClick, `%ClickX`%, `%ClickY`%
 +
 
MsgBox Mouse Position %xpos%, %ypos% has been converted to:`n`nClickX := Width - %ClickX%`nClickY := Height - %ClickY%`nClick, `%ClickX`%, `%ClickY`%`n`nThe converted code is now in the clipboard.`nPaste into Notepad with Ctrl+V at anytime.  
 
MsgBox Mouse Position %xpos%, %ypos% has been converted to:`n`nClickX := Width - %ClickX%`nClickY := Height - %ClickY%`nClick, `%ClickX`%, `%ClickY`%`n`nThe converted code is now in the clipboard.`nPaste into Notepad with Ctrl+V at anytime.  
Clipboard = ClickX := Width - %ClickX%`nClickY := Height - %ClickY%`n`%ClickX`%, `%ClickY`%
 
 
}
 
}
  
ToolTip, Windows Resolution: %WinResX%x%WinResY%`nActive Window Resolution: %Width%x%Height%`n`nMouse Position: %xpos% %ypos%`n`nClickX := Width - %ClickX%`nClickY := Height - %ClickY%
+
ToolTip, Windows Resolution: %A_ScreenWidth%x%A_ScreenHeight%`nActive Window Resolution: %Width%x%Height%`n`nColor: %color%`nMouse Position: %xpos% %ypos%`n`nClickX := Width - %ClickX%`nClickY := Height - %ClickY%
 
return
 
return
 
</pre>
 
</pre>

Latest revision as of 16:08, 13 January 2010

;The next line is what tells the Active Windows Width and Height
WinGetActiveStats, Title, Width, Height, X, Y

MsgBox Hover mouse over a position that will be clicked.`nPress the F2 key to copy the code into Clipboard.`n`nClick OK to continue...


#Persistent
SetTimer, WatchCursor, 100
return


WatchCursor:
MouseGetPos, xpos, ypos 
ClickX := Width - xpos
ClickY := Height - ypos


PixelGetColor, color, xpos, ypos, RGB


GetKeyState, state, F2
if state = D
{
Clipboard = `;The below 2 lines are for information purposes only and can be erased.`n`;Current Color: %color%`n`;Mouse Position: %xpos%, %ypos%`n`n`;The below line only needs to be used once in a script, first line!`nWinGetActiveStats, Title, Width, Height, X, Y`n`n`;The next 3 lines is the required code, Width and Height variables is determined by the WinGetActiveStats line (above)`nClickX := Width - %ClickX%`nClickY := Height - %ClickY%`nClick, `%ClickX`%, `%ClickY`%

MsgBox Mouse Position %xpos%, %ypos% has been converted to:`n`nClickX := Width - %ClickX%`nClickY := Height - %ClickY%`nClick, `%ClickX`%, `%ClickY`%`n`nThe converted code is now in the clipboard.`nPaste into Notepad with Ctrl+V at anytime. 
}

ToolTip, Windows Resolution: %A_ScreenWidth%x%A_ScreenHeight%`nActive Window Resolution: %Width%x%Height%`n`nColor: %color%`nMouse Position: %xpos% %ypos%`n`nClickX := Width - %ClickX%`nClickY := Height - %ClickY%
return