cbriggs77 Posted February 17, 2015 Share Posted February 17, 2015 (edited) Ok so i have this code right, and i wrote this code after just learning autoit through like youtube and such. it's for like stuff and definitely not against TOS. expandcollapse popupMouseMove(730, 1093) MouseClick("left") Sleep($interval) MouseMove(531, 447) MouseClick("left") Sleep($interval) Send("a") MouseMove(845, 514) MouseClick("left") ;1 Sleep($interval2) MouseClick("left") ;2 Sleep($interval2) MouseClick("left") ;3 Sleep($interval2) MouseClick("left") ;4 Sleep($interval2) MouseClick("left") ;5 Sleep($interval2) MouseClick("left") ;6 Sleep($interval2) MouseMove(1225, 752) MouseClick("left") ;1 Sleep($interval3) MouseMove(1035, 604) MouseClick("left") ;2 Sleep($interval2) MouseClick("left") ;3 Sleep($interval2) MouseClick("left") ;4 Sleep($interval2) MouseClick("left") ;5 Sleep($interval2) MouseClick("left") ;6 Sleep($interval2) MouseMove(744, 959) ;1 MouseClick("left") Sleep($interval2) MouseMove(922, 596) ;2 MouseClick("left") Sleep($interval2) ;3 MouseClick("left") Sleep($interval2) ;4 MouseClick("left") Sleep($interval2) ;5 MouseClick("left") Sleep($interval2) ;6 MouseMove(1462, 725) MouseClick("left") Sleep($interval2) ;1 MouseMove(1071, 531) MouseClick("left") Sleep($interval2) ;2 MouseClick("left") Sleep($interval2) ;3 MouseClick("left") Sleep($interval2) ;4 MouseClick("left") Sleep($interval2) ;5 MouseClick("left") Sleep($interval2) ;6 MouseMove(1681, 427) MouseClick("left") Sleep($interval5) Send("a") Sleep($interval5) Essentially i'm wondering if there is anyway to run a mouseclick at a duplicative of itself. like 20 times without writing it 20 times. Also as my first coding syntax i've tackled in quite a long time i'd like to say I love autoit's simplicity. Edited February 17, 2015 by cbriggs77 Link to comment Share on other sites More sharing options...
JohnOne Posted February 17, 2015 Share Posted February 17, 2015 What do you mean, like? Is it for a like, like, or just like for clicking, like? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted February 17, 2015 Moderators Share Posted February 17, 2015 cbriggs77, can you give us an idea of what you're trying to automate? I guarantee you there is a better way to do it than all those MouseClicks, whatever it is. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
iamtheky Posted February 17, 2015 Share Posted February 17, 2015 you can always build your own function with the parameters you wish to vary. _MouseClick("left" , 531, 447 , 2000 , 5) Func _MouseClick($button , $xCoord , $yCoord , $sleep , $repeat) For $i = 1 to $repeat tooltip ("Clicking the " & $button & " button " & $i & " of " & $repeat & " times at " & $xCoord & "," & $yCoord & " with a sleep of " & $sleep & "ms inbetween each click" , 0 , 0) MouseClick($button , $xCoord, $yCoord) Sleep($sleep) Next EndFunc ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
BigDod Posted February 17, 2015 Share Posted February 17, 2015 cbriggs77, can you give us an idea of what you're trying to automate? I guarantee you there is a better way to do it than all those MouseClicks, whatever it is. It is probably to do with the topic that got closed earlier. I can't compare the code as it was removed when the topic was locked. Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
cbriggs77 Posted February 18, 2015 Author Share Posted February 18, 2015 you can always build your own function with the parameters you wish to vary. _MouseClick("left" , 531, 447 , 2000 , 5) Func _MouseClick($button , $xCoord , $yCoord , $sleep , $repeat) For $i = 1 to $repeat tooltip ("Clicking the " & $button & " button " & $i & " of " & $repeat & " times at " & $xCoord & "," & $yCoord & " with a sleep of " & $sleep & "ms inbetween each click" , 0 , 0) MouseClick($button , $xCoord, $yCoord) Sleep($sleep) Next EndFunc I was essentially looking for help on how to repeat certain parameters, like boththose showed. That is tremendously helpful. so if i were to input this into my code file, i'd have to speify what variables $repeat are and variable $sleep earlier in the script ? Link to comment Share on other sites More sharing options...
SorryButImaNewbie Posted February 18, 2015 Share Posted February 18, 2015 I think you only need to specify it when you call the function (but not sure, I didn't use my own function for a time now) Also MouseClick("left") = MouseClick("") Since the default is left click. Link to comment Share on other sites More sharing options...
cbriggs77 Posted February 18, 2015 Author Share Posted February 18, 2015 I think you only need to specify it when you call the function (but not sure, I didn't use my own function for a time now) Also MouseClick("left") = MouseClick("") Since the default is left click. OH that is useful as well! cuts down on writing left so many times, xD You guys are really helpful! thanks so much! Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted February 18, 2015 Moderators Share Posted February 18, 2015 Still curious why you are forced to use mouseclicks. The script will never be stable if that is all you're basing it on. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted February 22, 2015 Moderators Share Posted February 22, 2015 cbriggs, based on the PM you sent me (below) along with your other posts, you know by now this is against the forum rules. Hey i was just wondering what you were talking about when you said. " Still curious why you are forced to use mouseclicks. The script will never be stable if that is all you're basing it on." Essentially I am moving a character around, the game uses the unity engine, and I move my character around from the starting position, and he runs to mineral veins, mines them, runs back and banks the minerals, goes to starting position and returns to minerals, rinse, repeat. i can send you the whole code if you want. it's for a game called, "Albion Online" I'm still trying to learn how i would do an image search so i can auto attack monsters in the area, but only monsters and than return to mining. : I'm very new at autoit, but I am enjoying the coding portion VERY much. If you have anywhere you think I could read u p that would help me, it would be greatly appreciated. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 22, 2015 Moderators Share Posted February 22, 2015 cbriggs77,You have >already been pointed to the Forum rules so there is no excuse for starting a second thread. Please do NOT start a third - our patience has limits. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts