jensj Posted January 7, 2008 Posted January 7, 2008 hi.. i use pixelgetcolor to get the color of one pixel. but that pixel hast not always the one color. there is a little difference. if pixelgetcolor( 3, 1004 )=( 0x010101 ) then ; H Checken Sleep(1000) send("{h}") Else sleep(1000) endif the color is almost black and highest violett like this 2B1831 how do i get the difference of these colors? if the color is between black and that violett, my script should send h. i hope u understood the problem. thx
i542 Posted January 7, 2008 Posted January 7, 2008 If pixelgetcolor(3, 1004 ) = 0x2B1831 then Sleep(1000) send("h") Else sleep(1000) endif I don't get the problem? I can do signature me.
jensj Posted January 7, 2008 Author Posted January 7, 2008 there should be listet every color from black to violett.
PsaltyDS Posted January 8, 2008 Posted January 8, 2008 You could code a simple color display of your own, or use a UDF like kjactive's ColorPicker. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Gabriel12345 Posted January 13, 2008 Posted January 13, 2008 Hrm I havent tried it myself, but I suspect somthing like this should work, you will need to find your own color ranges: if pixelgetcolor( 3, 1004 ) >= dec(000000) and pixelgetcolor( 3, 1004 ) <= dec(??????) then and replace ?????? with the color code for violet.
therks Posted January 14, 2008 Posted January 14, 2008 Actually this would be rather complicated... you want to return true based on if the color is between black and violet (2B1831), correct? Well, technically 001800 is between black and violet, but it's green. Would you want that to return true? The simplest way to do it (although not necessarily reliable I think) would be like so: $iPixelColor = PixelGetColor(3, 1004) $aPixelSplit = _ColorSplit($iPixelColor) If $aPixelSplit[0] < 0x2B And $aPixelSplit[1] < 0x18 And $aPixelSplit[2] < 0x31 Then Sleep(1000) Send("{h}") Else Sleep(1000) EndIf Func _ColorSplit($i_Color) Local $a_Color[3] $a_Color[0] = BitAND(BitShift($i_Color, 16), 0xff) $a_Color[1] = BitAND(BitShift($i_Color, 8), 0xff) $a_Color[2] = BitAND($i_Color, 0xff) Return $a_Color EndFunc My AutoIt Stuff | My Github
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