Sami1985

Trying to convert this bash into autoit

17 posts in this topic

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!

Share this post


Link to post
Share on other sites



@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.

1 person likes this

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

#4 ·  Posted (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 by iamtheky

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites

I am trying to automate playing a playlist by waiting a minute before advancing it.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

is this playlist by chance an .mu3 file (nvm, we started with bash so probably not),  are we clicking on youtube?

Edited by iamtheky

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

excellent, then aiming a left click should be a fun first script, and any kind of loop will do - :sweating:


,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites

#10 ·  Posted

10 minutes ago, iamtheky said:

excellent, then aiming a left click should be a fun first script, and any kind of loop will do - :sweating:

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.

Share this post


Link to post
Share on other sites

#11 ·  Posted

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?


,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites

#12 ·  Posted

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. 

Share this post


Link to post
Share on other sites

#13 ·  Posted

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.

1 person likes this

Share this post


Link to post
Share on other sites

#14 ·  Posted

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.

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

Subz, I think he thinks all text is spam, watchout B)

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 by iamtheky

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites

#16 ·  Posted (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 by Annatsu
1 person likes this

Share this post


Link to post
Share on other sites

#17 ·  Posted

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.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now