Sign in to follow this  
Followers 0
NiklasNiko

My script doesnt count the loops

2 posts in this topic

#1 ·  Posted

Hello i started scripting 2 days ago and with the help of some sites i made this  script, but it doesnt count how it should do,

The local number on both (Red and Blue) seems to be always 1 and nothing changes it . would be nice if someone can tell me the trick and

how my script itself is (Quality good or bad)

Thanks

$Color = PixelGetColor(1493, 514)
$Blue = 0x45B5DA
$Red = 0xC8354
Local $BlueCount = 0
Local $RedCount = 0

While 1
    Local $iCheckSum = PixelChecksum(1472, 218, 1530, 521)

    While $iCheckSum = PixelChecksum(1472, 218, 1530, 521)
        Sleep(100)
    WEnd

    ;BLUE;



    MouseClick("Left", 211, 467)
    Sleep(100)
    Send("{BS}")
    Sleep(100)
    Send("{BS}")
    Sleep(100)
    Send("{BS}")
    Sleep(100)
    Send("{BS}")
    Sleep(3100)

    If $Color = $Blue Then
        $BlueCount = 0
        Send("10")
        MouseClick("Left", 1212, 650)

    Else
        $BlueCount = $BlueCount + 1

    EndIf

    If $BlueCount = 1 Then Send("10")
    If $BlueCount = 2 Then Send("10")
    If $BlueCount = 3 Then Send("10")
    If $BlueCount = 4 Then Send("12")
    If $BlueCount = 5 Then Send("14")
    If $BlueCount = 6 Then Send("17")
    If $BlueCount = 7 Then Send("21")
    If $BlueCount = 8 Then Send("25")
    If $BlueCount = 9 Then Send("30")
    If $BlueCount = 10 Then Send("36")
    If $BlueCount = 11 Then Send("43")
    If $BlueCount = 12 Then Send("52")
    If $BlueCount = 13 Then Send("62")
    If $BlueCount = 14 Then Send("74")
    If $BlueCount = 15 Then Send("89")
    If $BlueCount = 16 Then Send("107")
    If $BlueCount = 17 Then Send("128")
    If $BlueCount = 18 Then Send("154")
    If $BlueCount = 19 Then Send("185")
    If $BlueCount = 20 Then Send("222")
    If $BlueCount = 21 Then Send("266")
    If $BlueCount = 22 Then Send("319")
    MouseClick("Left", 1212, 650)

    ;Red;



    MouseClick("Left", 211, 467)
    Sleep(100)
    Send("{BS}")
    Sleep(100)
    Send("{BS}")
    Sleep(100)
    Send("{BS}")
    Sleep(100)
    Send("{BS}")

    If $Color = $Red Then
        $RedCount = 0
        Send("10")
        MouseClick("Left", 768, 659)

    Else
        $RedCount = $RedCount + 1

    EndIf

    If $RedCount = 1 Then Send("13")
    If $RedCount = 2 Then Send("18")
    If $RedCount = 3 Then Send("24")
    If $RedCount = 4 Then Send("32")
    If $RedCount = 5 Then Send("42")
    If $RedCount = 6 Then Send("")
    If $RedCount = 7 Then Send("21")
    If $RedCount = 8 Then Send("25")
    If $RedCount = 9 Then Send("30")
    If $RedCount = 10 Then Send("36")
    If $RedCount = 11 Then Send("42")
    If $RedCount = 12 Then Send("56")
    If $RedCount = 13 Then Send("75")
    If $RedCount = 14 Then Send("100")
    If $RedCount = 15 Then Send("133")
    If $RedCount = 16 Then Send("178")
    If $RedCount = 17 Then Send("237")
    If $RedCount = 18 Then Send("316")
    If $RedCount = 19 Then Send("421")
    MouseClick("Left", 768, 659)

    ;Black;

    MouseClick("Left", 211, 467)
    Sleep(100)
    Send("{BS}")
    Sleep(100)
    Send("{BS}")
    Sleep(100)
    Send("{BS}")
    Sleep(100)
    Send("{BS}")
    Send("10")
    MouseClick("Left", 328, 656)

WEnd

 

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

@NiklasNiko a couple of things..

First, moved your post to the appropriate forum, please pay attention to where you post in the future. The DEV forum very clearly states:

Quote

Do not create AutoIt-related topics here, use AutoIt General Help and Support

Second, please explain exactly what you're trying to accomplish, or what application you're automating. You will find all the mouseclicks and pixelsearching are going to give you headaches; there is undoubtedly a better way.

Edited by JLogan3o13

√-1 2^3 ∑ π, and it was delicious!

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