kart442 0 Posted September 19, 2007 Is there a way to execute color1 over and over to none are left then move on to color2 and return to color1 as soon as another appears? Always searching and executing color1 over any other color.... Thanks for your help in advance...you guys are the BEST!!!! CODEGlobal $color1 = 0x0099CC Global $color5 = 0x993399 Global $color3 = 0x66CC33 Global $color4 = 0xCCCC00 Global $color2 = 0xB2B2B2 Global $color6 = 0x60C080 #include <File.au3> Dim $csvArray2 $csvFile2 = "C:\array.txt" Global $Paused HotKeySet("{SPACE}", "TogglePause") HotKeySet("{ESC}", "Terminate") While 1 If FileExists($csvFile2) Then For $x = 1 To $csvArray2[0] - 1 $csvLine2 = $csvArray2[$x] $csvLineArray2 = StringSplit($csvLine2, ",", 1) $x1 = $csvLineArray2[1] $y1 = $csvLineArray2[2] $x2 = $csvLineArray2[3] $y2 = $csvLineArray2[4] $x3 = $csvLineArray2[5] $y3 = $csvLineArray2[6] Do If (PixelGetColor($x1, $y1) = $color1 And PixelGetColor($x2, $y2) = $color1) Or _ (PixelGetColor($x1, $y1) = $color2 And PixelGetColor($x2, $y2) = $color2) Or _ (PixelGetColor($x1, $y1) = $color3 And PixelGetColor($x2, $y2) = $color3) Or _ (PixelGetColor($x1, $y1) = $color4 And PixelGetColor($x2, $y2) = $color4) Or _ (PixelGetColor($x1, $y1) = $color5 And PixelGetColor($x2, $y2) = $color5) Then MouseClick("left", $x3, $y3, 1, 0) EndIf ExitLoop Until 1 = 2 Next EndIf WEnd Func TogglePause() $Paused = Not $Paused While $Paused Sleep(100) ToolTip('Script is "Paused"', 0, 0) WEnd ToolTip("") EndFunc ;==>TogglePause Func Terminate() Exit 0 EndFunc ;==>Terminate Share this post Link to post Share on other sites
PsaltyDS 42 Posted September 19, 2007 Is there a way to execute color1 over and over to none are left then move on to color2 and return to color1 as soon as another appears? Always searching and executing color1 over any other color.... Thanks for your help in advance...you guys are the BEST!!!! I think you are describing putting the colors to check in an array and looping through the array to check them in order. BTW, this line does NOT declare an array: Dim $csvArray2 Which means these lines will just throw errors and break your script: For $x = 1 To $csvArray2[0] - 1 $csvLine2 = $csvArray2[$x] 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 Share this post Link to post Share on other sites