Jump to content

Sleep causing the event that follows it to output 3 commands


Recommended Posts

When sleep is set to 500 and above it's causing the event that follows it to output 3 commands.

In the following example the down keystroke is sent 3 times!

Sleep(500)
Send("{DOWN}",0)

 

In the following example the down keystroke is sent once.

Sleep(400)
Send("{DOWN}",0)

Why is it doing this? How do I stop sleep interfering with the event that follows it?

Edited by Keylonta
Link to comment
Share on other sites

  • Moderators

@Keylonta I have moved your question to the General Help and Support area. Please be mindful of which forum you're posting to in the future.

I would also agree with JohnOne, there must be more to your code. As you have it written, I cannot duplicate what you're seeing.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Sorry, I'm a total newbie to AutoIt.

I should of mentioned that I'm using the program "Intelliremote" to write an AutoItX script.

That's all there is to the script so far. I have to work out what's causing the issue before I can continue.

I'll start a new topic on the Intelliremote forum if no one here knows what's causing it.

Link to comment
Share on other sites

When you say that is all there is in the script, that seems very unlikely, as there is no way the Send commands you listed above are different. They are identical, and the Sleep command before each has no bearing on them.

That means something else is causing your issue ... perhaps a mistiming with something.

We need to see the full text of the script, to determine if the script is involved at all.

It may be, that something is either causing the DOWN key to repeat or repeating your script or part of it.

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

  • 2 weeks later...

Sleep(500)
Send("{DOWN}",0)

I've just tested it again and it's still producing 3 x down. And when I remove the sleep command it produces 1 x down.

See the script below. It's set so that the 0 button on the remote control sends the script. I've tried other buttons but all have same sleep command issue when sleep command is used in the script as mentioned above.

Capture.JPG

Edited by Keylonta
Link to comment
Share on other sites

Cool program, it seems from what I found on google its not the first time people have had issues with it interfacing with Autoit 100%.

I'd imagine if you go run your script on your computer directly it will work right, and that would narrow down your fault domain to the program and not autoit.

At that point you can work with the people who use that program to help fix the issue, or change your script to work around the issue.

 

Could you do some testing and verify if the script works on your PC as designed?

Link to comment
Share on other sites

  • 3 weeks later...

I tested using the latest AutoIt. I couldn't find a download for AutoItX, is that an earlier version or something?

I tested with the following script and there were no issues.

Run("notepad.exe", "")
Sleep(1000)
Send("Hello {ENTER}", 0)
Send("Hello {ENTER}", 0)
Send("Hello {ENTER}", 0)
Sleep(500)
Send("{UP 3}",0)
Sleep(500)
Send("{DOWN}",0)

I'll try the Intelliremote forum for support for this issue.

Cheers to everyone who replied.

Link to comment
Share on other sites

Easy solution...don't use Send...it's unreliable.  You need to adjust the send length, and the delay between sends for each and EVERY app you work with (yes, some are less sensitive than others)...look up AutoItSetOption

That looks like a listview, so use the _guictrllistview* functions to accurately select your item (by text, and not by some counted send)...that will work regardless of the app.

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

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

×
×
  • Create New...