Sign in to follow this  
Followers 0
fetush

MouseClickPlus problem. used as an alternative to MouseMove and MouseClick

14 posts in this topic

#1 ·  Posted (edited)

Func cubemouse($x2,$y2,$Range,$speed)
While $Range > 10
MouseMove($x2-$Range , $y2-$Range ,$speed)
$pos = MouseGetPos()
$poscurY = $pos[1]
while $poscurY < $y2 + $Range
$poscurY += 20
_MouseClickPlus("", "right", $x2-$Range, $poscurY, 1)
;~ MouseClick("right",$x2-$Range ,$poscurY,1,$speed)
WEnd
MouseMove($x2-$Range , $y2+$Range ,$speed)

$pos = MouseGetPos()
$poscurX = $pos[0]
while $poscurX < $x2 + $Range
$poscurX += 20
_MouseClickPlus("", "right", $poscurX, $y2+$Range, 1)
;~ MouseClick("right", $poscurX, $y2+$Range,1,$speed)
WEnd
MouseMove($x2+$Range , $y2+$Range ,$speed)

while $poscurY > $y2 - $Range
$poscurY -= 20
_MouseClickPlus("", "right", $x2+$Range, $poscurY, 1)
;~ MouseClick("right",$x2+$Range, $poscurY, 1,$speed)
WEnd


MouseMove($x2+$Range , $y2-$Range ,$speed)
$pos = MouseGetPos()
$poscurX = $pos[0]
while $poscurX > $x2 - $Range + 20
$poscurX -= 20
_MouseClickPlus("", "right", $poscurX, $y2-$Range, 1)
;~ MouseClick("right",$poscurX ,$y2-$Range,1,$speed)
WEnd
WEnd
EndFunc

trying to do this for fun...

what this does is just clicks mmouse in a "Square" format from middle start point.

i dont get how can i make mouseclickplus work in this whole thing :)

with mouseclick() its obvious and easy , but using mouseclickplus() its different because the mouse isnt moving with it actualy.. and there im stuck ... how can i make mouseclickplus work as it is with mouseclick()

Edited by fetush

Share this post


Link to post
Share on other sites



fetush,

You probably have no replies because n-one knows what MouseClickPlus is. ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

ow , its just a udf used to click mouse without actualy moving your mouse around screen.

should i put up the udf?

Share this post


Link to post
Share on other sites

fetush,

Or post a link to where you found it. :)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

;===============================================================================
; Function Name:  _MouseClickPlus()
; Version added:  0.1
; Description:    Sends a click to window, not entirely accurate, but works
;                minimized.
; Parameter(s):   $Window    =  Title of the window to send click to
;                $Button     =  "left" or "right" mouse button
;                $X       =  X coordinate
;                $Y       =  Y coordinate
;                $Clicks     =  Number of clicks to send
; Remarks:      You MUST be in "MouseCoordMode" 0 to use this without bugs.
; Author(s):      Insolence <insolence_9@yahoo.com>
;===============================================================================
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   ;==>_MouseClickPlus

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

this is it :)

Share this post


Link to post
Share on other sites

Have you tried to automate the interaction with the application by its controls instead of just mouse clicking? That is MUCH more stable. Also, your OP is basically asking for how to search for a pixel on the screen then click on it. Search the forum for what you are asking for and you will find this question has been answered many times with creative solutions. ;)

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Have you tried to automate the interaction with the application by its controls instead of just mouse clicking? That is MUCH more stable. Also, your OP is basically asking for how to search for a pixel on the screen then click on it. Search the forum for what you are asking for and you will find this question has been answered many times with creative solutions. ;)

what do u mean by that

EDIT : also in search i get only 1 result :s my thread

Edited by fetush

Share this post


Link to post
Share on other sites

i dont get how can that help with my cubemouse MouseClickPlus() problem

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

Let me make it simple for you:

The issue you describe in your original post has been asked hundreds of times now in this forum. It has been answered hundreds of times in the forum.

Do a search of the forum and you will find what you seek. Use "Pixelsearch Mouseclick" as your search string.

------------

By your other you have little knowledge of AutoIt. You post code that is advanced in design but you have no idea how to interact with a control? Did you even write any of the code you posted?

Edited by scullion

Share this post


Link to post
Share on other sites

are u suggesting me to use pixelseach ? :D

because i dont want to use pixel seach at all :P

but im still looking at the seach results

Share this post


Link to post
Share on other sites

i added him but no answer

and i looked through alot seach results , but nothing related to my problem.

maybe im just bad at seaching forums..

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  
Followers 0