w0uter Posted May 2, 2005 Share Posted May 2, 2005 (edited) i almost know for sure that there is something like this. but i needed this. and i thought id share it. syntax is the same as PixelSearch return[0] = the found pixel color return[1] = x coord return[2] = y coord Func _iPixelSearch($i_left, $i_top, $i_right, $i_bottom, $i_color, $i_shade = 0, $i_step = 1) Local $av_ret[3] Local $ai_coords = PixelSearch($i_left, $i_top, $i_right, $i_bottom, $i_color, $i_shade, $i_step) If @error Then Return 0 EndIf $av_ret[0] = PixelGetColor($ai_coords[0], $ai_coords[1]) $av_ret[1] = $ai_coords[0] $av_ret[2] = $ai_coords[1] Return $av_ret EndFunc;==>_iPixelSearch_iPixelSearch.au3 Edited May 31, 2006 by w0uter My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
BillLuvsU Posted May 2, 2005 Share Posted May 2, 2005 Oh thank you alot! This is perfect for my collision detection. [center][/center]Working on the next big thing.Currently Playing: Halo 4, League of LegendsXBL GT: iRememberYhslaw Link to comment Share on other sites More sharing options...
Insolence Posted May 3, 2005 Share Posted May 3, 2005 I don't understand the use of this function? Do you have an example? "I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar. Link to comment Share on other sites More sharing options...
w0uter Posted May 3, 2005 Author Share Posted May 3, 2005 useless example $v_color = 0xFF0000 $ai_ex = _iPixelSearch(0, 0, @DesktopWidth, @DesktopHeight, $v_color, 100) $s_ex = 'The difference between the searched color(' & $v_color & ') and the found color(' & $ai_ex[0] & ') is ' & ($v_color - $ai_ex[0]) MsgBox(0, '', $s_ex) My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
Insolence Posted May 4, 2005 Share Posted May 4, 2005 Ah I see "I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar. Link to comment Share on other sites More sharing options...
Hooch Posted May 4, 2005 Share Posted May 4, 2005 I'm overly dense today, I'm not getting the purpose of this baby... Link to comment Share on other sites More sharing options...
Insolence Posted May 4, 2005 Share Posted May 4, 2005 If you search for a color WITH variation, then it returns the color found. This could be used to find a nice average to base your color variation on. I.E. Find the highest variation found, and lowest variation found. Then use that range to make it as efficient as possible. "I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar. Link to comment Share on other sites More sharing options...
Hooch Posted May 9, 2005 Share Posted May 9, 2005 Ahhh.. gotcha, ok cool. I could see myself making use of that. Although frowned upon I do alot with whatever game I'm currently playing. Some games make it tough to nail down a pixel color that is always the same. Combine this with a local calibration and allow for +- range on the find and you should be pretty solid. Link to comment Share on other sites More sharing options...
w0uter Posted May 9, 2005 Author Share Posted May 9, 2005 Some games make it tough to nail down a pixel color that is always the same.<{POST_SNAPBACK}> what do you think the shade parameter is for ;P My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
MuffettsMan Posted May 25, 2005 Share Posted May 25, 2005 what do you think the shade parameter is for ;P<{POST_SNAPBACK}>have you guys thought of setting the pixel color each time the script is run? - IE: i am currently writing a script that will wait till i give it the mousecoord for the range to search in then the current colors to search for before running the actual loop... thus the shade variance can be much stricter thus hopefully more accurate... then as the colors begin to fail the search just kick off the script again... else more ideal (though beyond my noob abilities) keep an array of the color found to what was origionally matched... thus if the average return is consistantly darker... reset the orig search color accordingly ((figured this would help in cases of slight variation over time, specifically in a game when the pixel color changes from day to night - but don't know how badly that would affect performance.Anyway don't have anything good enough for yall to at least laugh at, though will post asap... Don't let that status fool you, I am no advanced memeber! 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