alanakko Posted April 23, 2008 Share Posted April 23, 2008 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 Link to comment Share on other sites More sharing options...
flip209 Posted April 23, 2008 Share Posted April 23, 2008 (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 April 23, 2008 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 Link to comment Share on other sites More sharing options...
alanakko Posted April 23, 2008 Author Share Posted April 23, 2008 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 = FFD742EndFuncthanks m8, ill try that, the only thing there i dont quite understand is $pixel = hex($pixel, 6) as in why ,6?thanks Link to comment Share on other sites More sharing options...
flip209 Posted April 23, 2008 Share Posted April 23, 2008 (edited) Returns a string representation of an integer or of a binary type converted to hexadecimal.Hex ( expression [, length] )Parametersnumber 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 April 23, 2008 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 Link to comment Share on other sites More sharing options...
alanakko Posted April 23, 2008 Author Share Posted April 23, 2008 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, Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now