Docfxit

Coordinates of a button

16 posts in this topic

#1 ·  Posted

This script created by Varian is getting an error saying Obfuscator support has been discontinued and replaced by Au3Stripper.

He said:

To help you with the coordinates, use this script and browse over the button or area that you wish to be clicked. Exit the script by pressing the Escape key. The information displayed on the exiting message box will be copied to the clipboard for you to paste into a text editor so that you can use it. Just make sure that you use the correct MouseCoord option (window/client). you should also make sure that the window size remains constant...this can be handled using the WinMove() function.

Has anyone converted it to Au3Stripper or can you convert it?

#region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=\\TEST-PC\D$\Icons\Intellipoint-010.ico
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_Res_Fileversion=1.0.0.0
#AutoIt3Wrapper_Res_LegalCopyright=Created by Varian L.Styles
#AutoIt3Wrapper_Run_AU3Check=n
#AutoIt3Wrapper_Run_Obfuscator=y
#Obfuscator_Parameters=/striponly
#endregion ;**** Directives created by AutoIt3Wrapper_GUI ****
Opt('PixelCoordMode', 2)
Opt('MouseCoordMode', 2)
Opt('TrayIconDebug', 1)
Opt('TrayAutoPause', 0)

#include <Misc.au3>
_Singleton(@ScriptName, 0)
ProcessSetPriority(@AutoItPID, 0)
Global $wPos, $mPos, $mClientPos, $mWindowPos, $Text, $wTitle, $Color

HotKeySet('{ESC}', '_Quit')

While 1
    Mouse_Coords()
    ;Sleep(10)
WEnd

Func _Quit()
    ToolTip('')
    $Text &= 'Mouse Position/Desktop: ' & $$mPos[0] & ',' & $$mPos[1] & @CRLF
    $Text &= 'Mouse Position/Window: ' & $mWindowPos[0] & ',' & $mWindowPos[1] & @CRLF
    $Text &= 'Mouse Position/Client: ' & $mClientPos[0] & ',' & $mClientPos[1] & @CRLF
    $wPos = WinGetPos('[ACTIVE]', '')
    $wTitle = StringLeft(WinGetTitle('[ACTIVE]', ''), 15)
    $Text &= '"' & $wTitle & '" Top-Left Coords: ' & $wPos[0] & ',' & $wPos[1] & @CRLF
    $Text &= '"' & $wTitle & '" Window Size: ' & $wPos[2] & ',' & $wPos[3] & @CRLF
    $Text &= 'Color: ' & Hex(PixelGetColor($mClientPos[0], $mClientPos[1]), 6)
    ClipPut($Text)
    MsgBox(0, 'Mouse Position Results', $Text)
    Exit
EndFunc   ;==>_Quit

Func Mouse_Coords()
    Local $String
    Opt('MouseCoordMode', 1)
    $mPos = MouseGetPos()
    Opt('MouseCoordMode', 0)
    $mWindowPos = MouseGetPos()
    Opt('MouseCoordMode', 2)
    $mClientPos = MouseGetPos()
    $Color = 'Hex Color: ' & Hex(PixelGetColor($mClientPos[0], $mClientPos[1]), 6)
    $String &= 'Window Title: ' & StringLeft(WinGetTiTle('[ACTIVE]'), 25) & @LF
    $String &= 'Desktop X: ' & $mPos[0] & ' Y: ' & $mPos[1] & @LF
    $String &= 'Window X: ' & $mWindowPos[0] & ' Y: ' & $mWindowPos[1] & @LF
    $String &= 'Client X: ' & $mClientPos[0] & ' Y: ' & $mClientPos[1] & @LF
    ToolTip($String & $Color)
EndFunc   ;==>Mouse_Coords

Thanks,

Docfxit

Share this post


Link to post
Share on other sites



#3 ·  Posted

This works without the Obfuscator, and, correcting the syntax from"$$" to "$", twice.

Pressing "F1" while the cursor is over "#Au3Stripper_Parameters=" in SciTE will explain the parameters used.

#region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=\\TEST-PC\D$\Icons\Intellipoint-010.ico
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_Res_Fileversion=1.0.0.0
#AutoIt3Wrapper_Res_LegalCopyright=Created by Varian L.Styles
#AutoIt3Wrapper_Run_AU3Check=n
;#AutoIt3Wrapper_Run_Obfuscator=y
;#Obfuscator_Parameters=/pe/sf/mo/rm
#AutoIt3Wrapper_Run_Au3Stripper=y  ; Default is n
#Au3Stripper_Parameters=/pe/sf/mo/rm
#endregion ;**** Directives created by AutoIt3Wrapper_GUI ****

