Jump to content
Sign in to follow this  
Oreoshakes

Need PixelSearch help

Recommended Posts

Oreoshakes

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
Oreoshakes

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

can you rephrase this? it is not clear what you want to do

I think he wants 1 array that takes the results from both searches.

Share this post


Link to post
Share on other sites
DW1

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

Share this post


Link to post
Share on other sites
DW1

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

Share this post


Link to post
Share on other sites
Oreoshakes

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

I'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
DW1

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¬Ð԰̤ܰ)¹%

Share this post


Link to post
Share on other sites
Oreoshakes

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

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 by Oreoshakes

Share this post


Link to post
Share on other sites
Oreoshakes

I don't know I might have set this up completely wrong lol

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×