Jump to content

Help me out with this plz:)


AdamSwe
 Share

Recommended Posts

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
Link to comment
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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...