Jump to content

counter based on button pressed


 Share

Recommended Posts

I am having two problems

1) When I add in the checksum needs to be a certain value it never adds to the counter

2) The counter does not count in intervals of 1 it seems to be some random interval with no pattern

Here is my code

#include <GUIConstants.au3>
#include <Misc.au3>

Dim $post = 0

Opt("GUICoordMode", 1)
Opt("WinTitleMatchMode", 1)
Opt("MouseCoordMode", 2)
WinActivate("Casino")
WinWaitActive("Casino")
$repeat = PixelChecksum(263, 411, 263+6, 411+12)
While 1
    
    If _IsPressed(01) Then
   ;MsgBox(0,"test", " cool"); for testing
        $pos = MouseGetPos()
        
   ; position of 1 button
        If $pos[0] > 168 And $pos[0] < 241 And $pos[1] > 373 And $pos[1] < 399 Then $post = 1
        
   ; position of 2 button
        If $pos[0] > 233 And $pos[0] < 339 And $pos[1] > 398 And $pos[1] < 424 And $repeat == 2938540933 Then $post = 1
        
   ; position of 3 button
        If $pos[0] > 408 And $pos[0] < 466 And $pos[1] > 373 And $pos[1] < 399 Then $post = 1

        If $post = 1 Then
            $currentvalue = IniRead ("counter.ini", "counter", "currentcount", "0" ) + 1
            Iniwrite ( "counter.ini", "counter", "currentcount", $currentvalue )
            $post = 0
        EndIf
            
    EndIf
Sleep(50)
WEnd

Any ideas why this is?

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