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
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...
  
 +
;Below 2 lines simply tells you what your current Windows Screen resolution is
 
WinResX := Width - 8
 
WinResX := Width - 8
 
WinResY := Height + 22
 
WinResY := Height + 22
  
; This example allows you to move the mouse around to see
+
 
; the title of the window currently under the cursor:
 
 
#Persistent
 
#Persistent
 
SetTimer, WatchCursor, 100
 
SetTimer, WatchCursor, 100
Line 22: Line 23:
 
{
 
{
 
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 = `;Mouse Position: %xpos%, %ypos%`nClickX := Width - %ClickX%`nClickY := Height - %ClickY%`nClick, `%ClickX`%, `%ClickY`%
 
Clipboard = `;Mouse Position: %xpos%, %ypos%`nClickX := Width - %ClickX%`nClickY := Height - %ClickY%`nClick, `%ClickX`%, `%ClickY`%
 
}
 
}

Revision as of 01:18, 9 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...

;Below 2 lines simply tells you what your current Windows Screen resolution is
WinResX := Width - 8
WinResY := Height + 22


#Persistent
SetTimer, WatchCursor, 100
return


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 = `;Mouse Position: %xpos%, %ypos%`nClickX := Width - %ClickX%`nClickY := Height - %ClickY%`nClick, `%ClickX`%, `%ClickY`%
}

ToolTip, Windows Resolution: %WinResX%x%WinResY%`nActive Window Resolution: %Width%x%Height%`n`nMouse Position: %xpos% %ypos%`n`nCode that works in any resolution:`nClickX := Width - %ClickX%`nClickY := Height - %ClickY%
return