Sign in to follow this  
Followers 0
Yagel

Using WinWaitClose without pausing the script?

6 posts in this topic

#1 ·  Posted (edited)

Umm , yeah I'm doing a Shortcut trainer , and i really need help with it.

So this is my third thread and this is my problem:

The script running a game with the title "Game" ( but the process is different.. on every computer.. there is different client names. )

And i want it to see if the Title 'Game' is closed, so it can do something ..

and I'm using this command:

If WinWaitClose("Game") Then WinActivate("DXWnd")
'somecommand'
'somecommand'
'somecommand'

But while it waits, the GUI is paused , and i can't press any other button..

so there is any other command like WinWaitClose and i can use the Title ? not the process ?

Thanks from advanced again :)

Edited by Yagel

Share this post


Link to post
Share on other sites



Umm , yeah I'm doing a Shortcut trainer , and i really need help with it.

So this is my third thread and this is my problem:

The script running a game with the title "Game" ( but the process is different.. on every computer.. there is different client names. )

And i want it to see if the Title 'Game' is closed, so it can do something ..

and I'm using this command:

If WinWaitClose("Game") Then WinActivate("DXWnd")
'somecommand'
'somecommand'
'somecommand'

But while it waits, the GUI is paused , and i can't press any other button..

so there is any other command like WinWaitClose and i can use the Title ? not the process ?

Thanks from advanced again :)

In your main loop you can check to see if the window exists

while 1


$Msg = guigetmsg()
   switch $msg
     case $button1
      ;
     endswitch

   if not WinExists("Game") then something
wend

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Well.. this is what i did:

While 1


        $Msg = GUIGetMsg()
        Switch $Msg
            Case $okbutton
            ;
        EndSwitch
        If Not WinExists("Game") Then WinActivate("DXWnd")
                Sleep(100)
                MsgBox(0, "Please wait..", "Please wait, Closing DXWnd!, Wait 3 Seconds...", 3)
                Sleep(1000)
                Send("{DOWN}")
                Sleep(500)
                Send("{ALT}")
                Sleep(250)
                Send("{RIGHT}")
                Sleep(250)
                Send("{DOWN 3}")
                Sleep(250)
                Send("{ENTER}")
                Sleep(200)
                Send("{ALT}")
                Sleep(150)
                Send("{DOWN}")
                Sleep(150)
                Send("{ENTER}")

    WEnd

Um, and what it does after running the game, is just repeatedly doing the commands without stopping.

And, i tried putting the commands where you putted the ; , and all it does is WinActivate( "DXWnd " ) repeatedly.. with non stop..

Um? , how it supposed to be?

Edited by Yagel

Share this post


Link to post
Share on other sites

Well.. this is what i did:

While 1


        $Msg = GUIGetMsg()
        Switch $Msg
            Case $okbutton
            ;
        EndSwitch
        If Not WinExists("Game") Then WinActivate("DXWnd")
                Sleep(100)
                MsgBox(0, "Please wait..", "Please wait, Closing DXWnd!, Wait 3 Seconds...", 3)
                Sleep(1000)
                Send("{DOWN}")
                Sleep(500)
                Send("{ALT}")
                Sleep(250)
                Send("{RIGHT}")
                Sleep(250)
                Send("{DOWN 3}")
                Sleep(250)
                Send("{ENTER}")
                Sleep(200)
                Send("{ALT}")
                Sleep(150)
                Send("{DOWN}")
                Sleep(150)
                Send("{ENTER}")

    WEnd

Um, and what it does after running the game, is just repeatedly doing the commands without stopping.

And, i tried putting the commands where you putted the ; , and all it does is WinActivate( "DXWnd " ) repeatedly.. with non stop..

Um? , how it supposed to be?

I'm not quite sure what you need but maybe this helps.

$Step = 0

While 1


    $Msg = GUIGetMsg()
    Switch $Msg
        Case $okbutton
        ;
    EndSwitch
    
    If $Step = 0 Then
        If Not WinExists("Game") Then
            ToolTip("Please wait..", "Please wait, Closing DXWnd!, Wait 3 Seconds...",300,300)
            WinActivate("DXWnd")
            Sleep(100)
            Sleep(1000)
            Send("{DOWN}")
            Sleep(500)
            Send("{ALT}")
            Sleep(250)
            Send("{RIGHT}")
            Sleep(250)
            Send("{DOWN 3}")
            Sleep(250)
            Send("{ENTER}")
            Sleep(200)
            Send("{ALT}")
            Sleep(150)
            Send("{DOWN}")
            Sleep(150)
            Send("{ENTER}")
            $Step = 1
            ToolTip("")
        EndIf
    EndIf
    

