Damastah Posted May 8, 2008 Posted May 8, 2008 How can I determine a mouse position so that I can use it in my script? I want to use it to get the window title of the window that is sequentially clicked on. E.G. A program to take down the title of the clicked window and take it down. I have the idea, but I have no knowledge of how to implement it. Thanx for any help.
monoceres Posted May 8, 2008 Posted May 8, 2008 How can I determine a mouse position so that I can use it in my script? I want to use it to get the window title of the window that is sequentially clicked on. E.G.A program to take down the title of the clicked window and take it down. I have the idea, but I have no knowledge of how to implement it. Thanx for any help.MouseGetPos(), read about it in the help file Broken link? PM me and I'll send you the file!
Andreik Posted May 8, 2008 Posted May 8, 2008 How can I determine a mouse position so that I can use it in my script? I want to use it to get the window title of the window that is sequentially clicked on. E.G. A program to take down the title of the clicked window and take it down. I have the idea, but I have no knowledge of how to implement it. Thanx for any help.$pos = MouseGetPos() MsgBox(0, "Mouse x,y:", $pos[0] & "," & $pos[1])
nonplayablecharacter Posted May 18, 2008 Posted May 18, 2008 how bout CODE; Options ;====================================== AutoItSetOption ( "ColorMode", 1 ) AutoItSetOption("WinTitleMatchMode", 3) AutoItSetOption("WinWaitDelay", 250) AutoItSetOption ("PixelCoordMode", 0) AutoItSetOption ("MouseCoordMode", 0) ;====================================== While 1 $a = MouseGetPos() $c = PixelGetColor ( $a[0] , ($a[1]-3) ) SplashTextOn("", "Relative to Block X,Y: " & FromBlockClickToSeq () & " -- Mouse Position X,Y: " & $a[0] & ", " & $a[1] & " -- Color: " & $c, 650, 25, 0, 0, 1, "", "","" ) Sleep (1000) Wend ;====================================================================== ; Relative to block click (green block, right up side) take first block ;====================================================================== Func FromBlockClickToSeq () $XYBlock = PixelSearch (5, 32, 798, 550, 65304, 0, 15) If Not @error Then $XBS = $XYBlock[0] $YBS = $XYBlock[1] Do $XBS = $XBS + 4 $ApixBS = PixelGetColor ($XBS, $YBS) Until $ApixBS <> 65304 Do $YBS = $YBS - 4 $ApixBS = PixelGetColor ($XBS, $YBS) Until $ApixBS <> 65304 If $XBS > 798 Then $XBS = 798 EndIf If $YBS > 550 Then $YBS = 550 EndIf If $XBS < 5 Then $XBS = 5 EndIf If $YBS < 32 Then $YBS = 32 EndIf $toto = MouseGetPos() $RelativeX = $toto[0] - $XBS $RelativeY = $toto[1] - $YBS Return $RelativeX & ", " & $RelativeY EndIf Return "Not visible" EndFunc You can always count on me for the dumb questions ;)My Scripts:Rikku
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now