Jump to content

Mouse lock with Vista


Pera
 Share

Recommended Posts

Hello All,

I am having a problem with my script. For whatever reason, mouseclick (left click) gets disabled with Vista when the script runs the relog() function in my script. The mouse movements are still happening however it appears that vista doesn't recognize the left click. This issue remains until I kill the script using ctrl+alt+del. I am not sure if somewhere in my code I am losing mouse hook or something to that extend or maybe this is a common problem with vista/auto it. I would appreciate any help.

Thanks.

#include <misc.au3> 

While 1
    
    $timer = 0 
    
    While $timer < 180 And WinExists("AION Client" )
        
        If PixelGetColor (896, 118) = 5813864 Then   ;;0x58B668
            $timer = 0
        EndIf
        
    If Not WinExists("AION Client" ) Then
        relog()
    ;;ElseIf PixelGetColor ( 472, 956, "") = 16711680 Then
        ;;startgoblin()
    ElseIf PixelGetColor ( 889, 569, "AION Client") = 3616810 Then
        resurrect() 
    ElseIf Not PixelGetColor ( 472, 956, "AION Client") = 107703 Then
        relog()
    ElseIf WinExists("Game not Found.") Then
        closegamenotfound()
    EndIf
        
    $timer = $timer + 1 
    Sleep(1000)
        
    WEnd
    
    WinClose( "AION Client")
    Sleep(10000)
    relog()
    
WEnd
        
func relog() 
    If Not WinExists("AION Client" ) Then
        Sleep(10000)
        Send("{f8}")
        Sleep(5000)
        MouseClick("left", 292, 13, 2, 10)
        Sleep(5000)
        MouseClick("left", 835, 583, 2, 10)
        Sleep(5000)
        MouseClick("left", 1632, 845, 2, 10)
        Sleep(5000)
        MouseClick("left", 1632, 845, 2, 10)
        Sleep(5000)
        MouseClick("left", 1635, 944, 2, 10)
        Sleep(10000)
        MouseClick("left", 535, 378, 1, 10)
        Sleep(5000)
        MouseClick("left", 565, 741, 1, 10)
        Sleep(55000)
        MouseClick("left", 832, 48, 1, 10)
        Sleep(5000)
        Send( "xxxx" )
        Sleep(5000)
        Send("{TAB}")
        Sleep(5000)
        Send( "xxxx" )
        Sleep(5000)
        MouseClick("left", 834, 513, 1, 10)
        Sleep(10000)
        MouseClick("left", 785, 917, 1, 10)
        Sleep(5000)
        MouseClick("left", 321, 798, 1, 10)
        Sleep(5000)
        MouseClick("left", 321, 798, 1, 10)
        Sleep(5000)
        MouseClick("left", 684, 916, 1, 10)
        Sleep(15000)
        Send("{f6}")
        Sleep(5000)
        MouseClick("left", 882, 564, 2, 10)
        Sleep(5000)
    Else
        Sleep(100)
    EndIf
    
    If Not PixelGetColor ( 472, 956, "AION Client") = 107703 Then
        relog()
    Else
        sleep(100)
    EndIf
    
EndFunc

;func startgoblin()
;   Send("{f8}")
;   Sleep(5000)
;   Send("{f6}")
;   Sleep(5000)
;   MouseClick("left", 882, 564, 2, 15)
;   Sleep(7000)
;EndFunc

func resurrect()
    MouseClick("left", 914, 564, 1, 10)
EndFunc

func closegamenotfound()
    Send("{f8}")
    Sleep(5000)
    MouseClick("left", 981, 587, 1, 15)
EndFunc
Edited by Pera
Link to comment
Share on other sites

Try _WinAPI_Mouse_Event(), might just work.

Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]

Link to comment
Share on other sites

Try _WinAPI_Mouse_Event(), might just work.

Hey,

Thanks for the reply. I am not very familiar with _WinApi functionality. The problem is, I believe somehow left and right click buttons get replaced or something. Everything else works fine.

Link to comment
Share on other sites

Hey,

Thanks for the reply. I am not very familiar with _WinApi functionality. The problem is, I believe somehow left and right click buttons get replaced or something. Everything else works fine.

Not sure how to switch buttons or test for that. Try seaching MSDN then you can made a DLL call to the function call that does that. Most AutoIt WinAPI function are wrappers for DLL calls, there are many examples on the forum of this.

Good luck!

Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]

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