Jump to content

Some Checkbox Efficiency


murdock
 Share

Recommended Posts

Im just wondering if there are any little tricks to make this checkbox stuff I have going on a little more efficient:

Heres how I compare what the checkboxes mean, at the bottom of this snippet is how I compare whether to procede:

Func Pixels()
        If $cbstr Then 
            $str_check = PixelSearch(107, 305, 117, 310, 0xD3D01E, 30)
            If Not @error And $cbstr
                Then $str = 1
            EndIf
        EndIf
        If $cbint Then
            $int_check = PixelSearch(107, 327, 117, 334, 0xD5E143, 30)
            If Not @error Then
                $int = 1
            EndIf
        EndIf
        If $cbdex Then
            $dex_check = PixelSearch( 107, 349, 117, 353, 0xB4CA25, 30)
            If Not @error Then
                $dex = 1
            EndIf
        EndIf
        If $cbcon Then
            $con_check = PixelSearch( 107, 371, 117, 377, 0xD7DB47, 30)
            If Not @error Then
                $con = 1
            EndIf
        EndIf
        If $cbwis Then
            $wis_check = PixelSearch( 107, 392, 117, 399, 0xB3C522, 30)
            If Not @error Then
                $wis = 1
            EndIf
        EndIf
        If $cbcha Then
            $cha_check = PixelSearch( 107, 412, 117, 420, 0xD0BF1E, 30)
            If Not @error Then 
                $cha = 1
            EndIf
        EndIf

        Sleep(100)
        $total = $str + $int + $dex + $con + $wis + $cha
        Sleep(100)
        If $total = $cbtotal Then Box()oÝ÷ Øw«zÈhÀ^µêæw°'!rº1zÌ­ç!yÉu«­¢+Ø$%
ÍÀÌØíµÍôÀÌØí    ÕÑѽ¹|Äà($$%%U%
ÑɱI ÀÌØí
¡­½á|ÄÀ¤ôÀÌØíU%}
!
-Q¡¸ÀÌØíÍÑÈôÄ($$%%U%
ÑɱI ÀÌØí
¡­½á|ÄĤôÀÌØíU%}
!
-Q¡¸ÀÌØí¥¹ÐôÄ($$%%U%
ÑɱI ÀÌØí
¡­½á|ÄȤôÀÌØíU%}
!
-Q¡¸ÀÌØíàôÄ($$%%U%
ÑɱI ÀÌØí
¡­½á|Ä̤ôÀÌØíU%}
!
-Q¡¸ÀÌØí½¸ôÄ($$%%U%
ÑɱI ÀÌØí
¡­½á|ÄФôÀÌØíU%}
!
-Q¡¸ÀÌØíÝ¥ÌôÄ($$%%U%
ÑɱI ÀÌØí
¡­½á|ÄÔ¤ôÀÌØíU%}
!
-Q¡¸ÀÌØí¡ôÄ($$$ÀÌØíѽѰôÀÌØíÍÑȬÀÌØí¥¹Ð¬ÀÌØíà¬ÀÌØí½¸¬ÀÌØíݥ̬ÀÌØí¡

I only ask about efficiency because sometimes I notice that it skips past Box() sometimes, and I assume the pixel search is what is consuming time.

Link to comment
Share on other sites

For it to skip, must only mean one thing, that the value isn't = to the other. For us to test the full functionality, it is needed that we have a full script to test with... =)

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...