Jump to content

Quick question about switching windows


magace
 Share

Recommended Posts

hello there I started messing with auto it a bit for a online game I play Diablo 2. Saddly I have to play on dialup I also bot on hc there So I created a script to stop my bots then disconnects dialup waits a brief time then connects dialup then it starts my bots back up. The script I wrote works "ok" but I think I have a better way of doing things I need to figure out how to make the script grab a specific window tab I have open named "D2NT Manager 3.1" In my script I have it move and just hit the X's to close the window I would like to grab the d2nt manager and shut them down from there (d2 always opens ontop)

Global $Paused 
HotKeySet("{END}", "TogglePause") 
HotKeySet("{HOME}", "Terminate") 

While 1 
    Sleep(300000) 
WEnd 

Func TogglePause() 
    $Paused = NOT $Paused 
    While $Paused 
        sleep(300000) 
        MouseClick("left", 789, 18)
        sleep(100)
                       ;these close the 2 d2s right now I put a few extra because it seems to lag there sometimes want do do away with all this.
                MouseClick("left", 789, 18)
                sleep(50)
                MouseClick("left", 789, 18)
                MouseClick("left", 789, 18)
                MouseClick("left", 211, 104)
                MouseClick("left", 316, 294)
                MouseClick("left", 216, 172)
                MouseClick("left", 316, 294)
                MouseClick("right", 744, 20)
                MouseClick("left", 669, 35)
                sleep(5000)
                MouseClick("right", 744, 20)
                MouseClick("left", 669, 35)
                MouseClick("left", 251, 525)
                sleep(90000)
                MouseClick("left", 270, 94)
                MouseClick("left", 233, 290)
                sleep(500)
                ; I currently alt tab here once after loading first bot to bring d2ntmanager to top.
        Send("{alt down}")
        Send("{TAB}")   
        Send("{alt up}")
        sleep(500)

    
                MouseClick("left", 215, 171)
                MouseClick("left", 233, 290)

    WEnd 
EndFunc 

Func Terminate() 
    Exit 0 
EndFunc

So basicaly I want to re do most of it and have the script alt tab to the d2nt manager window at start of script then shut down bots reconnect and start all back up. cant seem to figure out how to change to specific window! any help be appreciated much. Thanks alot - magace

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