AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Guest2.0

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Pause/Interrupt Question
Guest





PostPosted: Mon Feb 22, 2010 2:51 am    Post subject: Guest2.0 Reply with quote

Not quite sure how to put this ....

Code:
Loop
{
If TestVar
{
Sleep, 500
SendInput, {Blind}{1}
}
}


Basically, if I pause the script during the Sleep, when I un-pause it, it fires off the 1 even if TestVar is false. Only once, though. What I'm trying to figure out is, how do I make it so that the 1 doesn't get fired off once?
Back to top
Guest2.0
Guest





PostPosted: Mon Feb 22, 2010 2:52 am    Post subject: Reply with quote

Oh damn. I put the username in the wrong input box and the subject/topic too. >.<
Back to top
a_h_k



Joined: 02 Feb 2008
Posts: 626

PostPosted: Mon Feb 22, 2010 4:27 am    Post subject: Re: Guest2.0 Reply with quote

There's simpler ways to do it, but i'm assuming you want to keep the same structure, so...
Code:
Loop
{
  If TestVar
  {
  Sleep, 500
  If TestVar
    SendInput, {Blind}{1}
  }
}


Btw: You can edit the thread name via "Edit" --> "Subject" box
Back to top
View user's profile Send private message Visit poster's website
Leef_me



Joined: 08 Apr 2009
Posts: 5336
Location: San Diego, California

PostPosted: Mon Feb 22, 2010 4:39 am    Post subject: Re: Guest2.0 Reply with quote

a_h_k wrote:
Btw: You can edit the thread name via "Edit" --> "Subject" box

Btw: Only registered users can edit their messages.
Back to top
View user's profile Send private message
Guest2.0
Guest





PostPosted: Mon Feb 22, 2010 7:34 am    Post subject: Re: Guest2.0 Reply with quote

a_h_k wrote:
There's simpler ways to do it, but i'm assuming you want to keep the same structure, so...
Code:
Loop
{
  If TestVar
  {
  Sleep, 500
  If TestVar
    SendInput, {Blind}{1}
  }
}


Btw: You can edit the thread name via "Edit" --> "Subject" box


Would that affect performance? Performance is a factor and if there's another way with a different structure that doesn't affect performance, I'd rather try that.
Back to top
Guest2.0
Guest





PostPosted: Mon Feb 22, 2010 8:33 am    Post subject: Reply with quote

Now that I think about it, I'm not sure that would help. TestVar is ever changing and it would interfere with the original function that is supposed to happen when TestVar evaluates to true. Just to further elaborate; Lets say that the script acknowledges TestVar to be true, then begins sleeping. Normally after the sleep it would send 1, but if TestVar is now evaluating to false after the sleep, it won't.

Unfortunately, I believe that it's a likely scenario. Any other ideas, possibly? Maybe that simpler method you mentioned earlier? Anyhow, I appreciate the help Smile
Back to top
a_h_k



Joined: 02 Feb 2008
Posts: 626

PostPosted: Tue Feb 23, 2010 11:58 am    Post subject: Reply with quote

What is this for?
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group