Jump to content

Write script run on different screen


Recommended Posts

I write my script on 4:3 screen, 17", screen resolution 1024x768. But when I run on 14" monitor and the 21", 16:9 screen, It dont run

Here's my code

Opt("MouseCoordMode", 0) 
Opt("PixelCoordMode", 0)

WinMove("Element Client","", -1, -1, 1026,743)


while 1

    if PixelSearch(470,600,513,636,0xFFE955) <> @error Then
        MouseClick("left",493,619)  ;--> Click (!)
        sleep(500)
        
        Select
        case PixelSearch(440,636,585,662,0xFFFFFF) <> @error 
            Do
                MouseClick("left",517,650)
                sleep(500)
                MouseClick("left",442,425)
                sleep(500)
            until PixelSearch(440,636,585,662,0xFFFFFF) = @error
        Case Else
            MouseClick("left",442,425)
            sleep(500)
        EndSelect
    EndIf
    
WEnd

Could any one help me!

Link to comment
Share on other sites

You can solve this problem with some basic math,

for example on your 1680x1050 screen the pixel with 474 as the X coordinate is at 286 on a 1024x768

here is how to do it:

1680:470 = 1024:x

x = 470*1024/1680, x is the value you need

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...