Jump to content

Stupid Damn Window Stay Focused!


Recommended Posts

When I double click the au3, d2 pops up but the mouse cursor is still white with an hour glass. When the first CLICK happens, the focus changes from d2 to the my computer underneath it. then it switches back and ismessed up because it didn't get that click.

How can I switch to D2 and work only in that window?

This is the latest failed version:

.....
        WinActivate("Diablo II")
        WinWaitActive("Diablo II")
        WinMove("Diablo II", "", 0, 0)
        WinSetOnTop ("Diablo II", "", 1)
        Sleep(1000)
        WinActivate("Diablo II")
        WinWaitActive("Diablo II")
        Sleep(100)

    WinActivate("Diablo II")
    Send("{ESC}")
    Sleep(10)
    WinActivate("Diablo II")
    Send("{ESC}")
    sleep(10)
    WinActivate("Diablo II")
    MouseClick ("left", 400, 340, 1, 9) ;this click goes back to the program behindd2....
    sleep(10)
    WinActivate("Diablo II")
    MouseClick ("left", 400, 300, 1, 9);now d2 is actually active.....
    sleep(10)
    WinActivate("Diablo II")
    MouseClick ("left", 400, 270, 1,9);
    sleep(10)
    WinActivate("Diablo II")
    Send("i")
    sleep(10)
    WinActivate("Diablo II")

........

and for another question, There are 4 possible screen resolutions forD2, which means between 3 and 4 different coordinates for each click (some overlap). Is there some easy way to tell if they are windowed 800, windowed 640, full 800 or full 640, without running the program myself and without asking the user? I find both methods tacky. Far as I can tell the OCR is too unreliable because everyone has different colors showing..

Link to comment
Share on other sites

maybe

MouseClick ("left", 400, 340, 2, 9)

and to get the window size

@DesktopHeight

Height of the desktop screen in pixels. (vertical resolution)

@DesktopWidth

Width of the desktop screen in pixels. (horizontal resolution)

8)

doesn't work as doubleclick, any other ideas?

I'll look into the desktop height but that sound like it would check the desktop height. I want to know if their diablo is 640 or 800 and windowed or not, which has nothing to do with the desktop settings.

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...