Jump to content

programs stop early


 Share

Recommended Posts

I have several recorded programs which only run for a littel bit and just stop. I have loops in there which ran in the past when I wanted this all night long but now they just stop after 2 or 3 times. Any idea what's happening here. The message I get is

AU3Check ended.rc:0

and Exit code:   0

Link to comment
Share on other sites

We can only speculate without your script.  We would also need the reason for exiting the loop, or failing, or blowing up.

Any advice anyone gives you will be a waste of time without more info.  We can't see through your eyes, or read minds.

Edited by jdelaney
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Link to comment
Share on other sites

here it is:

; Set the Escape hotkey to terminate the script.
HotKeySet("{ESC}", "_Terminate")
$var1=0

While $var1<25
    MouseClick("left",1129,601,1)
    MouseClick("left",1128,584,1)
    MouseClick("left",1128,566,1)
    MouseMove(1133,551)
    MouseDown("left")
    MouseMove(1136,551)
    MouseUp("left")
    MouseClick("left",1134,537,1)
    Sleep(1000)
    MouseClick("left",1133,518,1)
    Sleep(1000)
    MouseClick("left",1129,496,1)
    Sleep(27000)
    $var1=$var1+1
WEnd


Func _Terminate()
    Exit

Link to comment
Share on other sites

I assure you that your script will run through the loop exactly 25 times without fail.

But, since you are doing actions that provide no feedback, you are probably correct that it only runs what you think is 'successfully' a few times.

What are you automating...use the win* and control* or _ie* functions to more reliable 'do' what you need to do.

Edited by jdelaney
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Link to comment
Share on other sites

If you want it to run forever, don't constrain the loop...just do a:

While True
Wend

Or, delete the increment to the counter at the end of the loop.

Edited by jdelaney
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Link to comment
Share on other sites

....

While True
    MouseClick("left",1129,601,1)
    MouseClick("left",1128,584,1)
    MouseClick("left",1128,566,1)
    MouseMove(1133,551)
    MouseDown("left")
    MouseMove(1136,551)
    MouseUp("left")
    MouseClick("left",1134,537,1)
    Sleep(1000)
    MouseClick("left",1133,518,1)
    Sleep(1000)
    MouseClick("left",1129,496,1)
    Sleep(27000)

WEnd

This runs FOREVER...if your response is 'it only does it a few times', then you better elaborate on what you are automating and what "IT" is!!

Edited by jdelaney
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Link to comment
Share on other sites

It's logically impossible for my EXACT script I provided you to run only 3 times.  Unless the clicks happen to hit something on the scite window that stops the script execution.

...Maybe you have a virus scanner that is killing your script execution.

Edited by jdelaney
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Link to comment
Share on other sites

Try this:

; Set the Escape hotkey to terminate the script.
HotKeySet("{ESC}", "_Terminate")

for $i = 1 to 25
    MouseClick("left",1129,601,1)
    MouseClick("left",1128,584,1)
    MouseClick("left",1128,566,1)
    MouseMove(1133,551)
    MouseDown("left")
    MouseMove(1136,551)
    MouseUp("left")
    MouseClick("left",1134,537,1)
    Sleep(1000)
    MouseClick("left",1133,518,1)
    Sleep(1000)
    MouseClick("left",1129,496,1)
    Sleep(27000)
next


Func _Terminate()
    Exit
endfunc

ps. You forgot to close your terminate function with endfunc.

Edited by BetaLeaf
Added sample script.

 

 

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...