Jump to content

Something wrong


Wolfshare
 Share

Recommended Posts

Hello, i'm geting problem, what wrong is here? :/

The Code:

FileDelete("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
Wend

And error: Posted Image

Link to comment
Share on other sites

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.

FileDelete("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
Link to comment
Share on other sites

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Okay, now?

FileDelete("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 by Wolfshare
Link to comment
Share on other sites

Okay

Cool. problem solved.

---

Burp

Naudoti Google vertėjas jei turite problemų svarstymą anglų pranešimus.

Edited 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

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

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

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?

Link to comment
Share on other sites

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 by Wolfshare
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...