Belfigor Posted August 9, 2008 Share Posted August 9, 2008 (edited) I made a script, that will read pixels from screen and add coords of all black pixels to an array and after it compare new coords of found black pixels with old coords. Dont know how to tell, but will try: 1. I have a letter. I know where on screen that letter will appear, and i know coordinates of all black pixel in the letter. I have array where i add that coords. 2. I scan part of screen, and add to new array coords of all black pixels 3. I compare new coords with coords that i have before. This script is working, but is there a way to make it easier? I need to change EndIf with something else . May be it is possible compare an arrays? I dont know how to make it, help please. expandcollapse popupDim $JC[2][13] = [[698, 699, 700, 701, 702, 702, 702, 702, 702, 702, 702, 702, 702],[451, 452, 452, 452, 443, 444, 445, 446, 447, 448, 449, 450, 451]] Dim $array[2][30] $x = 697 $y = 438 $COLOR = 0x000000 $i = 0 $Pix = 0 $J = 0 Search() JTest() Func Search() For $xi = 0 to 6 For $yi = 0 to 19 If PixelGetColor($x, $y) = $COLOR Then $array[0][$Pix] = $x $array[1][$Pix] = $y $Pix = $Pix +1 EndIf $y = $y+1 Next $y = 438 $x = $x+1 Next EndFunc Func JTest() If $array[0][0] = $JC[0][0] Then If $array[0][1] = $JC[0][1] Then If $array[0][2] = $JC[0][2] Then If $array[0][3] = $JC[0][3] Then If $array[0][4] = $JC[0][4] Then If $array[0][5] = $JC[0][5] Then If $array[0][6] = $JC[0][6] Then If $array[0][7] = $JC[0][7] Then If $array[0][8] = $JC[0][8] Then If $array[0][9] = $JC[0][9] Then If $array[0][10] = $JC[0][10] Then If $array[0][11] = $JC[0][11] Then If $array[0][12] = $JC[0][12] Then If $array[1][0] = $JC[1][0] Then If $array[1][1] = $JC[1][1] Then If $array[1][2] = $JC[1][2] Then If $array[1][3] = $JC[1][3] Then If $array[1][4] = $JC[1][4] Then If $array[1][5] = $JC[1][5] Then If $array[1][6] = $JC[1][6] Then If $array[1][7] = $JC[1][7] Then If $array[1][8] = $JC[1][8] Then If $array[1][9] = $JC[1][9] Then If $array[1][10] = $JC[1][10] Then If $array[1][11] = $JC[1][11] Then If $array[1][12] = $JC[1][12] Then MsgBox(0, "Found letter", '"J"') EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndFunc It dont work Edited August 9, 2008 by Belfigor [size="1"]My bear is so cute asleep in the closet, not even drinking vodka. My nuclear bomb name is Natasha.[/size] Link to comment Share on other sites More sharing options...
rambo3889 Posted August 9, 2008 Share Posted August 9, 2008 Im not 100% sure but i suppose this should work : expandcollapse popupDim $JC[2][13] = [[698, 699, 700, 701, 702, 702, 702, 702, 702, 702, 702, 702, 702],[451, 452, 452, 452, 443, 444, 445, 446, 447, 448, 449, 450, 451]] Dim $array[2][30] $x = 697 $y = 438 $COLOR = 0x000000 $i = 0 $Pix = 0 $J = 0 Search() if JTest() Then MsgBox(0, "Found letter", '"J"') Func Search() For $xi = 0 To 6 For $yi = 0 To 19 If PixelGetColor($x, $y) = $COLOR Then $array[0][$Pix] = $x $array[1][$Pix] = $y $Pix = $Pix + 1 EndIf $y = $y + 1 Next $y = 438 $x = $x + 1 Next EndFunc ;==>Search Func JTest() for $1=0 to 12 if $array[0][$1] = $JC[0][$1] Then if $array[1][$1] = $JC[1][$1] Then if $1 = 12 Then Return True Else ExitLoop EndIf Else ExitLoop EndIf Next Return False EndFunc ;==>JTest My Scripts:Radioblog Club Music DownloaderOther stuff:Fun movieIm serious read the help file it helps :PFight 'Till you drop. Never stop, You Cant give up. Til you reach the top Fight! youre the best in town Fight! Link to comment Share on other sites More sharing options...
Belfigor Posted August 9, 2008 Author Share Posted August 9, 2008 (edited) It works!!! Thank you! Now i just need to understand how it works Edited August 9, 2008 by Belfigor [size="1"]My bear is so cute asleep in the closet, not even drinking vodka. My nuclear bomb name is Natasha.[/size] Link to comment Share on other sites More sharing options...
Belfigor Posted August 9, 2008 Author Share Posted August 9, 2008 Is there a way to make a script that will find a picture on the screen? I have a picture on the screen an i whant to make a script that will tell me when he found that picture on the screen in game. [size="1"]My bear is so cute asleep in the closet, not even drinking vodka. My nuclear bomb name is Natasha.[/size] Link to comment Share on other sites More sharing options...
Zedna Posted August 9, 2008 Share Posted August 9, 2008 Is there a way to make a script that will find a picture on the screen?I have a picture on the screen an i whant to make a script that will tell me when he found that picture on the screen in game.Look at Image Search Libraryhttp://www.autoitscript.com/forum/index.php?showtopic=65748But I'm not sure if it works in (fullscreen) games - I think NO. Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Belfigor Posted August 10, 2008 Author Share Posted August 10, 2008 Look at Image Search Libraryhttp://www.autoitscript.com/forum/index.php?showtopic=65748But I'm not sure if it works in (fullscreen) games - I think NO.Thank you! I will try [size="1"]My bear is so cute asleep in the closet, not even drinking vodka. My nuclear bomb name is Natasha.[/size] 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