Sign in to follow this  
Followers 0
AdamSwe

Help me out with this plz:)

7 posts in this topic

Hello, im quite new to autoit and wonder if anyone can look over this script for me, i get a error message that says something about an overflow

;member 1
Func check()
if (pixelgetcolor (189,271) = 0x000000 ) then
mouseclick("left", 189, 271, 6)
    Send("{f9}")
    sleep(10000)
    send("0000")
    sleep (10000)
    send("{f9}")
check2()
else
check2()
endif
endfunc

;member 2
Func check2()
if (pixelgetcolor (189,334) = 0x000000) then
mouseclick("left", 189, 334, 6)
    Send("{f9}")
    sleep(10000)
    send("0000")
    sleep (10000)
    send("{f9}")
check3()
else
check3()
EndIf
endfunc

;member 3
Func check3()
if (pixelgetcolor (189, 417) = 0x000000) then
mouseclick("left", 189, 417, 6)
    Send("{f9}")
    sleep(10000)
    send("0000")
    sleep (10000)
    send("{f9}")
check4()
else
check4()
EndIf
endfunc

;member 4
Func check4()
if (pixelgetcolor (189, 490) = 0x000000) then
mouseclick("left", 189, 490, 6)
    Send("{f9}")
    sleep(10000)
    send("0000")
    sleep (10000)
    send("{f9}")
check5()
else
check5()
EndIf
endfunc

;member 5
Func check5()
if (pixelgetcolor (189, 563) = 0x000000) then
mouseclick("left", 189, 563, 6)
    Send("{f9}")
    sleep(10000)
    send("0000")
    sleep (10000)
    send("{f9}")
check6()
else
check6()
EndIf
endfunc

;member 6
Func check6()
if (pixelgetcolor (332, 271) = 0x000000) then
mouseclick("left", 332, 271, 6)
    Send("{f9}")
    sleep(10000)
    send("0000")
    sleep (10000)
    send("{f9}")
check7()
else
check7()
EndIf
endfunc

;member 7
Func check7()
if (pixelgetcolor (332, 334) = 0x000000) then
mouseclick("left", 332, 334, 6)
    Send("{f9}")
    sleep(10000)
    send("0000")
    sleep (10000)
    send("{f9}")
check()
else
check()
EndIf
endfunc

while 1 = 1
check()
WEnd

Share this post


Link to post
Share on other sites



you are calling check() too many times, is an infinite loop...

Share this post


Link to post
Share on other sites

you are calling check() too many times, is an infinite loop...

Well how can i make it loop first check then check2 then check 3 down to check7 and start over again?

Share this post


Link to post
Share on other sites

Make all the CheckX()'s into one function.


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

Make all the CheckX()'s into one function.

could yo help me with that? couse i have no idea how to implant all into one :)

Share this post


Link to post
Share on other sites

this should works:

Global $Coordinates[7][2] = [[189, 271],[189, 334],[189, 417],[189, 490],[189, 563],[332, 271],[332, 334]]

While 1
    For $x = 0 To 6
        If PixelGetColor($Coordinates[$x][0], $Coordinates[$x][1]) = 0x000000 Then
            MouseClick('Left', $Coordinates[$x][0], $Coordinates[$x][1], 6)
            Send("{F9}")
            Sleep(10000)
            Send("0000")
            Sleep(10000)
            Send("{F9}")
        EndIf
    Next
    Sleep(10)
WEnd

Share this post


Link to post
Share on other sites

Ty for help ombra, works great.

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