lxxl Posted October 16, 2007 Posted October 16, 2007 (edited) Hello hello who can help me to write basic scrit to to job like this : check FileExists on drive R:\test.tx if not wait to connect drive R: after found file do some code i dont have idea how to put it in loop ... Many thx for help lxxl Edited October 16, 2007 by lxxl
herewasplato Posted October 16, 2007 Posted October 16, 2007 Welcome to the forum. Do Sleep(99) Until FileExists(..... ;other code here [size="1"][font="Arial"].[u].[/u][/font][/size]
LarryDalooza Posted October 16, 2007 Posted October 16, 2007 You could loop DriveStatus() also... Lar. AutoIt has helped make me wealthy
lxxl Posted October 17, 2007 Author Posted October 17, 2007 Welcome to the forum. Do Sleep(99) Until FileExists(..... ;other code here ha its great ) and very easy =]] many thx mate lxxl
lxxl Posted October 17, 2007 Author Posted October 17, 2007 ahh and one more. its possible to add some extra stop marker to skip DO and go to other section when 20 times try or 1 minute pass Do Sleep(99) Until FileExists("w:\") lxxl
lxxl Posted October 17, 2007 Author Posted October 17, 2007 ha always help file help ;DD Do Sleep(99) Until FileExists("w:\") $try = $try + 1 If $try = 100 Then ExitLoop
herewasplato Posted October 17, 2007 Posted October 17, 2007 Do Sleep(99) $try = $try + 1 If $try = 100 Then ExitLoop Until FileExists("w:\")oÝ÷ ÚÚºÚ"µÍÜ ÌÍÚHHHÈLÛY NJBY[Q^ÝÊ ][ÝÝÎÌLÉ][ÝÊH[^]ÛÜ^ [size="1"][font="Arial"].[u].[/u][/font][/size]
Recce Posted September 28, 2008 Posted September 28, 2008 Sorry to reopen this old topic. But what is the longest time this loop will wait? Do Sleep(99) $try = $try + 1 If $try = 100 Then ExitLoop Until FileExists("w:\") The loop is made by herewasplato from the post above. Thank you!
ChromeFan Posted September 28, 2008 Posted September 28, 2008 Sorry to reopen this old topic. But what is the longest time this loop will wait? Do Sleep(99) $try = $try + 1 If $try = 100 Then ExitLoop Until FileExists("w:\") The loop is made by herewasplato from the post above. Thank you! it will wait until the path really exists. Website: www.cerescode.comForum: www.forum.cerescode.comIRC: irc.freenode.net , Channel: #Ceres--------------------Autoit Wrappers, Great additions to your script (Must See) (By: Valuater)Read It Befor Asking Question Click Here...--------------------Join Monoceres's Forums http://www.monoceres.se--------------------There are three kinds of people: Those who make things happen, those who watch things happen, and those who ask, What happened? Casey Stengel
Recce Posted September 28, 2008 Posted September 28, 2008 (edited) Then what is the difference to this: Do Sleep(99) Until FileExists(..... ;other code here ? I am new to scripting... Edited September 28, 2008 by Recce
ChromeFan Posted September 28, 2008 Posted September 28, 2008 Then what is the difference to this: Do Sleep(99) Until FileExists(..... ;other code hereoÝ÷ ئì-¢Ç+bªê-{¥È^rKazëÞ¯/}Ã"$rݱú+ë,r®±¨¦êé¢Ç¬Êjv¥²h)¶¬jëh×6Do ;Sleep(0) Until FileExists(..... but it will use much process usage. Website: www.cerescode.comForum: www.forum.cerescode.comIRC: irc.freenode.net , Channel: #Ceres--------------------Autoit Wrappers, Great additions to your script (Must See) (By: Valuater)Read It Befor Asking Question Click Here...--------------------Join Monoceres's Forums http://www.monoceres.se--------------------There are three kinds of people: Those who make things happen, those who watch things happen, and those who ask, What happened? Casey Stengel
ProgAndy Posted September 28, 2008 Posted September 28, 2008 $try=0 Do Sleep(99) $try = $try + 1 If $try = 100 Then ExitLoop Until FileExists("w:\") This code from herewasplato waits ~ 100*100 ms -> 10 seconds *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes
herewasplato Posted September 28, 2008 Posted September 28, 2008 $try=0 Do Sleep(99) $try = $try + 1 If $try = 100 Then ExitLoop Until FileExists("w:\") This code from herewasplato waits ~ 100*100 ms -> 10 seconds Correct :-) ...but just to be clear, that code was a modification of what lxxl posted. I am not a big fan of using counters like $try = $try + 1 when a For/Next loop will work. See my post above for the For/Next version that I would use instead. [size="1"][font="Arial"].[u].[/u][/font][/size]
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now