Wolfshare Posted September 14, 2010 Share Posted September 14, 2010 Hello, i'm geting problem, what wrong is here? :/The Code:expandcollapse popupFileDelete("C:\Atsisiuntimai\asd.pdf") FileDelete("C:\Atsisiuntimai\asd.pdf.part") $i = 0 $x = 0 $r = 0 $t = 0 While $i <= 10 Do Run("Conexion.cmd") WinWaitActive("AOL 9.5 - Connected, Signed-On","",60) If WinExists("AOL 9.5 - Connected, Signed-On") Then $x = 1 Until $x = 1 If WinExists("Deposit file - Mozilla Firefox") Then Winactivate("Deposit file - Mozilla Firefox") EndIf WinActivate("Deposit file - Mozilla Firefox") sleep(500) MouseMove(198,589) MouseClick("left") MouseMove(31,60) MouseClick("left") MouseMove(258,429) MouseClick("left") sleep(500) MouseMove(268,589) MouseMove(663,589) Send("{CTRLDOWN}{PGDN}{CTRLUP}") sleep(500) Do sleep(1000) $t = $t + 1 Until (FileExists("C:\Atsisiuntimai\asd.pdf") And Not FileExists("C:\Atsisiuntimai\asd.pdf.part")) Or ($t = 60 And Not FileExists("C:\Atsisiuntimai\asd.pdf") And Not FileExists("C:\Atsisiuntimai\asd.pdf.part")) Or (WinExists("Atsiuntimo klaida")) If WinExists("Atsiuntimo klaida") Or WinExists("Restarting Aol") Then Do WinActivate("Atsiuntimo klaida") Or WinActivate("Restarting Aol") Until WinActive("Atsiuntimo klaida") Or Until WinActive("Restarting Aol") Send("{ENTER}") Send("{ENTER}") Send("{ENTER}") Send("{ENTER}") EndIf If WinExists("Deposit file - Mozilla Firefox") And Not WinActive("Deposit file - Mozilla Firefox") Then WinActivate("Deposit file - Mozilla Firefox") FileDelete("C:\Atsisiuntimai\asd.pdf") FileDelete("C:\Atsisiuntimai\asd.pdf.part") sleep(500) $x = 0 $r = 0 $t = 0 WendAnd error: Link to comment Share on other sites More sharing options...
Mat Posted September 14, 2010 Share Posted September 14, 2010 You use OR like that, only within statements designed to return True or False (While ..., Until ..., If .... Then etc.) Simply put it on another line like this: (I haven't tested the code so I have no idea if it works or not with the correction. expandcollapse popupFileDelete("C:\Atsisiuntimai\asd.pdf") FileDelete("C:\Atsisiuntimai\asd.pdf.part") $i = 0 $x = 0 $r = 0 $t = 0 While $i <= 10 Do Run("Conexion.cmd") WinWaitActive("AOL 9.5 - Connected, Signed-On", "", 60) If WinExists("AOL 9.5 - Connected, Signed-On") Then $x = 1 Until $x = 1 If WinExists("Deposit file - Mozilla Firefox") Then WinActivate("Deposit file - Mozilla Firefox") EndIf WinActivate("Deposit file - Mozilla Firefox") Sleep(500) MouseMove(198, 589) MouseClick("left") MouseMove(31, 60) MouseClick("left") MouseMove(258, 429) MouseClick("left") Sleep(500) MouseMove(268, 589) MouseMove(663, 589) Send("{CTRLDOWN}{PGDN}{CTRLUP}") Sleep(500) Do Sleep(1000) $t = $t + 1 Until (FileExists("C:\Atsisiuntimai\asd.pdf") And Not FileExists("C:\Atsisiuntimai\asd.pdf.part")) Or ($t = 60 And Not FileExists("C:\Atsisiuntimai\asd.pdf") And Not FileExists("C:\Atsisiuntimai\asd.pdf.part")) Or (WinExists("Atsiuntimo klaida")) If WinExists("Atsiuntimo klaida") Or WinExists("Restarting Aol") Then Do WinActivate("Atsiuntimo klaida") WinActivate("Restarting Aol") Until WinActive("Atsiuntimo klaida") Or Until WinActive("Restarting Aol") Send("{ENTER}") Send("{ENTER}") Send("{ENTER}") Send("{ENTER}") EndIf If WinExists("Deposit file - Mozilla Firefox") And Not WinActive("Deposit file - Mozilla Firefox") Then WinActivate("Deposit file - Mozilla Firefox") FileDelete("C:\Atsisiuntimai\asd.pdf") FileDelete("C:\Atsisiuntimai\asd.pdf.part") Sleep(500) $x = 0 $r = 0 $t = 0 WEnd AutoIt Project Listing Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 14, 2010 Moderators Share Posted September 14, 2010 Wolfshare,What does the error message tell you? "Illegal text at the end of a statement (one statement per line)"and the offending line is:WinActivate("Atsiuntimo klaida") Or WinActivate("Restarting Aol")You cannot use Or in this context, so just recast the code as 2 lines:WinActivate("Atsiuntimo klaida") WinActivate("Restarting Aol")You will have a similar problem with your Until line, which should read:Until WinActive("Atsiuntimo klaida") Or WinActive("Restarting Aol")The Devs have gone to a lot of trouble to give informative error messages - if the user takes the trouble to read them, of course. M23  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area  Link to comment Share on other sites More sharing options...
Wolfshare Posted September 14, 2010 Author Share Posted September 14, 2010 One more problem, you can see it on my picture.. It saying 'Atsiusintimo Klaida' - that means Download Error in Firefox.. In the script is writed WinActivate("Atsiuntimo klaida") WinActivate("Restarting Aol") Until WinActive("Atsiuntimo klaida") Or Until WinActive("Restarting Aol") Send("{ENTER}") Send("{ENTER}") Send("{ENTER}") Send("{ENTER}") But that is not make any sense.. It doesn't work.. :/ how can i fix that thing? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 14, 2010 Moderators Share Posted September 14, 2010 Wolfshare, Reread my post and ask yourself if: Until WinActive("Atsiuntimo klaida") Or Until WinActive("Restarting Aol") is how that line should be written. M23  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area  Link to comment Share on other sites More sharing options...
Wolfshare Posted September 14, 2010 Author Share Posted September 14, 2010 It Should be in another Line? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 14, 2010 Moderators Share Posted September 14, 2010 Wolfshare,If you actually read my post you would see that I suggest using: Until WinActive("Atsiuntimo klaida") Or WinActive("Restarting Aol")It is hard to help those who do not even read the advice given. M23  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area  Link to comment Share on other sites More sharing options...
Wolfshare Posted September 14, 2010 Author Share Posted September 14, 2010 (edited) Okay, now? expandcollapse popupFileDelete("C:\Atsisiuntimai\asd.pdf") FileDelete("C:\Atsisiuntimai\asd.pdf.part") $i = 0 $x = 0 $r = 0 $t = 0 While $i <= 10 Do Run("Conexion.cmd") WinWaitActive("AOL 9.5 - Connected, Signed-On", "", 60) If WinExists("AOL 9.5 - Connected, Signed-On") Then $x = 1 Until $x = 1 If WinExists("Deposit file - Mozilla Firefox") Then WinActivate("Deposit file - Mozilla Firefox") EndIf WinActivate("Deposit file - Mozilla Firefox") Sleep(500) MouseMove(198, 589) MouseClick("left") MouseMove(31, 60) MouseClick("left") MouseMove(258, 429) MouseClick("left") Sleep(500) MouseMove(268, 589) MouseMove(663, 589) Send("{CTRLDOWN}{PGDN}{CTRLUP}") Sleep(500) Do Sleep(1000) $t = $t + 1 Until (FileExists("C:\Atsisiuntimai\asd.pdf") And Not FileExists("C:\Atsisiuntimai\asd.pdf.part")) Or ($t = 60 And Not FileExists("C:\Atsisiuntimai\asd.pdf") And Not FileExists("C:\Atsisiuntimai\asd.pdf.part")) Or (WinExists("Atsiuntimo klaida")) If WinExists("Atsiuntimo klaida") Or WinExists("Restarting Aol") Then Do WinActivate("Atsiuntimo klaida") WinActivate("Restarting Aol") Until WinActive("Atsiuntimo klaida") Or WinActive("Restarting Aol") Send("{ENTER}") Send("{ENTER}") Send("{ENTER}") Send("{ENTER}") EndIf If WinExists("Deposit file - Mozilla Firefox") And Not WinActive("Deposit file - Mozilla Firefox") Then WinActivate("Deposit file - Mozilla Firefox") FileDelete("C:\Atsisiuntimai\asd.pdf") FileDelete("C:\Atsisiuntimai\asd.pdf.part") Sleep(500) $x = 0 $r = 0 $t = 0 WEnd Edited September 14, 2010 by Wolfshare Link to comment Share on other sites More sharing options...
MvGulik Posted September 14, 2010 Share Posted September 14, 2010 (edited) OkayCool. problem solved.---BurpNaudoti Google vertėjas jei turite problemų svarstymą anglų pranešimus. Edited September 14, 2010 by MvGulik "Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions.""The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014) "Believing what you know ain't so" ... Knock Knock ... Link to comment Share on other sites More sharing options...
Wolfshare Posted September 14, 2010 Author Share Posted September 14, 2010 Cool. problem solved.---BurpNaudoti Google vertėjas jei turite problemų svarstymą anglų pranešimus.Solved? I will not get the Error again?Thanks. Link to comment Share on other sites More sharing options...
MvGulik Posted September 14, 2010 Share Posted September 14, 2010 Solved? I will not get the Error again?Thanks.O dear. "Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions.""The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014) "Believing what you know ain't so" ... Knock Knock ... Link to comment Share on other sites More sharing options...
Wolfshare Posted September 15, 2010 Author Share Posted September 15, 2010 There is line: Until (FileExists("C:\Atsisiuntimai\asd.pdf") And Not FileExists("C:\Atsisiuntimai\asd.pdf.part")) Or ($t = 60 And Not FileExists("C:\Atsisiuntimai\asd.pdf") And Not FileExists("C:\Atsisiuntimai\asd.pdf.part")) Or (WinExists("Atsiuntimo klaida")) And example if there is two progress in Download Progress.. Like referendumus.pdf and asd.pdf How i should write code which will wait until winExist both files? Link to comment Share on other sites More sharing options...
Wolfshare Posted September 15, 2010 Author Share Posted September 15, 2010 I should use 'OR'? Link to comment Share on other sites More sharing options...
Wolfshare Posted September 15, 2010 Author Share Posted September 15, 2010 Can i get help? Link to comment Share on other sites More sharing options...
Mat Posted September 15, 2010 Share Posted September 15, 2010 Please don't bump like that, especially when we have already helped you a fair amount already, and definitely don't pm users trying to get them to read the topic again. All of the regulars that have replied to this thread are on often to see replies, but are also helping other people so may not get onto helping you straight away. I know for a fact that Melba keeps himself a very busy schedule, and somehow finds the time to write some nice code as well. From what I can see you have already used all the statements and functions you need to get that to work... What have you tried? AutoIt Project Listing Link to comment Share on other sites More sharing options...
Wolfshare Posted September 15, 2010 Author Share Posted September 15, 2010 (edited) Please don't bump like that, especially when we have already helped you a fair amount already, and definitely don't pm users trying to get them to read the topic again. All of the regulars that have replied to this thread are on often to see replies, but are also helping other people so may not get onto helping you straight away. I know for a fact that Melba keeps himself a very busy schedule, and somehow finds the time to write some nice code as well. From what I can see you have already used all the statements and functions you need to get that to work... What have you tried? That is statment and function only for 'asd.pdf' and dunno how to make another file 'eferendumus.pdf' It's restarts after the download complete downloading asd.pdf I want to make two downloads once.. But the script will restart after asd.pdf will be completed, and eferendumus.pdf will be canceled... Until (FileExists("C:\Atsisiuntimai\asd.pdf") And Not FileExists("C:\Atsisiuntimai\asd.pdf.part")) Or ($t = 60 And Not FileExists("C:\Atsisiuntimai\asd.pdf") And Not FileExists("C:\Atsisiuntimai\asd.pdf.part")) Or (WinExists("Atsiuntimo klaida")) Edited September 15, 2010 by Wolfshare Link to comment Share on other sites More sharing options...
Wolfshare Posted September 16, 2010 Author Share Posted September 16, 2010 Btw, for the timer... Or ($t = 60 And Not FileExists("C:\Atsisiuntimai\asd.pdf") What command i should use? because this doesnt work. Link to comment Share on other sites More sharing options...
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