Jump to content
Sign in to follow this  
Guest rgoodwin

Misunderstanding Sleep?

Recommended Posts

Guest rgoodwin

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
Jos

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                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
ezzetabi

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
SlimShady

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
Guest rgoodwin

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  

×