lilandywandy Posted February 20, 2005 Share Posted February 20, 2005 pretending that is my desktop, how can i make my mouse click on a random white block and sleep for like 5 secs and click another random blob and sleep etc? Link to comment Share on other sites More sharing options...
Blue_Drache Posted February 21, 2005 Share Posted February 21, 2005 (edited) pretending that is my desktop, how can i make my mouse click on a random white block and sleep for like 5 secs and click another random blob and sleep etc?<{POST_SNAPBACK}>You have 12 regions.You'll have to make a function that defines a circular area in pixels on your screen.You can use the random function to select a specific region (label them 1-12)So, we have in psuedo codeDim $clickX[13] Dim $clickY[13] While 1 Sleep(5000) For $x = 1 to 12 Step 1 $ClickArea = CircularRegion($center1x, $center1y, $radius1, $center2x, $center2y, $radius2) $clickX[$x] = $clickarea[0] $clickY[$x] = $clickarea[1] Next $randnumber = Random(1,12,1) MouseClick($clickX[$randnumber],$clickY[$randnumber]) WEnd Func CircularRegion($center1x, $center1y, $radius1, $center2x="", $center2y="", $radius2="") Local $circle = 0 If $center2x="" and $center2y = "" and $radius2 = "" then $circle = 1 If $circle = 1 then ; figure out circular circumference of region. Area = pi*r^2 ; put formula here Else; we're dealing with an oval because $circle = 0 ; figure out area. Oval area (roughly) = W*L*0.8 ; put formula Endif ; Now return the results of the formula in array format, randomized for the allowed region. EndFuncKeep in mind, my loop isn't exactly perfect. As written, you'll have to define 12 separate calls for the CircularRegion function, but you can customize it further by wrapping it in a GUI and asking for user input and define everything (from the number of regions [therefore the array size and loop count])with variables. It'll drive ya nuts. Hopefully I've planted the seed, it's up to you to make it grow. Edited February 21, 2005 by Blue_Drache Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
lilandywandy Posted February 22, 2005 Author Share Posted February 22, 2005 hmmm well the shapes were something i randomly drew, i just want to illustrate 12 white spots on the screen, or 12 white pixels on the screen. (white being random color also), so how could i make it click on random white pixels? Link to comment Share on other sites More sharing options...
Blue_Drache Posted February 22, 2005 Share Posted February 22, 2005 hmmm well the shapes were something i randomly drew, i just want to illustrate 12 white spots on the screen, or 12 white pixels on the screen. (white being random color also), so how could i make it click on random white pixels?<{POST_SNAPBACK}>Wow, well, right now you've got too many variables for me to hold in my head. If you can post another idea as to the overall PURPOSE of this script is? Is it in the context of a game? If so, which one? We may be taking the wrong approach due to lack of information. I need a little more data before I can continue as I'm a little lost in the vagueness. Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
martin Posted February 22, 2005 Share Posted February 22, 2005 Wow, well, right now you've got too many variables for me to hold in my head. If you can post another idea as to the overall PURPOSE of this script is? Is it in the context of a game? If so, which one? We may be taking the wrong approach due to lack of information. I need a little more data before I can continue as I'm a little lost in the vagueness.<{POST_SNAPBACK}>Maybe rather than try to click on a randon white pixel, you should select a random pixel until the one you select is white and then wait 5 seconds. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
lilandywandy Posted February 22, 2005 Author Share Posted February 22, 2005 just make the mouse randomly click on one of those bull things Link to comment Share on other sites More sharing options...
Encryption Posted February 22, 2005 Share Posted February 22, 2005 just make the mouse randomly click on one of those bull things<{POST_SNAPBACK}>Hate to be offtopic, but what game is that. Link to comment Share on other sites More sharing options...
Insolence Posted February 22, 2005 Share Posted February 22, 2005 It'd be very hard. You have to find a certain pixel, make certain scan areas, fairly difficult. "I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar. Link to comment Share on other sites More sharing options...
lilandywandy Posted February 24, 2005 Author Share Posted February 24, 2005 =( 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