Sign in to follow this  
Followers 0
ken107

Second IF wont work

7 posts in this topic

    While 1

        $Pixel = PixelSearch(1525, 791, 1839, 1022, 0xBE670A, 1)
        If Not @error Then


            MouseMove($Pixel[0], $Pixel[1])
            Send("A")
            MouseClick("Primary")
            MouseMove(1694, 700)
            MouseClick("secondary")
            Sleep(10000)


            $Pixel1 = PixelSearch(283, 993, 283, 993, 0x000000, 10)
            If IsArray($Pixel1) = True Then

                MouseMove($Pixel1[0], $Pixel1[1])
                MouseClick("primary")
                MouseMove($PixelBlau[0], $PixelBlau[1])
                MouseClick("secondary")
                Sleep(7000)
                Send("b")
                Sleep(5000)


            EndIf
        EndIf
    WEnd

 

 

habe keine fehler beim testen aber er will die "

 $Pixel1 = PixelSearch(283, 993, 283, 993, 0x000000, 10)
            If IsArray($Pixel1) = True Then

                MouseMove($Pixel1[0], $Pixel1[1])
                MouseClick("primary")
                MouseMove($PixelBlau[0], $PixelBlau[1])
                MouseClick("secondary")
                Sleep(7000)
                Send("b")
                Sleep(5000)"

nicht starten
verstehe aber nicht warum ?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hi, das ist ein englisches Forum, daher antworte ich Dir englisch...

 

The array $PixelBlau is not declared

IsArray() will return true, when it's an array, so it's not required to compare the result to "True"

Anyway you would need to put it into "()", as Autoit takes the first possible result. In this case it doesn't matter, but other comparations would give you unexpected results:

 

if (isarray($pixel1) = false) then
    ; code
endif

The 2nd if is never closed using endif

 

This script is executable, but no clue, what it's good for:

 

dim $PixelBlau[2]=[100,200]


While 1
    $Pixel = PixelSearch(1525, 791, 1839, 1022, 0xBE670A, 1)
    If Not @error Then


        MouseMove($Pixel[0], $Pixel[1])
        Send("A")
        MouseClick("Primary")
        MouseMove(1694, 700)
        MouseClick("secondary")
        Sleep(10000)


        $Pixel1 = PixelSearch(283, 993, 283, 993, 0x000000, 10)
        If IsArray($Pixel1) Then

            MouseMove($Pixel1[0], $Pixel1[1])
            MouseClick("primary")
            MouseMove($PixelBlau[0], $PixelBlau[1])
            MouseClick("secondary")
            Sleep(7000)
            Send("b")
            Sleep(5000)


        EndIf
    EndIf
WEnd





$Pixel1 = PixelSearch(283, 993, 283, 993, 0x000000, 10)
If IsArray($Pixel1) Then
    MouseMove($Pixel1[0], $Pixel1[1])
    MouseClick("primary")
    MouseMove($PixelBlau[0], $PixelBlau[1])
    MouseClick("secondary")
    Sleep(7000)
    Send("b")
    Sleep(5000)
EndIf

Regards, Rudi.

 

Schöne Grüße, Rudi. Wenn Du kein Englisch kannst, schick' mir eine PM (Personal Message)

Edited by rudi

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

thanks for your fast answer, blue is declared over the While 1
i didnt copy and paste it like the EndIf

 

so if i understand it right

If IsArray($Pixel1) = True Then


If IsArray($Pixel1) =  Then          (this works)

 

 

im right?

Edited by ken107

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Yeah if fix this problem already but he wont do the move to the "pixel1"

i dont know is there a problem for it that cuz This pixel has not all the time this color!! so, first the pixel at this region (283, 993 , 283, 993, (green dunno the 0x.) after a random time it change to 0x000000

 

 

the funny thing if i run this :

$PixelBlau = PixelSearch(1541, 875, 1861, 929, 0x186ABA, 2)

While 1
    $Pixel1 = PixelSearch(235, 991, 299, 993, 0x000000,2)
    If IsArray($Pixel1) Then
        MouseMove($Pixel1[0], $Pixel1[1])
        MouseClick("primary")
        MouseMove($PixelBlau[0], $PixelBlau[1])
        MouseClick("secondary")
        Sleep(7000) 
        Send("b")
        Sleep(5000)


    EndIf
WEnd

this works perfectly but inside the other code he wont react!

Quote

 

Spoiler


 

Edited by ken107

Share this post


Link to post
Share on other sites
41 minutes ago, ken107 said:

the funny thing if i run this :

$PixelBlau = PixelSearch(1541, 875, 1861, 929, 0x186ABA, 2)

While 1
    $Pixel1 = PixelSearch(235, 991, 299, 993, 0x000000,2)
    If IsArray($Pixel1) Then
        MouseMove($Pixel1[0], $Pixel1[1])
        MouseClick("primary")
        MouseMove($PixelBlau[0], $PixelBlau[1])
        MouseClick("secondary")
        Sleep(7000) 
        Send("b")
        Sleep(5000)


    EndIf
WEnd

this works perfectly but inside the other code he wont react!

then show the other code!

Share this post


Link to post
Share on other sites

$Pixelblau = PixelSearch (1541, 875, 1861, 929, 0x186ABA, 2)

Quote
While 1
    $Pixel = PixelSearch(1525, 791, 1839, 1022, 0xBE670A, 1)
    If Not @error Then


        MouseMove($Pixel[0], $Pixel[1])
        Send("A")
        MouseClick("Primary")
        MouseMove(1694, 700)
        MouseClick("secondary")
        Sleep(10000)


        $Pixel1 = PixelSearch(283, 993, 283, 993, 0x000000, 10)
        If IsArray($Pixel1) Then

            MouseMove($Pixel1[0], $Pixel1[1])
            MouseClick("primary")
            MouseMove($PixelBlau[0], $PixelBlau[1])
            MouseClick("secondary")
            Sleep(7000)
            Send("b")
            Sleep(5000)


        EndIf
    EndIf
WEnd

dont care about the shader variation.

 

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  
Followers 0