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
< User:Cegaiel | Macros
Jump to navigationJump to search (New page: <pre> WinGetActiveStats, Title, Width, Height, X, Y MsgBox Hover mouse over a position that will be clicked.`nPress the F1 key to copy the code into Clipboard.`n`nClick OK to continue... ...) |
|||
Line 1: | Line 1: | ||
<pre> | <pre> | ||
WinGetActiveStats, Title, Width, Height, X, Y | WinGetActiveStats, Title, Width, Height, X, Y | ||
− | MsgBox Hover mouse over a position that will be clicked.`nPress the | + | 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 | WinResX := Width - 8 | ||
Line 25: | Line 25: | ||
ClickY := Height - ypos | ClickY := Height - ypos | ||
− | GetKeyState, state, | + | GetKeyState, state, F2 |
if state = D | if state = D | ||
{ | { |
Revision as of 03:24, 8 January 2010
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... WinResX := Width - 8 WinResY := Height + 22 ; This example allows you to move the mouse around to see ; the title of the window currently under the cursor: #Persistent SetTimer, WatchCursor, 100 return ;Now subtract 1032-550=482 and 746-431=315 ;Now we set new variables like this: ;ClickWidth := Width - 482 ;ClickHeight := Height - 315 WatchCursor: MouseGetPos, xpos, ypos ClickX := Width - xpos ClickY := Height - ypos GetKeyState, state, F2 if state = D { 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% return