Jump to content
Sign in to follow this  
zykl0

I would like to replace sleep()

Recommended Posts

zykl0

Hello, Actually i made a script that craft for me, i made the sleep() before each step to work with my main computer.

now that i try to make it work on my other comp the delay is not the same this is why i increased every sleep() by a few ms/sec

but id like something more accurate than that.

what i was thinking is creating a new command (is it possible?) to replace every sleep() function by something like Wait (x, y, 0x000000)

so basically something like

MouseClick ("left", 865, 716) ;click button begin 1 
Sleep (1000)
MouseClick ("left", 581, 500) ;click button begin 2
Sleep (2000)
oÝ÷ Û
.ÖÞrjëh×6
MouseClick ("left", 865, 716) ;click button begin 1 
Wait (865, 716, 0x000000) ;replacing shadevariation by green or the real color
MouseClick ("left", 581, 500) ;click button begin 2
Wait (581, 500, 0x000000) ;replacing shadevariation by green or the real color

the Wait command would pause the script at this line until the color match at this x,y locs and continue when the color is matched

(btw putting a max wait time in the Wait command like 10sec then redo from scratch would be nice)

anyone can give me some sample code i am a basic scripter :whistle:

thank you.

Share this post


Link to post
Share on other sites
nfwu

Here is a _PixelWait function:

Func _PixelWait($x, $y, $col)
   While $col <> PixelGetColor( $x, $y )
      Sleep(100)
   WEnd
EndFunc

#)

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.