Jump to content

SLEEP fails - how odd


Recommended Posts

This a weird one.

A SLEEP(5000) is just freezing. If I reduce the delay to 10, the sleep works but the next SLEEP then freezes. There is no other processes running. I have tried deleting the whole line and re-typing. I have two other AutoIT coders look at this and we are all perplexed.

Is there a limit or barrier or trans-dimensional worm hole that can cause a simple SLEEP to fail.

This is ruining my morning :unsure:

Link to comment
Share on other sites

The tool automates another computer using VNC. This snippet of code has worked for weeks; nothing has changed. The second consolewrite just doesnt happen anymore.

;Open VNC
    ShellExecute("C:\Documents and Settings\Test\Desktop\vncviewer.exe")
    sleep(3000)
    send("{ENTER}")
    sleep(3000)
;Restart terminal
    send("{LWIN}")
    sleep(2000)
    send("u")
    sleep(2000)
    send($key)
    sleep(2000)
    send("{TAB}")
    sleep(2000)
    send("{ENTER}")
    consolewrite("here")
    sleep(10000)
    consolewrite("there")
Link to comment
Share on other sites

We'll need some more code that that to be of any help. (Unless the entire code is just the one Sleep(5000))

I suspect you're using something like AdLibRegister, or another triggering event, which triggers the sleep and triggers the next one before the first one finishes, but without code it's all speculation.

Edit: Didn't see your second post with code. That's indeed weird. Reinstalling AutoIt and AdmiralAlkex' solutions might help though.

Edited by Tvern
Link to comment
Share on other sites

I (may be proved wrong) don't think more code or any code is relevant here. I've never heard of AdLibRegister mind: but I don't get out much. The core of my frustration is;

1) This code has worked in the past dozens of times

2) A smaller sleep (10) works but only passes on the problem.

3) The only change to the mix is that it's Monday

There is something technical glitchy that my code at this particular time on Monday (always a Monday) has stumbled on. How can a SLEEP fail? The code chews through over a dozen SLEEPS before it gets to this pivotal SLEEP and then *ucks off to play WOW.

I'll re-instal AutoIT--this may fix the problem.

<shrug>

Link to comment
Share on other sites

Put Opt("TrayIconDebug", 1) at the top of your script, then you can see what line the script is in by moving the mouse on the tray-icon

Or set #AutoIt3Wrapper_Run_Debug_Mode=Y

Edited by AdmiralAlkex
Link to comment
Share on other sites

AhA!

I think I have found the problem. I AutoIT recursive error came up--out of the blue. I reckon... as I am testing across different users (sys admin, standard user etc.) I had two instances of autoit running... somehow. By ghosting back a previous version and avoiding putting the autoIT exe in ALL USERS and login USER, this problem will be absent. Famous last words.

Opt("TrayIconDebug", 1) <-- never knew this. Nice one.

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