WEnd

I changed the MsgBox to ToolTip because I thought the message boxe would not give what you wanted. It will wait for 3 seconds before carrying out the Sends, whereas the toolTip will be displayed while the Sends are being executed.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Omg :) its not working too.. what's the script supposed to do is open a program called DXWnd , after run a certain game, and with DXWnd the game is running at Window mode, but while the game is running the script is waiting for the Title 'Game' to close and all the GUI is on pause, and i can't press on any button's at all.. , so what i want it to do, is that i could use the GUI while playing , even if its waits for it to close..

is it possible at all?

This is my Button script:

Func _okbutton()
    Local $VALUE2 = IniReadSection(@ScriptDir & "\inputs.ini", "DXwndMS")
    If $VALUE2 = "" Or @error Then
        $VALUE2 = FileOpenDialog("Search your MapleStory client 1st", "C:\Nexon", "MapleStory Private Server Client (*.exe)", 1)
        If Not @error Then MsgBox(0, "Game is running", "Game is running sucessfully, Wait 2 Seconds please.", 3)
        IniWrite(@ScriptDir & "\inputs.ini", "DXwndMS", "Path", $VALUE2)
    EndIf

    Run(@ScriptDir & "\DXwnd\DXwnd.exe")
    WinWaitActive("DXWnd")
    WinActivate("DXWnd", "")
    Sleep(120)
    Send("{ALT}");From here it's writing the path of the game..
    Sleep(200)
    Send("{RIGHT}")
    Sleep(150)
    Send("{DOWN 4} {ENTER}")
    Sleep(200)
    Send($VALUE2) ; Until here...
    Sleep(300)
    Send("{TAB 2}") ; from here its chooses DirectX 8 checkbox..
    Sleep(150)
    Send("{DOWN 3} {ENTER}") ; and here it closes the settings of DXWnd..
    Sleep(1500)
    Run($VALUE2) ; from here its running the Game..
    Sleep(1000)
    FileDelete("C:\yaGz Trainer DXWND\inputs.ini") ; Delete the INI file so it will ask him for path again..
    Sleep(150)
    Sleep(3500)
    MouseClick("Left") ; from here is an AutoLogin ..
    MouseClick("Left")
    Sleep(2000)
    Send("{TAB 8}")
    Sleep(500)
    Send("yagzor{TAB}")
    Send("yagzor {ENTER}")
    Sleep(1200)
    MouseClick("Left", 242, 191, 4, 5)
    Sleep(1000)
    MouseClick("Left", 271, 326, 4, 5)
    Sleep(1000)
    MouseClick("Left", 253, 368, 4, 5) ; Until here...
$Step = 0

While 1


    $Msg = GUIGetMsg()
    Switch $Msg
        Case $okbutton
        ;
    EndSwitch
    
    If $Step = 0 Then
        If Not WinExists("MapleStory") Then ; This is supposed to wait until 'MapleStory' closes.
            ToolTip("Please wait..", "Please wait, Closing DXWnd!, Wait 3 Seconds...",300,300)
            WinActivate("DXWnd") ; activating DXWnd so it will come on screen.. after maplestory closed
            Sleep(100)
            Sleep(1000)
            Send("{DOWN}") ; From here its doing what it supposed to do after MapleStory closed.
            Sleep(500)
            Send("{ALT}")
            Sleep(250)
            Send("{RIGHT}")
            Sleep(250)
            Send("{DOWN 3}")
            Sleep(250)
            Send("{ENTER}")
            Sleep(200)
            Send("{ALT}")
            Sleep(150)
            Send("{DOWN}")
            Sleep(150)
            Send("{ENTER}") ; Until here..
            $Step = 1
            ToolTip("")
        EndIf
    EndIf
    

WEnd
EndFunc   ;==>_okbutton

Share this post


Link to post
Share on other sites

Omg :) its not working too.. what's the script supposed to do is open a program called DXWnd , after run a certain game, and with DXWnd the game is running at Window mode, but while the game is running the script is waiting for the Title 'Game' to close and all the GUI is on pause, and i can't press on any button's at all.. , so what i want it to do, is that i could use the GUI while playing , even if its waits for it to close..

