Sign in to follow this  
Followers 0
mike1212

Sleep

14 posts in this topic

Hello

I looked at the sleeps delays and cant find away to make this statement work!

I do not know if it is even possible,

Any Ideas/

If $color = 473924 Then
    sleep Til $color <> 473924
    EndIf

What I am trying to do is pause the script, that runs in the same window, until it see a change in that window.

Thank You Mike1212 :)

Share this post


Link to post
Share on other sites



I guess you have to do something like this:

If $color = 473924 Then
Do

;Some code here

Until $color <> 473924
EndIf

Or

If $color = 473924 Then
While 1

sleep(10)
If $color <> 473924 Then Exitloop
WEnd
EndIf

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I guess you have to do something like this:

If $color = 473924 Then
Do

;Some code here

Until $color <> 473924
EndIf

Or

If $color = 473924 Then
While 1

sleep(10)
If $color <> 473924 Then Exitloop
WEnd
EndIf

<{POST_SNAPBACK}>

Hello Wb-FreeKill

That command works however, it not what I need, it exits the script totally if not the correct pixel then I need to restart it.

let me restate myself

I need to pause the script, til it sees the correct pixel color then run

the script.

Thank You Mike1212

Edited by mike1212

Share this post


Link to post
Share on other sites

Hello Wb-FreeKill

That command works however, it not what I need, let restate myself

I need to pause the script, til it sees the correct pixel color then run

the script.

Thank You Mike1212

<{POST_SNAPBACK}>

sees it, what u meen?, like when the color is under the curser, or when looking for the pixel color?

Share this post


Link to post
Share on other sites

While 1
   If $color = 473924 Then
     ;Insert code here
   Else
      Sleep(10000)
   EndIf
Wend

You could also do this...

While 1
   While $color <> 473924
      Sleep(10000)
   Wend
  ;Rest of code here
Wend

Or

While 1
   Do
      Sleep(10000)
   Until $color = 473924
  ;Rest of code here
Wend

As you can see you have many options


[u]Old Projects:[/u]A3MORGB2Hex[u]Old Functions:[/u]_TimeAdd/_TimeSub_AddComma_BubbleSort _RippleSort "He who does not understand your silence will probably not understand your words." - Elbert Hubbard.

Share this post


Link to post
Share on other sites

sees it, what u meen?, like when the color is under the curser, or when looking for the pixel color?

<{POST_SNAPBACK}>

The script runs in a cont. loop, what is happing, it is unable to correctly

selection all bottons because they pop up at random and the set sleep timmers I have are interfering with 100% reliability.

So I want to pause the script totally until the pixel change happens then run the script

It is 100% on the money at the start. It only screws up later into it.

So by having it start fresh everytime it should be 100%.

Mike1212

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

While 1
   If $color = 473924 Then
    ;Insert code here
   Else
      Sleep(10000)
   EndIf
Wend

You could also do this...

While 1
   While $color <> 473924
      Sleep(10000)
   Wend
  ;Rest of code here
Wend

Or

While 1
   Do
      Sleep(10000)
   Until $color = 473924
  ;Rest of code here
Wend

As you can see you have many options

<{POST_SNAPBACK}>

I agree with your codes, but what I am failing to see, is the script will sleep for

10 seconds or what ever its set for, what will make it start at moments notice.

example Sleep(5000) the script may need to act in 1 second whats happens then?

This is the problem.

Thanks Mike1212

Edited by mike1212

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

For some strange reason I thought it might kill the sleep(), let me ponder for a bit...

Edit: I am so stupid lol, you dont have to have an Else in there

While 1
   If $color = 473924 Then
   ;Insert code here
   EndIf
Wend
Edited by burrup

[u]Old Projects:[/u]A3MORGB2Hex[u]Old Functions:[/u]_TimeAdd/_TimeSub_AddComma_BubbleSort _RippleSort "He who does not understand your silence will probably not understand your words." - Elbert Hubbard.

Share this post


Link to post
Share on other sites

See my edited post above :).

<{POST_SNAPBACK}>

Thank You

I think that has it ,by placing the pixel ck. above the while 1

it is also pausing the whole script within the loop were as before it was not.

I didnt realize you were able to place code outside the loop, so I see you can now.

If I have this wrong let me know?

Thank You.

Mike1212 :D

Share this post


Link to post
Share on other sites

Nope, thats right. Once a loop finish's it will simply continue the code, if there is no code it will exit.


[u]Old Projects:[/u]A3MORGB2Hex[u]Old Functions:[/u]_TimeAdd/_TimeSub_AddComma_BubbleSort _RippleSort "He who does not understand your silence will probably not understand your words." - Elbert Hubbard.

Share this post


Link to post
Share on other sites

Nope, thats right. Once a loop finish's it will simply continue the code, if there is no code it will exit.

<{POST_SNAPBACK}>

I see your point,

I ran the code, it didnt start the script until the pixel was correct :D

but once in the loop it continued to run :) so I will need to place the code multi times with the loop. And remove it from above While 1.

That I think should fix it.

Mike1212

Share this post


Link to post
Share on other sites

If you have any more problems, you know who to ask :).

<{POST_SNAPBACK}>

Thank You Burrup

The program is singing, happily.

It no longer misses a beat.

Mike1212 :D

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