Oreoshakes 0 Posted August 9, 2007 what do i put in place of $searchresult to make it use both searches. $SearchResult1 = PixelSearch(252,196,768,487,$TargetG,5,3) $SearchResult2 = PixelSearch(252,196,768,487,$TargetW,5,3) If @error <> 1 Then MouseClick($Click, $SearchResult[0]+15, $SearchResult[1]+45, 7, 3) Share this post Link to post Share on other sites
DW1 102 Posted August 9, 2007 can you rephrase this? it is not clear what you want to do AutoIt3 Online Help Share this post Link to post Share on other sites
Oreoshakes 0 Posted August 9, 2007 Trying to get this to use more than one color. Opt("WinWaitDelay",100) Opt("WinTitleMatchMode",4) Opt("WinDetectHiddenText",1) Opt("MouseCoordMode",0) WinWait("LastChaos - Aeria Games & Entertainment (Window 1024x768)","") If Not WinActive("LastChaos - Aeria Games & Entertainment (Window 1024x768)","") Then WinActivate("LastChaos - Aeria Games & Entertainment (Window 1024x768)","") WinWaitActive("LastChaos - Aeria Games & Entertainment (Window 1024x768)","") HotKeySet('{esc}', '_Exit') ;Hotkey escape Dim $Coord, $Click, $TargetG, $TargetW, $SearchResult1, $SearchResult2 $TargetG = 0x5B9600 $TargetW = 0xC4C1C4 $TargetR = 0xCD4800 $Click = "Right" While 1 = 1 Sleep(100) $SearchResult1 = PixelSearch(252,196,768,487,$TargetG,5,3) $SearchResult2 = PixelSearch(252,196,768,487,$TargetW,5,3) If @error <> 1 Then MouseClick($Click, $SearchResult1[0]+15, $SearchResult1[1]+45, 7, 3) Send("{F1}") Send("{F3}") if isarray $SearchResult1 = PixelSearch(237,193,806,638,$TargetG,5,1) Then endif if isarray $SearchResult2 = PixelSearch(237,193,806,638,$TargetW,5,1) Then endif Send("{Right}") $SearchResult1 = PixelSearch(342,342,1000,342,$TargetG,5,3) $SearchResult2 = PixelSearch(342,342,1000,342,$TargetW,5,3) if @error <> 1 then MouseClick($Click, isarray[0]+15, isarray[1]+45, 7, 3) Send("{F1}") Send("{F3}") if isarray $SearchResult1 = PixelSearch(237,193,806,638,$TargetG,5,1) Then EndIf if isarray $SearchResult2 = PixelSearch(237,193,806,638,$TargetW,5,1) Then EndIf WEnd Func _Exit() Exit EndFunc While 1 Sleep(5*60*1000) Send("{F3}") WEnd Share this post Link to post Share on other sites
Paulie 26 Posted August 9, 2007 can you rephrase this? it is not clear what you want to doI think he wants 1 array that takes the results from both searches. Share this post Link to post Share on other sites
DW1 102 Posted August 9, 2007 so you want it to click on two different colors? or only if the first one isn't there click the second? is there priority? we need more information... sorry for not understanding AutoIt3 Online Help Share this post Link to post Share on other sites
DW1 102 Posted August 9, 2007 I think he wants 1 array that takes the results from both searches.If that is the case, you can just redim one of the arrays and put the other array at the end of the one you just redim'ed AutoIt3 Online Help Share this post Link to post Share on other sites
Oreoshakes 0 Posted August 9, 2007 If that is the case, you can just redim one of the arrays and put the other array at the end of the one you just redim'edI'm trying to make it so it goes for either one of the color but not both at same time. Share this post Link to post Share on other sites
Oreoshakes 0 Posted August 9, 2007 Or maybe just the one thats closest. Share this post Link to post Share on other sites
DW1 102 Posted August 9, 2007 maybe turning this:$SearchResult1 = PixelSearch(252,196,768,487,$TargetG,5,3) $SearchResult2 = PixelSearch(252,196,768,487,$TargetW,5,3)oÝ÷ Ú)í¡©Þ²×!ü(ºWp¢¹¢·±jjey«¢+ØÀÌØíMÉ¡IÍÕ±ÐÄôA¥á±MÉ ÈÔȰÄ䨰ܨà°ÐàܰÀÌØíQÉѰ԰̤)%ÉɽȱÐìÐìÄQ¡¸)5½ÕÍ ±¥¬ ÀÌØí ±¥¬°ÀÌØíMÉ¡IÍÕ±ÐÅlÁt¬ÄÔ°ÀÌØíMÉ¡IÍÕ±ÐÅlÅt¬Ð԰̤ܰ)±Í(ÀÌØíMÉ¡IÍÕ±ÐÈôA¥á±MÉ ÈÔȰÄ䨰ܨà°ÐàܰÀÌØíQÉѰ԰̤)%ÉɽȱÐìÐìÄQ¡¸5½ÕÍ ±¥¬ ÀÌØí ±¥¬°ÀÌØíMÉ¡IÍÕ±ÐÅlÁt¬ÄÔ°ÀÌØíMÉ¡IÍÕ±ÐÅlÅt¬Ð԰̤ܰ)¹% AutoIt3 Online Help Share this post Link to post Share on other sites
Oreoshakes 0 Posted August 9, 2007 maybe turning this:$SearchResult1 = PixelSearch(252,196,768,487,$TargetG,5,3) $SearchResult2 = PixelSearch(252,196,768,487,$TargetW,5,3)oÝ÷ Ú)í¡©Þ²×!ü(ºWp¢¹¢·±jjey«¢+ØÀÌØíMÉ¡IÍÕ±ÐÄôA¥á±MÉ ÈÔȰÄ䨰ܨà°ÐàܰÀÌØíQÉѰ԰̤)%ÉɽȱÐìÐìÄQ¡¸)5½ÕÍ ±¥¬ ÀÌØí ±¥¬°ÀÌØíMÉ¡IÍÕ±ÐÅlÁt¬ÄÔ°ÀÌØíMÉ¡IÍÕ±ÐÅlÅt¬Ð԰̤ܰ)±Í(ÀÌØíMÉ¡IÍÕ±ÐÈôA¥á±MÉ ÈÔȰÄ䨰ܨà°ÐàܰÀÌØíQÉѰ԰̤)%ÉɽȱÐìÐìÄQ¡¸5½ÕÍ ±¥¬ ÀÌØí ±¥¬°ÀÌØíMÉ¡IÍÕ±ÐÅlÁt¬ÄÔ°ÀÌØíMÉ¡IÍÕ±ÐÅlÅt¬Ð԰̤ܰ)¹% I'll see if it works. Share this post Link to post Share on other sites
Oreoshakes 0 Posted August 9, 2007 (edited) Now I'm getting error "WEnd" with no "While" statement. This could just be because there is an error between the two right? Sorry I'm a total noob at this I've been doing this same script for days. While 1 = 1 Sleep(100) $SearchResult1 = PixelSearch(252,196,768,487,$TargetG,5,3) If @error <> 1 Then MouseClick($Click, $SearchResult1[0]+15, $SearchResult1[1]+45, 7, 3) Else $SearchResult2 = PixelSearch(252,196,768,487,$TargetW,5,3) If @error <> 1 then MouseClick($Click, $SearchResult2[0]+15, $SearchResult2[1]+45, 7, 3) Send("{F1}") Send("{F3}") if $SearchResult1 = PixelSearch(237,193,806,638,$TargetG,5,1) Then if $SearchResult2 = PixelSearch(237,193,806,638,$TargetW,5,1) Then Send("{Right}") $SearchResult1 = PixelSearch(342,342,1000,342,$TargetG,5,3 if @error <> 1 then MouseClick($Click, $SearchResult1[0]+15, $SearchResult1[1]+45, 7, 3) Else $SearchResult2 = PixelSearch(342,342,1000,342,$TargetW,5,3) If @error <> 1 then MouseClick($Click, $SearchResult2[0]+15, $SearchResult2[1]+45, 7, 3) Send("{F1}") Send("{F3}") if $SearchResult1 = PixelSearch(237,193,806,638,$TargetG,5,1) Then Send("{F1}") Send("{F3}") else if $SearchResult2 = PixelSearch(237,193,806,638,$TargetW,5,1) Then Send("{F1}") Send("{F3}") Wend Func _Exit() Exit EndFunc Edited August 9, 2007 by Oreoshakes Share this post Link to post Share on other sites
DW1 102 Posted August 9, 2007 Post the code that errors AutoIt3 Online Help Share this post Link to post Share on other sites
Oreoshakes 0 Posted August 9, 2007 I don't know I might have set this up completely wrong lol Share this post Link to post Share on other sites