Jump to content

MouseClick Issue


Progh0st
 Share

Recommended Posts

I have an issue with mouseclick on windows 7 64bit, it simply dosen't work. I'm trying to send mouseclick on a fullscreen window. 

What have i tried:

-  Run as admin

-  Tryed different Opt mouse coords modes and pixel as well

-  Compile it 32 and 64 bit same result, not working

 

And i ran out of ideas, does anyone know what is going on with windows 7 and mouseclicks!

Link to comment
Share on other sites

Nothing is going on, it's perfectly fine.

Post the exact code you're having trouble with.

#RequireAdmin
#include <Misc.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
;#NoTrayIcon

Opt("MouseCoordMode", 0)
Opt("PixelCoordMode", 0)
Opt("MouseClickDelay", 0)

;MsgBox(4096, "", "")

If Not _Singleton(@Scriptname, 1) Then
    MsgBox(4096, "Is Running", "Program is already running .-.")
    Exit
EndIf
Global $searchcolor = 0xF24A17
Global $dll = DllOpen("user32.dll")

#Region ### START Koda GUI section ### Form=
Global $Form1 = GUICreate("Clicker", 351, 86, 556, 458)
$Label1 = GUICtrlCreateLabel("Set sleep delay", 8, 8, 288, 17)
Global $Button1 = GUICtrlCreateButton("Start", 8, 56, 339, 25)
Global $Input = GUICtrlCreateInput("25", 8, 32, 337, 21)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            $Read = GUICtrlRead($Input)
            Global $Sleep = $Read
            If $Read = "" Then
                MsgBox(4096, "Error", "You cannot leave this space empty!")
                Exit
            Else
                GUIDelete($Form1)
                Call("Check")
            EndIf
    EndSwitch
WEnd


Func Check()
If WinExists("[class:46813]") Then
    Call("clicker")
Else
    MsgBox(4096, "clicker", "Waiting for app to start")
    WinWait("[class:46813]")
    Sleep(10000)
    Call("clicker")
EndIf
EndFunc

 

 

Func clicker()


While WinExists("[class:46813]") = True
$pos = MouseGetPos()
$coord = PixelSearch(($pos[0] - 100) , ($pos[1] - 100) , ($pos[0] + 100) , ($pos[1] + 100), $searchcolor)
If _IsPressed(72, $dll) Then
    Exit
EndIf
If IsArray($coord) = 1 Then
    MouseClick("Left", Default, Default, 1, 0)
    Sleep($Sleep)
EndIf
WEnd
Exit
EndFunc

Link to comment
Share on other sites

Are you expecting the mouse to move somewhere? because you have default for both x and y, meaning mouse will click at current position.

No, i don't want it to move. But i can tell you that it works fine on my sisters laptop with win 8.1 64 bit but not on win 7 64bit, i have no idea why...

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

×
×
  • Create New...