Jump to content
Sign in to follow this  
marcspc

MouseClick vs controlclick

Recommended Posts

marcspc

MouseClick click at the perfect coordinates

controlclick... make click but not at the coordinates

this is mouseclick, i did it with the recorder

#region ---Au3Recorder generated code Start ---
Opt("WinWaitDelay",100)
Opt("WinDetectHiddenText",1)
Opt("MouseCoordMode",0)

_WinWaitActivate("THEGAME","")
MouseClick("left",1108,314,1)

#region --- Internal functions Au3Recorder Start ---
Func _WinWaitActivate($title,$text,$timeout=0)
    WinWait($title,$text,$timeout)
    If Not WinActive($title,$text) Then WinActivate($title,$text)
    WinWaitActive($title,$text,$timeout)
EndFunc
#endregion --- Internal functions Au3Recorder End ---

#endregion --- Au3Recorder generated code End ---

this one is the controclick i did it by copiying one of the forum

ControlClick("THEGAME", "", "", "left", 1, 1108, 314)

it makes click, because if there isnt menu it shoot the weapon but i need it to click in some menu

did i missed something?

already tried using coordinates from Au3Info_x64.exe "screen" "window" and "client" modes, none works

the "Control" tab is empty

thanks a lot

Edited by marcspc

Share this post


Link to post
Share on other sites
marcspc

cant find the edit button, maybe i should go sleep...

have been testing more, the controlclick clicks in the actual possition of the mouse when executed, like if it was clicking trhougt the active window

there is the summary

>>>> Window <<<<
Title:  THEGAME
Class:  LaunchUnrealUWindowsClient
Position:   -7, 5
Size:   1680, 1021
Style:  0x14CA0000
ExStyle:    0x00040100
Handle: 0x00000000000B06C6

>>>> Control <<<<
Class:  
Instance:   
ClassnameNN:    
Name:   
Advanced (Class):   
ID: 
Text:   
Position:   
Size:   
ControlClick Coords:    
Style:  
ExStyle:    
Handle: 

>>>> Mouse <<<<
Position:   1169, 319
Cursor ID:  0
Color:  0x5C5C5C

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<


>>>> Hidden Text <<<<

all the times have censored the name of the game as THEGAME, i hope doesnt matter

Edited by marcspc

Share this post


Link to post
Share on other sites
bo8ster

Well firstly have a read of http://www.autoitscript.com/forum/index.php?showannouncement=11&f=2.

Secondly, have a look at the MouseCoordMode option in the help file.


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]

Share this post


Link to post
Share on other sites
marcspc

Well firstly have a read of http://www.autoitscript.com/forum/index.php?showannouncement=11&f=2.

Secondly, have a look at the MouseCoordMode option in the help file.

Opt("MouseCoordMode", 2)        ;1=absolute, 0=relative, 2=client

have tried the 3 options, and continue doing the same, it click through the window in the position of the mouse when i executed the script

thanks a lot for helping, do you have more ideas?

Share this post


Link to post
Share on other sites
bogQ

Mortal Online that you probably trying to automate is an 'multiplayer component'

So if thats the case, try one more time read the link that bo8ster geaved you before requesting additional help on this subject


TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 

Share this post


Link to post
Share on other sites
marcspc

Mortal Online that you probably trying to automate is an 'multiplayer component'

So if thats the case, try one more time read the link that bo8ster geaved you before requesting additional help on this subject

isnt mortal online. is a fps based on the unreal engine

have tried this script too, but do the same that ControlClick

Opt("MouseCoordMode", 0)

sleep(5000)
Func _MouseClickPlus($Window, $Button = "left", $X = "", $Y = "", $Clicks = 1)
  Local $MK_LBUTTON    =  0x0001
  Local $WM_LBUTTONDOWN   =  0x0201
  Local $WM_LBUTTONUP    =  0x0202
 
  Local $MK_RBUTTON    =  0x0002  
  Local $WM_RBUTTONDOWN   =  0x0204
  Local $WM_RBUTTONUP    =  0x0205

  Local $WM_MOUSEMOVE    =  0x0200
 
  Local $i              = 0
 
  Select
  Case $Button = "left"
     $Button     =  $MK_LBUTTON
     $ButtonDown =  $WM_LBUTTONDOWN
     $ButtonUp   =  $WM_LBUTTONUP
  Case $Button = "right"
     $Button     =  $MK_RBUTTON
     $ButtonDown =  $WM_RBUTTONDOWN
     $ButtonUp   =  $WM_RBUTTONUP
  EndSelect
 
  If $X = "" OR $Y = "" Then
     $MouseCoord = MouseGetPos()
     $X = $MouseCoord[0]
     $Y = $MouseCoord[1]
  EndIf
 
  For $i = 1 to $Clicks
     DllCall("user32.dll", "int", "SendMessage", _
        "hwnd",  WinGetHandle( $Window ), _
        "int",   $WM_MOUSEMOVE, _
        "int",   0, _
        "long",  _MakeLong($X, $Y))
       
     DllCall("user32.dll", "int", "SendMessage", _
        "hwnd",  WinGetHandle( $Window ), _
        "int",   $ButtonDown, _
        "int",   $Button, _
        "long",  _MakeLong($X, $Y))
       
     DllCall("user32.dll", "int", "SendMessage", _
        "hwnd",  WinGetHandle( $Window ), _
        "int",   $ButtonUp, _
        "int",   $Button, _
        "long",  _MakeLong($X, $Y))
  Next
EndFunc




Func _MakeLong($LoWord,$HiWord)
  Return BitOR($HiWord * 0x10000, BitAND($LoWord, 0xFFFF))
EndFunc


_MouseClickPlus("THEGAME","left",1302,346,1)

Share this post


Link to post
Share on other sites
marcspc

bump for asking help

Share this post


Link to post
Share on other sites
bo8ster

Have you tried just using a normal mouse click?

Is there anything in @error or @extended?

Edited by bo8ster

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]

Share this post


Link to post
Share on other sites
marcspc

Have you tried just using a normal mouse click?

Is there anything in @error or @extended?

yeah, mouse click works fine

for testin @error should i add something like this?

If @error Then

MsgBox("error")

about extended i have no idea, can you help me?

Share this post


Link to post
Share on other sites
bo8ster

Easy on the bumps - I get to you when I can. I'm sure I am in a different time zone - I was fast a sleep at 3.22AM

Its hard to say what is going on. If MouseClick("left",1108,314,1) works, why not just use that. If you did

If NOT WinActive("Title") then
   WinActive("Title")
End If
MouseClick("left",1108,314,1)

it would be the same thing.

Sometimes there is some more information stored in @extended usually as a string. You should check the return value of the function (and @error) to see if it was successful. If it was it means ur coords are wrong, it not it means you params ar wrong. The help file as many examples on @error and @extended, I tend to put them into a ConsoleWrite.

The answers are there, just have to search for them.


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]

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  

×