Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off
Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off
Check the Cmd Title meticulously letter by letter!
- tobsto occupied
- Posts: 186
- Joined: 20 Feb 2020, 09:34
- Contact:
Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off
yeah had one lower case in there , still wont continue on password login window tho even if focused from start
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
CoordMode, Mouse, Client
run, Devil May Cry 5_batch_mode_.bat, D:\Games\Steam
WinWaitActive, % Title:= "C:\Windows\system32\cmd ahk_exe cmd.exe",, 30
Sleep, 5000
ControlSend,, y, % Title ; alternative that works even if cmd is not active
sleep, 300
ControlSend,, {Enter}, % Title ; alternative that works even if cmd is not active
Sleep, 5000
WinWait, % Title:= "Steam Login ahk_exe Steam.exe"
SetTimer, PassWandLogin, 300
Return
PassWandLogin:
If WinActive(Title) {
Send, steam password
sleep, 300
Send, {Enter}
ExitApp
}
Return
Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off
Can you detect Edit controls with Spy tool in the Login window?
- tobsto occupied
- Posts: 186
- Joined: 20 Feb 2020, 09:34
- Contact:
Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off
what , why?
simply put this ahk script works but will not do said requested function of pausing on focus loss and continuing on refocus where it paused >
simply put this ahk script works but will not do said requested function of pausing on focus loss and continuing on refocus where it paused >
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
CoordMode, Mouse, Client
run, Devil May Cry 5_batch_mode_.bat, D:\Games\Steam
WinWaitActive, % Title:= "C:\Windows\system32\cmd ahk_exe cmd.exe",, 30
Sleep, 5000
ControlSend,, y, % Title ; alternative that works even if cmd is not active
sleep, 300
ControlSend,, {Enter}, % Title ; alternative that works even if cmd is not active
Sleep, 5000
WinWait, % Title:= "Steam Login ahk_exe Steam.exe",, 30
WinActivate, % Title
WinWaitActive, % Title,, 30
Send, my steam password
sleep, 300
Send, {Enter}
ExitApp
Last edited by tobsto occupied on 15 Jun 2020, 10:12, edited 1 time in total.
Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off
Looks like you don't need any help!
If you still do please answer the question and post screen shot with Login window and Spy tool when mouse is over Edit control, please!
[Edit] Additionally pleas do the following test:
1. Run the game so the Login window appears
2. Switch the focus to some other window
3. Switch the focus (manually) again to Login window
4. Can you now enter password ( via keyboard) without clicking the Login window edit control?
If you still do please answer the question and post screen shot with Login window and Spy tool when mouse is over Edit control, please!
[Edit] Additionally pleas do the following test:
1. Run the game so the Login window appears
2. Switch the focus to some other window
3. Switch the focus (manually) again to Login window
4. Can you now enter password ( via keyboard) without clicking the Login window edit control?
Last edited by rommmcek on 15 Jun 2020, 10:19, edited 1 time in total.
- tobsto occupied
- Posts: 186
- Joined: 20 Feb 2020, 09:34
- Contact:
Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off
hope this helps , not sure how tho , but ok , btw not sure what you mean with edit controls
https://www17.zippyshare.com/v/tzYYO8pW/file.html
p.s if i didnt need help i wouldn'tve opened up said thread
https://www17.zippyshare.com/v/tzYYO8pW/file.html
p.s if i didnt need help i wouldn'tve opened up said thread
Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off
Thanks! Please reread my last post. I edited it.
Edit control is portion of the window where you can enter password with the keyboard.
Edit control is portion of the window where you can enter password with the keyboard.
- tobsto occupied
- Posts: 186
- Joined: 20 Feb 2020, 09:34
- Contact:
Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off
ive done step 1-4 and yes password field is always autoselected no matter how many times focus is lost and regained since steam autoselects it on default if you have a saved account
Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off
There is Window Title mismatch: should be WinWait, % Title:= "Steam Login ahk_exe steam.exe",, 30
[Edit] Is Spy box "Control Under Mouse Position" always blank even if mouse cursor is over Password Edit control?
[Edit] Is Spy box "Control Under Mouse Position" always blank even if mouse cursor is over Password Edit control?
Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off
Please do one more test (I know it's tedious but there is no other way):
1. Run the game so the Login window appears
2. Run the following Ahk script: P.s.: Case shouldn't matter in ahk_exe portion of the Window Title, but just as a precaution!
1. Run the game so the Login window appears
2. Run the following Ahk script:
Code: Select all
run notepad.exe
sleep, 2000
WinActivate Steam Login ahk_exe steam.exe
WinWaitActive Steam Login ahk_exe steam.exe
Send, steam password
sleep, 300
Send, {Enter}
ExitApp
- tobsto occupied
- Posts: 186
- Joined: 20 Feb 2020, 09:34
- Contact:
Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off
ill try it out
@always blank question , yes it is
ok so this is how the script looks>
still after updating the steam title to as you specified still dont work
p.s tedious? fuck, to you? i can understand , this entire thing must be tedious and headache inducing as fuck , to me ? im willing to try out all variants till we get shit workin
@always blank question , yes it is
ok so this is how the script looks>
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
CoordMode, Mouse, Client
run, Devil May Cry 5_batch_mode_.bat, D:\Games\Steam
WinWaitActive, % Title:= "C:\Windows\system32\cmd ahk_exe cmd.exe",, 30
Sleep, 5000
ControlSend,, y, % Title ; alternative that works even if cmd is not active
sleep, 300
ControlSend,, {Enter}, % Title ; alternative that works even if cmd is not active
Sleep, 5000
WinWait, % Title:= "Steam Login ahk_exe steam.exe",, 30
SetTimer, PassWandLogin, 300
Return
PassWandLogin:
If WinActive(Title) {
Send, steam password
sleep, 300
Send, {Enter}
ExitApp
}
Return
p.s tedious? fuck, to you? i can understand , this entire thing must be tedious and headache inducing as fuck , to me ? im willing to try out all variants till we get shit workin
Last edited by tobsto occupied on 15 Jun 2020, 11:06, edited 1 time in total.
- tobsto occupied
- Posts: 186
- Joined: 20 Feb 2020, 09:34
- Contact:
Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off
yeah that one works>
but this one works too >
Code: Select all
run notepad.exe
sleep, 2000
WinActivate Steam Login ahk_exe steam.exe
WinWaitActive Steam Login ahk_exe steam.exe
Send, steam password
sleep, 300
Send, {Enter}
ExitApp
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
CoordMode, Mouse, Client
run, Devil May Cry 5_batch_mode_.bat, D:\Games\Steam
WinWaitActive, % Title:= "C:\Windows\system32\cmd ahk_exe cmd.exe",, 30
Sleep, 5000
ControlSend,, y, % Title ; alternative that works even if cmd is not active
sleep, 300
ControlSend,, {Enter}, % Title ; alternative that works even if cmd is not active
Sleep, 5000
WinWait, % Title:= "Steam Login ahk_exe Steam.exe",, 30
WinActivate, % Title
WinWaitActive, % Title,, 30
Send, my steam password
sleep, 300
Send, {Enter}
ExitApp
Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off
O.k.: There is a bug in PassWandLogin label. Wait a bit!
- tobsto occupied
- Posts: 186
- Joined: 20 Feb 2020, 09:34
- Contact:
Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off
no rush my dude , we just gettin started here , gotta get that script pause on focus loss and continue from where it left off at pause on refocus function goin and this tied for separate exes as well for example for steam.exe and dmc5.exe
Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off
I'm sorry!
You have to add #Persistent anywherebefore SetTimer, PassWandLogin, 300 (Edit due to Docs)
So it should look like this:
You have to add #Persistent anywhere
So it should look like this:
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#Persistent
run, Devil May Cry 5_batch_mode_.bat, D:\Games\Steam
WinWaitActive, % Title:= "C:\Windows\system32\cmd ahk_exe cmd.exe",, 30
Sleep, 5000
ControlSend,, y, % Title ; alternative that works even if cmd is not active
sleep, 300
ControlSend,, {Enter}, % Title ; alternative that works even if cmd is not active
Sleep, 5000
WinWait, % Title:= "Steam Login ahk_exe steam.exe"
SetTimer, PassWandLogin, 300
Return
PassWandLogin:
If WinActive(Title) {
Send, steam password
sleep, 300
Send, {Enter}
ExitApp
}
Return
Last edited by rommmcek on 15 Jun 2020, 11:40, edited 2 times in total.
- tobsto occupied
- Posts: 186
- Joined: 20 Feb 2020, 09:34
- Contact:
Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off
lols , you and your "!"
ill check it out asap...gimme a few
ill check it out asap...gimme a few
- tobsto occupied
- Posts: 186
- Joined: 20 Feb 2020, 09:34
- Contact:
Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off
ok so , ive tested it it now does wait till said steam login window is focused , BUT it still dont immediately pause the script as instantly as soon as focus is lost , ive tried by simply making sure as soon as steam login gets focused to click for example notepad so it loses focus, and the script will still continue execution and then exit itself , so not quite there yet, this thread has mainly been created due to a good friend that has noted this about ahk and scripts in general , that being why he dont like using them , since it could potentially wreak havoc , i told him there ought to be a solution and thus us being where where at, im just surprised this feature being so little sought after or even heard of, but i recon we can change that
imo should be a optional safety feature of course with exceptions for parts that need to run on unfocused processes etc.
imo should be a optional safety feature of course with exceptions for parts that need to run on unfocused processes etc.
Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off
Now are we where we already were. Try:[Edit]: Removed one redundant check.
[Edit2]: Added two more Window checks for Cmd.
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
run, Devil May Cry 5_batch_mode_.bat, D:\Games\Steam
WinWaitActive, % Title:= "C:\Windows\system32\cmd ahk_exe cmd.exe",, 30
Sleep, 5000
Gosub CheckWindow
ControlSend,, y, % Title ; alternative that works even if cmd is not active
sleep, 300
Gosub CheckWindow
ControlSend,, {Enter}, % Title ; alternative that works even if cmd is not active
Sleep, 5000
WinWait, % Title:= "Steam Login ahk_exe steam.exe"
Gosub CheckWindow
Send, steam password
sleep, 300
Gosub CheckWindow
Send, {Enter}
ExitApp
CheckWindow:
While !WinActive(Title)
Sleep, 100
Return
[Edit2]: Added two more Window checks for Cmd.
Last edited by rommmcek on 15 Jun 2020, 12:58, edited 2 times in total.
Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off
I hope above script works! [Edit]: To test it you can increase Sleep, 300 to e.g.: Sleep, 3000, so you can comfortably switch Window Focus!
More sophisticated way would be to monitor Login Window via Hook, which would stun your friend about what Ahk can do!
More sophisticated way would be to monitor Login Window via Hook, which would stun your friend about what Ahk can do!
- tobsto occupied
- Posts: 186
- Joined: 20 Feb 2020, 09:34
- Contact:
Re: Request for a script that autostops commands etc. on app focus loss and continue on refocus from where it left off
well its already better but it continues execution , doesnt pause the script till login window has focus again , once more the testing process i do>
steam login window gets launched , then i immediately focus to notepad to make it lose focus , then i refocus steam login window and immediately unfocus by focusing notepad again, BUT it inputs the password and enters into the login window in the background
what it should be doing is when steam login window is focused it continues execution of script but as soon as it loses focus it immediately pauses where its at , and only continues from where it paused at on refocus of said login window , this should be set indefinitely or until script has been fully successful , meaning when it reaches its end and all of the scripts content has been fully successfully executed , not partially or anything else
not sure if you need hook for this, i recon would need some sort of monitoring of sorts
steam login window gets launched , then i immediately focus to notepad to make it lose focus , then i refocus steam login window and immediately unfocus by focusing notepad again, BUT it inputs the password and enters into the login window in the background
what it should be doing is when steam login window is focused it continues execution of script but as soon as it loses focus it immediately pauses where its at , and only continues from where it paused at on refocus of said login window , this should be set indefinitely or until script has been fully successful , meaning when it reaches its end and all of the scripts content has been fully successfully executed , not partially or anything else
not sure if you need hook for this, i recon would need some sort of monitoring of sorts
Who is online
Users browsing this forum: imbelicalcord and 34 guests