Sign in to follow this  
Followers 0
Guest rgoodwin

Misunderstanding Sleep?

5 posts in this topic

Ok I made this VERy simple script, to clicka button every 2 hours, but for some reason it keeps trying to do it very frequently (or at the very least keeps popping up the traytip often). I'm probably missing something simple s please go easy on me! :-)

Opt("WinTitleMatchMode",2)

Opt("MouseCoordMode",0)

while 5

If ProcessExists("newsleecher.exe") Then

WinActivate("NewsLeecher v1.0 beta 30 (RC1)")

WinWaitActive("NewsLeecher v1.0 beta 30 (RC1)")

WinSetState("NewsLeecher v1.0 beta 30 (RC1)", "", @SW_MAXIMIZE)

MouseClick("Left",464,195,2,0)

TrayTip("Retrieving","Downloading Newsleecher Headers",5,10)

Sleep(7200000)

EndIf

Wend

Share this post


Link to post
Share on other sites



Ok I made this VERy simple script, to clicka button every 2 hours, but for some reason it keeps trying to do it very frequently (or at the very least keeps popping up the traytip often). I'm probably missing something simple s please go easy on me! :-)

Opt("WinTitleMatchMode",2)

Opt("MouseCoordMode",0)

while 5

If ProcessExists("newsleecher.exe") Then

  WinActivate("NewsLeecher v1.0 beta 30 (RC1)")

  WinWaitActive("NewsLeecher v1.0 beta 30 (RC1)")

  WinSetState("NewsLeecher v1.0 beta 30 (RC1)", "", @SW_MAXIMIZE)

  MouseClick("Left",464,195,2,0)

  TrayTip("Retrieving","Downloading Newsleecher Headers",5,10)

Sleep(7200000)

        EndIf

       

Wend

<{POST_SNAPBACK}>

looks ok to me....

maybe put in a msgbox to see if the script is actually looping ??


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Seems really OK. I would just add also a small wait (like 2 seconds) outside the If/EndIf so your CPU will not overload when newsleecher.exe does not exits.

Share this post


Link to post
Share on other sites

I don't assume this works. You can always try and see.

Opt("WinTitleMatchMode",2)
Opt("MouseCoordMode",0)
$Title = "NewsLeecher v1.0 beta 30 (RC1)"
while 1
    If ProcessExists("newsleecher.exe") Then
    
      WinActivate($Title, "")
      WinWaitActive($Title, "")
    
      WinSetState($Title, "", @SW_MAXIMIZE)
      MouseClick("Left", 464, 195, 2, 0)
    
      TrayTip("Retrieving","Downloading Newsleecher Headers", 10, 0)
      Sleep(2 * 60 * 60 * 1000)
    EndIf
Wend

Share this post


Link to post
Share on other sites

looks ok to me....

maybe put in a msgbox to see if the script is actually looping ??

<{POST_SNAPBACK}>

I keep seeing the TrayTip pop back up quickly so it's definitely looping (or a TrayTip bug)...

I don't assume this works. You can always try and see.

Opt("WinTitleMatchMode",2)
Opt("MouseCoordMode",0)
$Title = "NewsLeecher v1.0 beta 30 (RC1)"
while 1
    If ProcessExists("newsleecher.exe") Then
    
      WinActivate($Title, "")
      WinWaitActive($Title, "")
    
      WinSetState($Title, "", @SW_MAXIMIZE)
      MouseClick("Left", 464, 195, 2, 0)
    
      TrayTip("Retrieving","Downloading Newsleecher Headers", 10, 0)
      Sleep(2 * 60 * 60 * 1000)
    EndIf
Wend

<{POST_SNAPBACK}>

I'll try it!

Share this post


Link to post
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
Sign in to follow this  
Followers 0