#include <Misc.au3>

Opt('PixelCoordMode', 2)
Opt('MouseCoordMode', 2)
Opt('TrayIconDebug', 1)
Opt('TrayAutoPause', 0)

_Singleton(@ScriptName, 0)
ProcessSetPriority(@AutoItPID, 0)
Global $wPos, $mPos, $mClientPos, $mWindowPos, $Text, $wTitle, $Color

HotKeySet('{ESC}', '_Quit')

While 1
    Mouse_Coords()
    ;Sleep(10)
WEnd

Func _Quit()
    ToolTip('')
    $Text &= 'Mouse Position/Desktop: ' & $mPos[0] & ',' & $mPos[1] & @CRLF
    $Text &= 'Mouse Position/Window: ' & $mWindowPos[0] & ',' & $mWindowPos[1] & @CRLF
    $Text &= 'Mouse Position/Client: ' & $mClientPos[0] & ',' & $mClientPos[1] & @CRLF
    $wPos = WinGetPos('[ACTIVE]', '')
    $wTitle = StringLeft(WinGetTitle('[ACTIVE]', ''), 15)
    $Text &= '"' & $wTitle & '" Top-Left Coords: ' & $wPos[0] & ',' & $wPos[1] & @CRLF
    $Text &= '"' & $wTitle & '" Window Size: ' & $wPos[2] & ',' & $wPos[3] & @CRLF
    $Text &= 'Color: ' & Hex(PixelGetColor($mClientPos[0], $mClientPos[1]), 6)
    ClipPut($Text)
    MsgBox(0, 'Mouse Position Results', $Text)
    Exit
EndFunc   ;==>_Quit

Func Mouse_Coords()
    Local $String
    Opt('MouseCoordMode', 1)
    $mPos = MouseGetPos()
    Opt('MouseCoordMode', 0)
    $mWindowPos = MouseGetPos()
    Opt('MouseCoordMode', 2)
    $mClientPos = MouseGetPos()
    $Color = 'Hex Color: ' & Hex(PixelGetColor($mClientPos[0], $mClientPos[1]), 6)
    $String &= 'Window Title: ' & StringLeft(WinGetTiTle('[ACTIVE]'), 25) & @LF
    $String &= 'Desktop X: ' & $mPos[0] & ' Y: ' & $mPos[1] & @LF
    $String &= 'Window X: ' & $mWindowPos[0] & ' Y: ' & $mWindowPos[1] & @LF
    $String &= 'Client X: ' & $mClientPos[0] & ' Y: ' & $mClientPos[1] & @LF
    ToolTip($String & $Color)
EndFunc   ;==>Mouse_Coords

 

1 person likes this

Share this post


Link to post
Share on other sites

#4 ·  Posted

Malkey

 

That is really super.  That will help in many situations.

Thanks a bunch,

Docfxit

Share this post


Link to post
Share on other sites

#5 ·  Posted

junkew

 

I wanted to get it running.  I also tried for hours to get au3_uiautomation-master to work.  I couldn't figure it out for the life of me.

I downloaded it.  I tried to run spy.au3.  The browse tool does come up. After I drag it to the button and let go of the mouse nothing happens.

Thanks,

Docfxit

Share this post


Link to post
Share on other sites

#7 ·  Posted

Thanks for the reply...

I'm getting an error with Inspect.exe.  I'm guessing it is looking for a 64bit ver.  I am running a 32bit ver of Win7.

Where can I download the 32bit version?

Thank you,

Docfxit

Share this post


Link to post
Share on other sites

#8 ·  Posted

On 7/5/2017 at 0:50 PM, junkew said:

Try inspect.exe in windows sdk.

Did you try simplespy? Then you have to press ctrl w

I tried Spy.au3.  I couldn't fine simplespy.

Thanks,

Docfxit

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

10 hours ago, junkew said:

Thanks for the link to the search for Simplespy.  I haven't been successful in finding simplespy.au3 .  I did find the page:

It does say on post #1 " Simple spy demo (see simplespy.au3 or use latest ZIP  attachment for latest version) "

I can't find the ZIP file.  Is the zip file called simplespy or is it called something else.

When I select " Quickstart - Getting started quickly "

It takes me to post #3.  It says " Start simplespy.au3"  It doesn't say where to download it.

I have been searching for simplespy.au3 for days. 

While it is really great to learn how to search for something relating to AutoIt, I just can't find the download.

I also can't find the download for Inspect.exe 32bit.  Does it exist some where?  Or is there only a 64bit version?

