Jump to content

emulate mouse movements


ihenvyr
 Share

Recommended Posts

  • Moderators

I don't know if it works with the arrows... but take a look at IsPressed()

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

CTRL+SHIFT+(tilda) to exit

HotKeySet("{LEFT}","weft")
HotKeySet("{RIGHT}","wight")
HotKeySet("^+`","bye")
While 1
    Sleep(10)
WEnd

Func bye()
    Exit
EndFunc
Func weft()
    Local $pos = MouseGetPos()
    MouseMove($pos[0] - 10, $pos[1],0)
EndFunc
Func wight()
    Local $pos = MouseGetPos()
    MouseMove($pos[0] + 10, $pos[1],0)
EndFunc

Thanks Larry you're a champ!! B)

..but still confuse me bout the UP arrow and DOWN arrow?

ive already spend 1 hour working but can't catch it!!

please ..anybody HELP :o

Umbrella Member

Link to comment
Share on other sites

Simple...

HotKeySet( "w", "_UpArrow")
HotKeySet( "s", "_DownArrow")
HotKeySet( "a", "_Leftarrow")
HotKeySet( "d", "_RightArrow")
HotKeySet( "q", "_LeftClick")
HotKeySet( "e", "_RightClick")
HotKeySet( "{F10}", "_Close")
$x = 100
$y = 100
$z = -1
MouseMove($x, $y)
While 1
    If $z = 0 Then
        Exit
    EndIf
Wend
Func _UpArrow()
    $y = $y - 10
    MouseMove($x, $y, 0)
EndFunc;==>_UpArrow
Func _DownArrow()
    $y = $y + 10
    MouseMove($x, $y, 0)
EndFunc;==>_DownArrow
Func _Leftarrow()
    $x = $x - 10
    MouseMove($x, $y, 0)
EndFunc;==>_Leftarrow
Func _RightArrow()
    $x = $x + 10
    MouseMove($x, $y, 0)
EndFunc;==>_RightArrow
Func _LeftClick()
    MouseClick( "left", $x, $y, 1, 0)
EndFunc;==>_LeftClick
Func _RightClick()
    MouseClick( "right", $x, $y, 1, 0)
EndFunc;==>_RightClick
Func _Close()
    $z = 0
    Exit
EndFunc;==>_Close

W = UpMouse

S = DownMouse

A =LeftMouse

D = RightMouse

Q = LeftClick

E = RightClick.

I'm sure if you study the code it will help.

Link to comment
Share on other sites

Simple...

HotKeySet( "w", "_UpArrow")
HotKeySet( "s", "_DownArrow")
HotKeySet( "a", "_Leftarrow")
HotKeySet( "d", "_RightArrow")
HotKeySet( "q", "_LeftClick")
HotKeySet( "e", "_RightClick")
HotKeySet( "{F10}", "_Close")
$x = 100
$y = 100
$z = -1
MouseMove($x, $y)
While 1
    If $z = 0 Then
        Exit
    EndIf
Wend
Func _UpArrow()
    $y = $y - 10
    MouseMove($x, $y, 0)
EndFunc;==>_UpArrow
Func _DownArrow()
    $y = $y + 10
    MouseMove($x, $y, 0)
EndFunc;==>_DownArrow
Func _Leftarrow()
    $x = $x - 10
    MouseMove($x, $y, 0)
EndFunc;==>_Leftarrow
Func _RightArrow()
    $x = $x + 10
    MouseMove($x, $y, 0)
EndFunc;==>_RightArrow
Func _LeftClick()
    MouseClick( "left", $x, $y, 1, 0)
EndFunc;==>_LeftClick
Func _RightClick()
    MouseClick( "right", $x, $y, 1, 0)
EndFunc;==>_RightClick
Func _Close()
    $z = 0
    Exit
EndFunc;==>_Close

W = UpMouse

S = DownMouse

A =LeftMouse

D = RightMouse

Q = LeftClick

E = RightClick.

I'm sure if you study the code it will help.

Thanks AutoIt Smith..

its very usefull!! B)

More Power!! :o

Umbrella Member

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