Sign in to follow this  
Followers 0
ardak2000

Help with a Loop

4 posts in this topic

Hey guys.

I've got a script designed to wait for a window to pop up and then press the requisite button to get the window to go away. This should be a very easy task to perform, but for some reason I cannot get this script to loop infinitely.  I've tried variations of all of AutoIts Loop commands, but no matter what I try the best I can do is to get it to work just once. What am I doing wrong? Here's the script in it's current iteration.

While True
$win = WinWait("DFX Message", "OK")
    ControlClick($win, "", "[CLASS:Button; INSTANCE:1]")
    WinWaitClose($win)
ContinueLoop
WEnd
 
Thanks,
 
Ardak

Share this post


Link to post
Share on other sites



 

Hey guys.

I've got a script designed to wait for a window to pop up and then press the requisite button to get the window to go away. This should be a very easy task to perform, but for some reason I cannot get this script to loop infinitely.  I've tried variations of all of AutoIts Loop commands, but no matter what I try the best I can do is to get it to work just once. What am I doing wrong? Here's the script in it's current iteration.

While True
$win = WinWait("DFX Message", "OK")
    ControlClick($win, "", "[CLASS:Button; INSTANCE:1]")
    WinWaitClose($win)
ContinueLoop
WEnd
 
Thanks,
 
Ardak

 

 

I like to be aggressive with mine.

:alien:

While 1
sleep(90)
winkill("DFX Message", "OK")
WEnd

if @error Then
	MsgBox(262192,"",@ComputerName&" slaps "&@UserName&" around a bit with a large trout!")
	EndIf

>Exit code: 0

REAL search results

"Yeah yeah yeah, patience. How long will that take?"  -Ed Gruberman

Share this post


Link to post
Share on other sites

Hi, ardak2000. Try taking the WinWaitClose and the ContinueCase out, and see what that does for you. Also, put in a Debug option at the top of your script so you can see what line the script is hanging on:

Opt("TrayIconDebug", 1)
1 person likes this

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

 

Hi, ardak2000. Try taking the WinWaitClose and the ContinueCase out, and see what that does for you. Also, put in a Debug option at the top of your script so you can see what line the script is hanging on:

Opt("TrayIconDebug", 1)

 

holy cow JLogan3o13, that option is going to save me SOOOOO MUCH trouble from here on out, i sure wish i had known about that for the past 4 years instead of putting message boxes everywhere while "debugging" just to see where my script was hanging.

:alien:


if @error Then
	MsgBox(262192,"",@ComputerName&" slaps "&@UserName&" around a bit with a large trout!")
	EndIf

>Exit code: 0

REAL search results

"Yeah yeah yeah, patience. How long will that take?"  -Ed Gruberman

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