lxxl 0 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 Share this post Link to post Share on other sites
herewasplato 3 Posted October 16, 2007 Welcome to the forum. Do Sleep(99) Until FileExists(..... ;other code here [size="1"][font="Arial"].[u].[/u][/font][/size] Share this post Link to post Share on other sites
LarryDalooza 42 Posted October 16, 2007 You could loop DriveStatus() also... Lar. AutoIt has helped make me wealthy Share this post Link to post Share on other sites
lxxl 0 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 Share this post Link to post Share on other sites
lxxl 0 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 Share this post Link to post Share on other sites
lxxl 0 Posted October 17, 2007 ha always help file help ;DD Do Sleep(99) Until FileExists("w:\") $try = $try + 1 If $try = 100 Then ExitLoop Share this post Link to post Share on other sites
herewasplato 3 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] Share this post Link to post Share on other sites
Recce 0 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! Share this post Link to post Share on other sites
ChromeFan 0 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 Share this post Link to post Share on other sites
Recce 0 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 Share this post Link to post Share on other sites
ChromeFan 0 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 Share this post Link to post Share on other sites
ProgAndy 88 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 Share this post Link to post Share on other sites
herewasplato 3 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] Share this post Link to post Share on other sites