h3nno Posted August 5, 2007 Share Posted August 5, 2007 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 Link to comment Share on other sites More sharing options...
Gif Posted August 5, 2007 Share Posted August 5, 2007 (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 belowIf 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 August 5, 2007 by Gif Link to comment Share on other sites More sharing options...
h3nno Posted August 6, 2007 Author Share Posted August 6, 2007 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. Link to comment Share on other sites More sharing options...
Gif Posted August 7, 2007 Share Posted August 7, 2007 (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 August 7, 2007 by Gif Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now