Jump to content
Sign in to follow this  
shay

help with loops

Recommended Posts

shay

HI all

i start using loop in my testing script,

unfortunately i`m new to the loop commands,

the above script sometime work and sometime not

i want to do loop till find different text on window or timer expire,

for timer i use TimerInit + TimerDiff

any suggestion what did i do wrong or any improvement?

$timeout = IniRead($path, "General", "loop_wait", "297000")
$begin = TimerInit()
 Do
 $prepar = WinExists("LU", "Preparing file transfer")
    if $prepar = 1 then ExitLoop
    if WinExists("LU", "File transfer complete") then $compleat = "1"
    if WinExists("LU", "Error: LU not responding") then $notR = "1"
    if WinExists("LU0", "File transfer stopped") then $stop = "1"

        $dif = TimerDiff($begin)
        sleep(300)
        WinActivate("LU-30",'')
        ToolTip("Automation: Loop in progress", 20, 250)

 until $dif > $timeout Or $compleat = "1" or $notR = "1" or $stop = "1"
Edited by shay

"If the facts don't fit the theory, change the facts." Albert Einstein

Share this post


Link to post
Share on other sites
somdcomputerguy

What does $timeout equal? Or did miss that somewhere?


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites
shay

What does $timeout equal? Or did miss that somewhere?

$timeout = IniRead($path, "General", "loop_wait", "297000")

the $path lead to the DLL file


"If the facts don't fit the theory, change the facts." Albert Einstein

Share this post


Link to post
Share on other sites
AlmarM

IniRead a DLL file? Thats new to me :D

Edited by AlmarM

Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Share this post


Link to post
Share on other sites
shay

IniRead =INI

my bad! :D


"If the facts don't fit the theory, change the facts." Albert Einstein

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  

×