Sami1985 Posted February 16, 2017 Share Posted February 16, 2017 Hi, I have this bash script command that would like to convert it into autoit. i="0" while [ $i -lt 16 ]; do xdotool mousemove 848 845 click 1; sleep 70; i=$[$i+1]; done Thank you! Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted February 16, 2017 Moderators Share Posted February 16, 2017 @Sami1985 I don't do a lot of bash, but it should not be difficult. Mousemove, however, is patently unreliable in AutoIt. What, exactly are you trying to automate? Typically there is a much better way to do it. Sami1985 1 "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...
Sami1985 Posted February 16, 2017 Author Share Posted February 16, 2017 15 minutes ago, JLogan3o13 said: @Sami1985 I don't do a lot of bash, but it should not be difficult. Mousemove, however, is patently unreliable in AutoIt. What, exactly are you trying to automate? Typically there is a much better way to do it. Thank you so much for the quick help. I am so sorry for not explaining what I am trying to do. The "xdotool mousemove xxx yyy click 1" command is just asking the script to do a left mouse click at the specified coordinates. Link to comment Share on other sites More sharing options...
iamtheky Posted February 16, 2017 Share Posted February 16, 2017 (edited) click on (848,845) every 70 seconds forever? did you look in the helpfile for mouse functions at all? Because the answer is to literally copy the script out of the helpfile. Edited February 16, 2017 by iamtheky ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
Sami1985 Posted February 16, 2017 Author Share Posted February 16, 2017 I am trying to automate playing a playlist by waiting a minute before advancing it. Link to comment Share on other sites More sharing options...
iamtheky Posted February 16, 2017 Share Posted February 16, 2017 (edited) is this playlist by chance an .mu3 file (nvm, we started with bash so probably not), are we clicking on youtube? Edited February 16, 2017 by iamtheky ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
Sami1985 Posted February 16, 2017 Author Share Posted February 16, 2017 1 minute ago, iamtheky said: click on (848,845) every 70 seconds forever? did you look in the helpfile for mouse functions at all? Because the answer is to literally copy the script out of the helpfile. I googled autoit while loop but did not read the helpfile. I will locate it and start reading. Thanks Link to comment Share on other sites More sharing options...
Sami1985 Posted February 16, 2017 Author Share Posted February 16, 2017 2 minutes ago, iamtheky said: is this playlist by chance an .mu3 file, or are we clicking on a website? website; there is a continuity to the script, so it is not a forever playback. Link to comment Share on other sites More sharing options...
iamtheky Posted February 16, 2017 Share Posted February 16, 2017 excellent, then aiming a left click should be a fun first script, and any kind of loop will do - ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
Sami1985 Posted February 16, 2017 Author Share Posted February 16, 2017 10 minutes ago, iamtheky said: excellent, then aiming a left click should be a fun first script, and any kind of loop will do - I did not say the left click was my main issue. It is just every software has its structure how to write the while loop. So if you dont or cant contribute anything apart from sarcasm, then leave it for somebody else who could or want to help. Link to comment Share on other sites More sharing options...
iamtheky Posted February 16, 2017 Share Posted February 16, 2017 I can help, but so far there is no code to help with. so you went to the while function, copied that stuff; and then you went to mouseclick and put that stuff inside of the while stuff. Or are you just mad because you are not being handed code? ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
Sami1985 Posted February 16, 2017 Author Share Posted February 16, 2017 1 minute ago, iamtheky said: I can help, but so far there is no code to help with. so you went to the while function, copied that stuff; and then you went to mouseclick and put that stuff inside of the while stuff. Or are you just mad because you are not being handed code? I am not mad but I am not expecting anything positive from you. Just please leave this thread and dont spam it anymore. Link to comment Share on other sites More sharing options...
Subz Posted February 16, 2017 Share Posted February 16, 2017 Sami1985 - What you're after is "Do...Until" the example in help is almost identical to the bash script, just need to add the Mouse Click and a Sleep function. Sami1985 1 Link to comment Share on other sites More sharing options...
Sami1985 Posted February 16, 2017 Author Share Posted February 16, 2017 Just now, Subz said: Sami1985 - What you're after is "Do...Until" the example in help is almost identical to the bash script, just need to add the Mouse Click and a Sleep function. Thank you so much Sir. Have a great day. Link to comment Share on other sites More sharing options...
iamtheky Posted February 16, 2017 Share Posted February 16, 2017 (edited) Subz, I think he thinks all text is spam, watchout I literally said look at the mouse functions (and then even said mouseclick in #11), and put do in italics like the worst dad joke ever. Is there a language barrier I missed? Edited February 16, 2017 by iamtheky ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
Annatsu Posted February 16, 2017 Share Posted February 16, 2017 (edited) #include <AutoItConstants.au3> While 1 MouseClick($MOUSE_CLICK_MAIN, XXX, YYY, 1) ; Click with the main button, Coordinates: XXX, YYY. 1 click Sleep(70*1000) ; Wait for 70 seconds WEnd This will loop forever. To loop 16 times, as stated in the bash code, use: #include <AutoItConstants.au3> For 0 To 16 MouseClick($MOUSE_CLICK_MAIN, XXX, YYY, 1) ; Click with the main button, Coordinates: XXX, YYY. 1 click Sleep(70*1000) ; Wait for 70 seconds Next Edited February 16, 2017 by Annatsu Sami1985 1 Link to comment Share on other sites More sharing options...
Sami1985 Posted February 16, 2017 Author Share Posted February 16, 2017 7 minutes ago, Annatsu said: #include <AutoItConstants.au3> While 1 MouseClick($MOUSE_CLICK_MAIN, XXX, YYY, 1) ; Click with the main button, Coordinates: XXX, YYY. 1 click Sleep(70*1000) ; Wait for 70 seconds WEnd This will loop forever. To loop 16 times, as stated in the bash code, use: #include <AutoItConstants.au3> For 0 To 16 MouseClick($MOUSE_CLICK_MAIN, XXX, YYY, 1) ; Click with the main button, Coordinates: XXX, YYY. 1 click Sleep(70*1000) ; Wait for 70 seconds Next Thank you very much man. 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