Sign in to follow this  
Followers 0
bobbby

mousemove drawing

5 posts in this topic

I don't know how i can fix so mousemove can draw from 1 point to another.

Like the mousedrag method. But the mousedrag doesn't work when i do it.

So i need to do this like a workaround. I'm so lost also, how should i do it?

It should also draw - and then _ and go down.

I use +16 because the linetool is 16 in width and height.

hotkeyset("{f2}","doit")

Opt("MouseClickDownDelay", 1)
Opt("MouseClickDelay", 1)
Opt("MouseCoordMode", 2)

global $f = 0,$xx = 0

func doit()
    $pos = mousegetpos()
    global $f = 0,$xx = 0
    for $i = 1 to 10
        for $x = 1 to 2
            mousedown("left")
            mousemove($pos[0]+$xx,$pos[1]+$f,1)
            $xx += 16
        Next
        $f += 16
    Next
    mouseup("left")
EndFunc

while 1
    sleep(100)
WEnd

Share this post


Link to post
Share on other sites



You are declaring a global var twice.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

It should also draw - and then _ and go down.

If I open paint and select Pencil I get - then \ and the again -.

Can you explain what the - and then _ mean?

If you only want - and then - lower without the \ you can try:

HotKeySet("{f2}", "doit")
HotKeySet("{f3}", "StopAll")
Opt("MouseClickDownDelay", 1)
Opt("MouseClickDelay", 1)
Opt("MouseCoordMode", 2)
Global $f = 0, $xx = 0, $OPOs[2]
Func doit()
    $Pos = MouseGetPos()
    $OPOs[0] = $Pos[0]
    $OPOs[1] = $Pos[1]
    For $i = 1 To 10
      For $x = 0 To 2
            MouseMove($Pos[0] + $xx, $Pos[1] + $f, 20)
            MouseDown("left")
            $xx += 16
        Next
        $f += 16
        MouseUp("left")
    Next
    MouseMove($OPOs[0], $OPOs[1], 1)
EndFunc   ;==>doit
While 1
    Sleep(100)
WEnd
Func StopAll()
    Exit
EndFunc   ;==>StopAll
Edited by JoHanatCent

Share this post


Link to post
Share on other sites

If I open paint and select Pencil I get - then \ and the again -.

Can you explain what the - and then _ mean?

If you only want - and then - lower without the \ you can try:

Not like that. It should start at orange and end in lightgreen.

Here is how i mean, http://imgur.com/W0poB.png.

Like this:

#############

#############

#############

#############

Not like this:

####---------

----####-----

--------####-

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Like this:

#############

#############

#############

#############

Like this?:

HotKeySet("{F2}", "doit")
HotKeySet("{F3}", "StopAll")
Opt("MouseClickDownDelay", 1)
Opt("MouseClickDelay", 1)
Opt("MouseCoordMode", 2)
Global $f = 0, $xx = 0, $OPOs[2]
Func doit()
    $Pos = MouseGetPos()
    $OPOs[0] = $Pos[0];x
    $OPOs[1] = $Pos[1];y
    For $i = 1 To 10
        For $x = 0 To 2
            MouseMove($Pos[0] + $xx, $Pos[1] + $f, 5)
            MouseDown("left")
            $xx += 16
        Next
        $f += 16
        $xx = 0
        MouseUp("left")
    Next
    MouseMove($OPOs[0], $OPOs[1], 1)
EndFunc   ;==>doit
While 1
    Sleep(10)
WEnd
Func StopAll()
    Exit
EndFunc   ;==>StopAll
Edited by JoHanatCent

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