Sign in to follow this  
Followers 0
alanakko

do until or pause time

5 posts in this topic

hey guys anyone out there know a way to code this, or if its even possible?

question is can you do a do - until--

ie.

Func nowdocked1()

Do

Until PixelGetColor(22,759) = 0xFFD742

EndFunc

and then add a default pause time in case of a pixel colour miss

so do untill get colour or after say 20 seconds ,i,m having a bit of trouble with translucent backgrounds etc , pixel colour search sometimes misses which then halts the whole script

any ideas greatly appriciated

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

It is because the Pixelgetcolor returns a decimal not a hex try

Func nowdocked1()

Do

$pixel = PixelGetColor(22,759)

$pixel = hex($pixel, 6)

sleep(100)

Until $pixel = FFD742

EndFunc

Edited by flip209

" I haven't failed. I've just found 10,000 ways that won't work." Thomas Edison "You cannot help men permanently by doing for them what they could and should do for themselves." Abraham Lincoln

Share this post


Link to post
Share on other sites

It is because the Pixelgetcolor returns a decimal not a hex try

Func nowdocked1()

Do

$pixel = PixelGetColor(22,759)

$pixel = hex($pixel, 6)

sleep(100)

Until $pixel = FFD742

EndFunc

thanks m8, ill try that, the only thing there i dont quite understand is $pixel = hex($pixel, 6) as in why ,6?

thanks :D

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Returns a string representation of an integer or of a binary type converted to hexadecimal.

Hex ( expression [, length] )

Parameters

number The expression to convert.

length [optional] Number of characters to be returned (up to 8) for integer.

Characters are truncated from the left-hand side if length is too small.

On binary types the whole length is converted.

Above is from help file...

You need 6 hex characters for the color...

Edited by flip209

" I haven't failed. I've just found 10,000 ways that won't work." Thomas Edison "You cannot help men permanently by doing for them what they could and should do for themselves." Abraham Lincoln

Share this post


Link to post
Share on other sites

Returns a string representation of an integer or of a binary type converted to hexadecimal.

Hex ( expression [, length] )

Parameters

number The expression to convert.

length [optional] Number of characters to be returned (up to 8) for integer.

Characters are truncated from the left-hand side if length is too small.

On binary types the whole length is converted.

Above is from help file...

You need 6 hex characters for the color...

crickey thats an answer and a half lol ,a huge thanks for the help m8,

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