Jump to content

Recommended Posts

Posted

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!

  • Moderators
Posted

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

"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!

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

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

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

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

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

Posted
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

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

Posted

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

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

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.

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?

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

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. 

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.

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

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

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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...