Jump to content

Global Pause or delay


Synct
 Share

Recommended Posts

Im looking to adjust the speed at which a script plays. say you have a script that runs on several machines, some slower than others, Is there a way to have a global sleep between each line instead of having to type "Sleep (1000)" Between every line of a 7,000 line program?

Basically to have the same result as

MouseClick("left",512,317,1)

Sleep(1000)

MouseClick("left",283,321,1)

Sleep(1000)

MouseClick("left",329,645,1)

Sleep(1000)

Send("{ENTER}")

Sleep(1000)

MouseClick("left",582,362,1)

Sleep(1000)

MouseClick("left",275,321,1)

Sleep(1000)

MouseClick("left",326,644,1)

Sleep(1000)

Send("{ENTER}")

Sleep(1000)

MouseClick("left",324,302,1)

Sleep(1000)

And so on...

Thanks in advance!

Link to comment
Share on other sites

Why do you need to sleep after every line?

There are functions like WinWait(), WinWaitActive() and WinWaitClose() that might be better suited, as they'll work for any speed computer

You can also look at the WinWaitDelay setting too.

Edit: You might also find the ControlClick() function more useful, as it would be better suited for different resolutions (i mention this because you bring up using this script on different computers).

Edited by maqleod
[u]You can download my projects at:[/u] Pulsar Software
Link to comment
Share on other sites

Why do you need to sleep after every line?

There are functions like WinWait(), WinWaitActive() and WinWaitClose() that might be better suited, as they'll work for any speed computer

You can also look at the WinWaitDelay setting too.

Edit: You might also find the ControlClick() function more useful, as it would be better suited for different resolutions (i mention this because you bring up using this script on different computers).

Because each action takes place in the same window, within a flash environment, so a delay is required because each action needs time to process and change the display. Using the auto recorder it makes one action happen directly after the last one finishes, so the action before is still processing within the web browser when the second action executes, which is supposed to happen on the form the first action opened.

Hope that made sense.

Link to comment
Share on other sites

No it is a database bot that changes values for each employee from a table, it automatically searches by name, on an ftp server, when a name is selected it displays basic info about the employee and how to contact them, the worst part is it is very repetitive in changing values and sending out "memos" ive been pestering them to use a more modern method but my boss is very picky when it comes to changing things, afraid it will mess things up, so until then this is all ive got, originally I was trying to develop a GUI through C# to accomplish it in much fewer steps, just giving this a shot as ive been pretty familiar with it. Using slower computers it takes time for each page to load, so I am looking for a wait to set a speed at which it runs, a delay between each command, 1000 on faster computers, as high as 5000 for the slower ones. I will be in front of it while it is running so if anything does go wrong I can pause it and do it manually.

Edit:Typo

Edited by Synct
Link to comment
Share on other sites

Well, PixelSearch() might help, you can do the mouse click when the button you need to press actually appears, that way you won't need to sleep.

That would help in some areas, thanks, What im looking for though would be perhaps a Global that would set the speed the executable runs. If this isn't possible I see it as being very helpful for a possible update in the future, would make it easier for computers with slower processors to rake the same results from autoit as those with newer machines, if unspecified it will run at the default speed.(no pause between actions)

Link to comment
Share on other sites

If you are using sleeps in your script I often find it usefull to add a modifier to it. So instead of Sleep(1000), I would use Sleep(1000*$Speed).

By changing the value of $Speed I can then easily tweak the speed.

I don't think there is another way to slow down the execution of scriptlines other than putting sleeps in between.

Link to comment
Share on other sites

If you are using sleeps in your script I often find it usefull to add a modifier to it. So instead of Sleep(1000), I would use Sleep(1000*$Speed).

By changing the value of $Speed I can then easily tweak the speed.

I don't think there is another way to slow down the execution of scriptlines other than putting sleeps in between.

Yea seems that way, I haven't found any other ways, still think it would be a good option to add at compile time for slower machines.

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