Sign in to follow this  
Followers 0
h3nno

mouse movement & audio

4 posts in this topic

hi, i have 2 queries

i am trying to make a mouse macro.

$pos = MouseGetPos()

HotKeySet("{End}",  "Terminate")

While 1
    Do
     $pos2 = MouseGetPos()
     If $pos[0]+$pos[1] <> $pos2[0]+$pos2[1] Then
            MouseMove(Random [0, 1000, Random [0,1000]])
    EndIf
    Until "Terminate"

WEnd

Func  Terminate()
    Exit 0
EndFunc

but the random part isn't working? :S i am not sure whats wrong with it.

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

also i use winamp and play css alot, i was wondering if there was a way i could use autoit

to create hotkeys to control winamp for pause/play, next track and previous track.

thanks

-h3nno

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

you can control winamp with objects, search for it and also there is an easier and simple way to do what you want, see below

If Not ProcessExists('winamp.exe') Then
    MsgBox(16, "Error", "Winamp not found")
    Exit
EndIf
Sleep(2000)
$start = ControlSend(WinGetTitle('Player Window'), '', 'BaseWindow_RootWnd1', 'x')
Sleep(2000)
$pause = ControlSend(WinGetTitle('Player Window'), '', 'BaseWindow_RootWnd1', 'c')
Sleep(2000)
$resume = ControlSend(WinGetTitle('Player Window'), '', 'BaseWindow_RootWnd1', 'x')
Sleep(2000)
$forward = ControlSend(WinGetTitle('Player Window'), '', 'BaseWindow_RootWnd1', 'b')
Sleep(2000)
$backward = ControlSend(WinGetTitle('Player Window'), '', 'BaseWindow_RootWnd1', 'z')
Sleep(2000)
$stop = ControlSend(WinGetTitle('Player Window'), '', 'BaseWindow_RootWnd1', 'v')
ExitoÝ÷ ÛöÚÊ-¯+aÆÚºÚ"µÍÌÍÜÜÈH[ÝÙQÙ]ÜÊ
BÝÙ^TÙ]
    ][ÝÞÑ[I][ÝË    ][ÝÕZ[]I][ÝÊBÚ[HBIÌÍÜÜÌH[ÝÙQÙ]ÜÊ
BRY ÌÍÜÜÖÌH
È  ÌÍÜÜÖÌWH  ÉÝÈ  ÌÍÜÜÌÌH
È  ÌÍÜÜÌÌWH[BS[ÝÙS[ÝJ[ÛJLJK[ÛJLJJBQ[YÑ[[ÈZ[]J
BQ^][[ÈÏOIÝÕZ[]
Edited by Gif

Share this post


Link to post
Share on other sites

you can control winamp with objects, search for it and also there is an easier and simple way to do what you want, see below

If Not ProcessExists('winamp.exe') Then
    MsgBox(16, "Error", "Winamp not found")
    Exit
EndIf
Sleep(2000)
$start = ControlSend(WinGetTitle('Player Window'), '', 'BaseWindow_RootWnd1', 'x')
Sleep(2000)
$pause = ControlSend(WinGetTitle('Player Window'), '', 'BaseWindow_RootWnd1', 'c')
Sleep(2000)
$resume = ControlSend(WinGetTitle('Player Window'), '', 'BaseWindow_RootWnd1', 'x')
Sleep(2000)
$forward = ControlSend(WinGetTitle('Player Window'), '', 'BaseWindow_RootWnd1', 'b')
Sleep(2000)
$backward = ControlSend(WinGetTitle('Player Window'), '', 'BaseWindow_RootWnd1', 'z')
Sleep(2000)
$stop = ControlSend(WinGetTitle('Player Window'), '', 'BaseWindow_RootWnd1', 'v')
ExitoÝ÷ ÛöÚÊ-¯+aÆÚºÚ"µÍÌÍÜÜÈH[ÝÙQÙ]ÜÊ
BÝÙ^TÙ]
    ][ÝÞÑ[I][ÝË    ][ÝÕZ[]I][ÝÊBÚ[HBIÌÍÜÜÌH[ÝÙQÙ]ÜÊ
BRY ÌÍÜÜÖÌH
È  ÌÍÜÜÖÌWH  ÉÝÈ  ÌÍÜÜÌÌH
È  ÌÍÜÜÌÌWH[BS[ÝÙS[ÝJ[ÛJLJK[ÛJLJJBQ[YÑ[[ÈZ[]J
BQ^][[ÈÏOIÝÕZ[]

thanks for that, but with the mouse macro, i only want it to move to a random position when the user moves the mouse.

that code ^^ continually moves around randomly after the user has moved the mouse once. :)

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

thanks for that, but with the mouse macro, i only want it to move to a random position when the user moves the mouse.

that code ^^ continually moves around randomly after the user has moved the mouse once. :)

just seen your post, try:

HotKeySet("{End}", "Terminate")

While 1
    $pos = MouseGetPos()
    $pos2 = MouseGetPos()
    If $pos[0] + $pos[1] <> $pos2[0] + $pos2[1] Then
        Do
            MouseMove(Random(0, 1000, 1), Random(0, 1000, 1))
        Until $pos[0] + $pos[1] <> $pos2[0] + $pos2[1]
    EndIf
WEnd

Func Terminate()
    Exit
EndFunc
Edited by Gif

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