Jump to content

Recommended Posts

Posted

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

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

Posted

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

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

Posted

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,

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...