is it possible at all?

This is my Button script:

Func _okbutton()
    Local $VALUE2 = IniReadSection(@ScriptDir & "\inputs.ini", "DXwndMS")
    If $VALUE2 = "" Or @error Then
        $VALUE2 = FileOpenDialog("Search your MapleStory client 1st", "C:\Nexon", "MapleStory Private Server Client (*.exe)", 1)
        If Not @error Then MsgBox(0, "Game is running", "Game is running sucessfully, Wait 2 Seconds please.", 3)
        IniWrite(@ScriptDir & "\inputs.ini", "DXwndMS", "Path", $VALUE2)
    EndIf

    Run(@ScriptDir & "\DXwnd\DXwnd.exe")
    WinWaitActive("DXWnd")
    WinActivate("DXWnd", "")
    Sleep(120)
    Send("{ALT}");From here it's writing the path of the game..
    Sleep(200)
    Send("{RIGHT}")
    Sleep(150)
    Send("{DOWN 4} {ENTER}")
    Sleep(200)
    Send($VALUE2) ; Until here...
    Sleep(300)
    Send("{TAB 2}") ; from here its chooses DirectX 8 checkbox..
    Sleep(150)
    Send("{DOWN 3} {ENTER}") ; and here it closes the settings of DXWnd..
    Sleep(1500)
    Run($VALUE2) ; from here its running the Game..
    Sleep(1000)
    FileDelete("C:\yaGz Trainer DXWND\inputs.ini") ; Delete the INI file so it will ask him for path again..
    Sleep(150)
    Sleep(3500)
    MouseClick("Left") ; from here is an AutoLogin ..
    MouseClick("Left")
    Sleep(2000)
    Send("{TAB 8}")
    Sleep(500)
    Send("yagzor{TAB}")
    Send("yagzor {ENTER}")
    Sleep(1200)
    MouseClick("Left", 242, 191, 4, 5)
    Sleep(1000)
    MouseClick("Left", 271, 326, 4, 5)
    Sleep(1000)
    MouseClick("Left", 253, 368, 4, 5) ; Until here...
$Step = 0

While 1


    $Msg = GUIGetMsg()
    Switch $Msg
        Case $okbutton
        ;
    EndSwitch
    
    If $Step = 0 Then
        If Not WinExists("MapleStory") Then ; This is supposed to wait until 'MapleStory' closes.
            ToolTip("Please wait..", "Please wait, Closing DXWnd!, Wait 3 Seconds...",300,300)
            WinActivate("DXWnd") ; activating DXWnd so it will come on screen.. after maplestory closed
            Sleep(100)
            Sleep(1000)
            Send("{DOWN}") ; From here its doing what it supposed to do after MapleStory closed.
            Sleep(500)
            Send("{ALT}")
            Sleep(250)
            Send("{RIGHT}")
            Sleep(250)
            Send("{DOWN 3}")
            Sleep(250)
            Send("{ENTER}")
            Sleep(200)
            Send("{ALT}")
            Sleep(150)
            Send("{DOWN}")
            Sleep(150)
            Send("{ENTER}") ; Until here..
            $Step = 1
            ToolTip("")
        EndIf
    EndIf
    

WEnd
EndFunc   ;==>_okbutton
Oh I see

While 1


        $Msg = GUIGetMsg()
        Switch $Msg
            Case $okbutton
            ;
        EndSwitch

        If $Step = 0 Then
        ; wait until 'MapleStory' closes.
            While WinExists("MapleStory")
                Sleep(100)
            WEnd
            
            ToolTip("Please wait..", "Please wait, Closing DXWnd!, Wait 3 Seconds...", 300, 300)
            WinActivate("DXWnd"); activating DXWnd so it will come on screen.. after maplestory closed
            Sleep(100)
            Sleep(1000)
            Send("{DOWN}"); From here its doing what it supposed to do after MapleStory closed.
            Sleep(500)
            Send("{ALT}")
            Sleep(250)
            Send("{RIGHT}")
            Sleep(250)
            Send("{DOWN 3}")
            Sleep(250)
            Send("{ENTER}")
            Sleep(200)
            Send("{ALT}")
            Sleep(150)
            Send("{DOWN}")
            Sleep(150)
            Send("{ENTER}"); Until here..
            $Step = 1
            ToolTip("")
        EndIf
        


    WEnd

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

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
Sign in to follow this  
Followers 0