Reznor Posted November 11, 2004 Share Posted November 11, 2004 I never got a chance to work with anything like AutoIt. Thanks. So, let's say I want to do something with red pixels.First thing is finding it, "then" what? $coord = PixelSearch( 0, 0, 20, 300, 0xFF0000 ) If Not @error ThenI want to MouseMove ("0xFF0000") or something like mouseclick ("left" 0xFF0000)I have a feeling im about to learn very important code for autoit that every user shoud know Link to comment Share on other sites More sharing options...
Reznor Posted November 11, 2004 Author Share Posted November 11, 2004 (edited) Makes sense. Thanks :] Here is script, simpler than anything else i would have tried. $i = 0 While $i <= 18 $i = $i + 1 $coord = PixelSearch( 0, 108, 308, 265, 0xFFFFFF ) If Not @error Then MouseClick( "left", $coord[0], $coord[1] ) sleep ("20000") EndIf WEnd Edited November 11, 2004 by Reznor Link to comment Share on other sites More sharing options...
CyberSlug Posted November 11, 2004 Share Posted November 11, 2004 sleep ("20000")I think you mean sleep(20000). You want a number instead of text.... and any text value in sleep is treated as zero! Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
Reznor Posted November 11, 2004 Author Share Posted November 11, 2004 (edited) I wish to look for the 1st pixel, but if no array is found, look for the 2nd pixel , if no array is found then for security, look for a 3rd pixel color but for example Mouseclick ("Left" 186, 122) if niether of the three pixels were found. i was using autoit2 basic commands over night but mabey if someone can show this particular script awnser ill understand how the "If, else, while, wend, end if" ect, work especialy when there are several. . I tried a lot of forum search which helped on other things (I am really sorry i clicked "reply" not edit, hence double post) Edited November 11, 2004 by Reznor Link to comment Share on other sites More sharing options...
Reznor Posted November 11, 2004 Author Share Posted November 11, 2004 (edited) (thanks) could i see an actual script something like this? (I know this language is wrong, but I need to learn the correct language) while;(loop start) Searchpixel (in # # # # rectangle, for ######## color) If found - click the array And endif if not found Searchpixel (in # # # # rectangle, for ######## color) If found click the array and endif if not found send ("{Right 10}") and endif Wend If I saw this basic script I would learn a lot about the language. It would probably enhance every function I already know. Edited November 11, 2004 by Reznor Link to comment Share on other sites More sharing options...
SlimShady Posted November 11, 2004 Share Posted November 11, 2004 (edited) While 1;(loop start) ;Loop 3 times and exit the inner loop when a pixel color is found For $i = 1 To 3 ;Searchpixel (in # # # # rectangle, for ######## color) If $i = 1 Then $coord = PixelSearch(0, 0, 20, 300, 0xFF0000) ElseIf $i = 2 Then $coord = PixelSearch(0, 0, 20, 300, 0x00FF00) ElseIf $i = 3 Then $coord = PixelSearch(0, 0, 20, 300, 0x0000FF) EndIf If NOT @error Then ;If found Then ;click the array MouseClick("left", $coord[0], $coord[1], 1, 1) $Matched = 1 ExitLoop Else $Matched = 0 EndIf Next If NOT $Matched Then Send ("{Right 10}") Wend Edited November 11, 2004 by SlimShady Link to comment Share on other sites More sharing options...
Reznor Posted November 13, 2004 Author Share Posted November 13, 2004 (edited) Thanks that worked out and i understand a bit more about the language.. (Other question moved here)If threads are deleted or moved this onehas potential Edited November 13, 2004 by Reznor 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