Please provide me a link directly to the download so I can figure out why I am having a hard time locating it.

Thank you,

Docfxit

Edited by Docfxit

Share this post


Link to post
Share on other sites

#12 ·  Posted

What is the name of the zip file?

I have read your link on FAQ 31.  I can't find the zip file that has simplespy.au3

On that page I have searched all links with zip in it.  Which file is the one with Simplespy.au3?

Thanks,

Docfxit

Share this post


Link to post
Share on other sites

#15 ·  Posted

I found in order to run simplespy.au3 you must have UIAwrappers.au3 and CUIAutomation2.au3 in the same folder as simplespy.au3.

I found those located in the au3_uiautomation-master folder. 

When I run it, I get: Error Unknown function name: $uia_classnamepropertyid.

Does anyone know where I can find that function?

Thank you,

Docfxit

Share this post


Link to post
Share on other sites

#16 ·  Posted

you have to use both zips as is in post #1 as previously given attached to the bottom of post #1 just like any attachments are at the end of a post. 

They contain the library and the examples as 1 package that belongs to each other otherwise you can get strange behaviour.

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Similar Content

    • Fuzy
      By Fuzy
      #include<img/img.au3>
      #include <AutoItConstants.au3>
      Func Skype()
      $coords = imageSearch(0,0,-1,-1,"Skype.PNG")
      MouseMove($coords[0],$coords[1])
      [when it find the skype icon i want it to move from these coordinates, but of insted of moving to an expecific coordinate i want it to move down from these coordinates, (there is multiple images so i cant move to an specific image)] -- Kinda having trouble telling what i want cuz english isnt my first language, sorry about that. ;X
      MouseClick($MOUSE_CLICK_LEFT)
    • ags911
      By ags911
      I have a script that has to work on multiple resolutions but each resolution has slightly different co-ordinates due to automatic UI scaling. I have had to make separate files for each but would like to implement them all in one script. I have a similar program written for Java which uses else if statements to use different co-ordinates for each resolution after it has been detected. I'm not good with Java so I would like to implement this on AutoIt before later making a Java version.
       
      This is a snippet of the autoit code I have.
      ToolTip("1 - Search")
      MouseClick("Left", @DesktopWidth *0.823, @DesktopHeight *0.925, 1, 25)
      ToolTip("2 - Buy Now")
      MouseClick("Left", @DesktopWidth *0.83, @DesktopHeight *0.798, 1, 27)
      ToolTip("3 - OK")
      MouseClick("Left", @DesktopWidth *0.555, @DesktopHeight *0.596, 1, 15)
      ToolTip("4 - OK Clear Error")
      MouseClick("Left", @DesktopWidth *0.49, @DesktopHeight *0.597, 1, 30)
      ToolTip("5 - Back to Search")
      MouseClick("Left", @DesktopWidth *0.161, @DesktopHeight *0.108, 1, 15)
       
      This is a snippet of a java code I used.
      Thanks.
      private static void goToSearch(double maxX, double maxY, Robot bot) throws InterruptedException {     int currentX = 0;     int currentY = 0;     if (maxX == 2650 && maxY == 1440) {         currentX = 734;         currentY = 1316;     } else if (maxX == 1920 && maxY == 1200) {         currentX = 551;         currentY = 1096;     } else if (maxX == 1920 && maxY == 1080) {         currentX = 551;         currentY = 1042;     } else if (maxX == 1680 && maxY == 1050) {         currentX = 482;         currentY = 959;     } else if (maxX == 1440 && maxY == 900) {         currentX = 413;         currentY = 822;     } else if (maxX == 1366 && maxY == 768) {         currentX = 392;         currentY = 741;     } else if (maxX == 1280 && maxY == 800) {         currentX = 367;         currentY = 731;
    • Sandy89
      By Sandy89
      I am trying to drag and drop an item from listview on one side to the parent element in workspace. From list view I selected the text which I want to drag, but  I need to get the coordinates of the selected text.
      I thought of using MouseClickDrag command. is there any other way to do this?
       
    • Mr_Was_geht_sie_das_an
      By Mr_Was_geht_sie_das_an
      Hi,
      i wanna creat an _Imagesearch / Mousemove script for an 3D/FPS Game and have Problems with the mousemove.
       
      In the game like Curveball(2D) its still works but in games like Battlefield (3D) are the absolute coordinates not really helpfull.
      Someone have an idea or an Example for me ?
       
       
       
    • PEscobar
      By PEscobar
      Can I make it so that when I put MouseClick("left", 300, 200), it will click those coordinates on a window so if I run it on a different computer or move the window, it will still click on the same spot.