Your Friendly A.I Overlord Posted May 5, 2022 Share Posted May 5, 2022 28 minutes ago, JoeViking245 said: So what's happening is the script is still waiting [WinWait] for that to appear, so that it can then wait for it to close [WinWaitClose]... and then close itself [ExitApp]. @sirgubster9 JoeViking245 is correct. If you use incorrect window titles or class names in a script, the script keeps waiting for something that is never going to happen and gets stuck. I explained how you can look for window titles with AutoHotKey, but maybe easier is just looking at the window title bar. But anyway. I downloaded the Mashed Demo and the following script works for me. Mashed Demo: #NoEnv #SingleInstance SetTitleMatchMode, 3 SendMode Input SetWorkingDir %A_ScriptDir% WinWait, Select Controllers Sleep, 500 ControlSend, Button1, {Space}, Select Controllers WinWait, Select Video Mode Sleep, 500 ControlSend, Button1, {Space}, Select Video Mode WinWait, MASHED [D3D9] [Release] WinWaitClose ExitApp q::x w::y e::b $Esc:: { Send !{F4} } 4 minutes ago, JoeViking245 said: I've always used the exe instead of trying to figure the class thingy. Try changing your WinWait line to WinWait, ahk_exe mashed.exe I'm not sure if that is going to work when an executable opens multiple windows, like this game. If it's just one window than that would be the simplest solution. 1 1 Quote Link to comment Share on other sites More sharing options...
sirgubster9 Posted May 5, 2022 Author Share Posted May 5, 2022 33 minutes ago, JoeViking245 said: I've always used the exe instead of trying to figure the class thingy. Try changing your WinWait line to WinWait, ahk_exe mashed.exe works beautifully!!! This is awesome. I had no idea the window thing mattered, I did kind of see it happening and thats why i changed the control send window names, but i didnt put two and two together. Just using exe's names does seem easier. Quote Link to comment Share on other sites More sharing options...
sirgubster9 Posted May 5, 2022 Author Share Posted May 5, 2022 (edited) 51 minutes ago, Your Friendly A.I Overlord said: @sirgubster9 JoeViking245 is correct. If you use incorrect window titles or class names in a script, the script keeps waiting for something that is never going to happen and gets stuck. I explained how you can look for window titles with AutoHotKey, but maybe easier is just looking at the window title bar. But anyway. I downloaded the Mashed Demo and the following script works for me. Mashed Demo: #NoEnv #SingleInstance SetTitleMatchMode, 3 SendMode Input SetWorkingDir %A_ScriptDir% WinWait, Select Controllers Sleep, 500 ControlSend, Button1, {Space}, Select Controllers WinWait, Select Video Mode Sleep, 500 ControlSend, Button1, {Space}, Select Video Mode WinWait, MASHED [D3D9] [Release] WinWaitClose ExitApp q::x w::y e::b $Esc:: { Send !{F4} } I'm not sure if that is going to work when an executable opens multiple windows, like this game. If it's just one window than that would be the simplest solution. your way of doing things totally worked as well, and now I have two options for future endevaors. I had no clue that the window name for the game actually mattered. thank you!!! I just used your window thing on the next one and I think I finally kind of know what im doing espeically with copying and pasting your guys stuff ha ha thanks again. oh the only thing i dont understand is where this came from: "UnityWndClass" what is that? Edited May 5, 2022 by sirgubster9 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.