implite Posted May 4, 2009 Posted May 4, 2009 Is there a way to move the mouse inside of 2 coordinates from top left to bottom right and end up inside this box randomly?ill show you im working on for example:expandcollapse popupHotKeySet("{HOME}", "GStart") HotKeySet("{PAUSE}", "Gpause") HotKeySet("{ESC}", "Gexit") while 1 sleep(100) WEnd Func Gstart() While 1 sleep(300) PixelSearch(476,189,513,196,0xE03131,25) If not @error Then MouseMove(499,260) EndIf if PixelGetColor(476,189) = 16777215 then Gmoveback() EndIf Wend Endfunc Func Gmoveback() While 1 MouseMove(506,239) sleep(300) $var = 1 if $var = 1 then Gstart() EndIf Wend Endfunc Func Gpause() While 1 sleep(100) Wend Endfunc Func Gexit() MsgBox(0, "exit box", "Script exited") Exit 0 EndFuncInstead of MouseMove(499,260), move mouse to anywheres inside {topleft (475,239), bottom right(569,249)} but, randomly... I would like to do this for MouseMove(506,239) too inside a area randomly...How do i do this?
Valuater Posted May 4, 2009 Posted May 4, 2009 *** Not Tested*** expandcollapse popupHotKeySet("{HOME}", "GStart") HotKeySet("{PAUSE}", "Gpause") HotKeySet("{ESC}", "Gexit") While 1 Sleep(100) WEnd Func Gstart() While 1 Sleep(300) PixelSearch(476, 189, 513, 196, 0xE03131, 25) If Not @error Then MouseMove(499, 260) EndIf If PixelGetColor(476, 189) = 16777215 Then Gmoveback() EndIf WEnd EndFunc ;==>Gstart Func Gmoveback() While 1 $x = Random(475, 569, 1) $y = Random(239, 249, 1) MouseMove($x, $y) Sleep(300) $var = 1 If $var = 1 Then Gstart() EndIf WEnd EndFunc ;==>Gmoveback Func Gpause() While 1 Sleep(100) WEnd EndFunc ;==>Gpause Func Gexit() MsgBox(0, "exit box", "Script exited") Exit 0 EndFunc ;==>Gexit 8)
implite Posted May 5, 2009 Author Posted May 5, 2009 *** Not Tested*** expandcollapse popupHotKeySet("{HOME}", "GStart") HotKeySet("{PAUSE}", "Gpause") HotKeySet("{ESC}", "Gexit") While 1 Sleep(100) WEnd Func Gstart() While 1 Sleep(300) PixelSearch(476, 189, 513, 196, 0xE03131, 25) If Not @error Then MouseMove(499, 260) EndIf If PixelGetColor(476, 189) = 16777215 Then Gmoveback() EndIf WEnd EndFunc ;==>Gstart Func Gmoveback() While 1 $x = Random(475, 569, 1) $y = Random(239, 249, 1) MouseMove($x, $y) Sleep(300) $var = 1 If $var = 1 Then Gstart() EndIf WEnd EndFunc ;==>Gmoveback Func Gpause() While 1 Sleep(100) WEnd EndFunc ;==>Gpause Func Gexit() MsgBox(0, "exit box", "Script exited") Exit 0 EndFunc ;==>Gexit 8) Thanks worked good. now looking how to make the mouse movements more natural with curves not straight lines from point a to point b.
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