sgmailer Posted October 29, 2005 Share Posted October 29, 2005 Hi, I'm trying to write a simple program to perform one mouse click and then infinitely press a single key at regular intervals. Can anybody help me out? Thanks and if anyone can point to any tutorials, that would also be appreciated. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 29, 2005 Moderators Share Posted October 29, 2005 you look at While / Wend - MouseClick() - and _IsPressed or Send() for the single key Note: _IsPressed is a Beta UDF... The others you'll be able to find in the ever precious Help File of AutoIt, probably the closest thing thus far to a tutorial with working examples on each function. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
sgmailer Posted October 29, 2005 Author Share Posted October 29, 2005 Hmm...I was wondering, if I use an infinite loop, how will I get out of the loop after I run the script? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 29, 2005 Moderators Share Posted October 29, 2005 (edited) With a While you'll use ExitLoop or HotKey... Do / Until a certain criteria you set becomes true - For / Next... the number of times you wanted to go through the command. Edit: If you look at HotKeySet in the help file, something like Pause or Terminate, you could use for any part of your script or any loop. Most of us use them at some point in our scripts, and some of us always. Edited October 29, 2005 by ronsrules Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Nuffilein805 Posted October 29, 2005 Share Posted October 29, 2005 do a hotkey! hotkeyset("!+^8", "letmego");ctrl+alt+shift+8 func letmego() exit endfunc thats your way out of your infinite-loop my little chatmy little encryption toolmy little hidermy unsafe clickbot Link to comment Share on other sites More sharing options...
sgmailer Posted October 29, 2005 Author Share Posted October 29, 2005 (edited) Ah, I didn't even do a hotkey since I'm not familiar with that, I just resorted to click on the taskbar icon to end the loop. :-P Anyway, since I already know JAVA and in that language, they also have for, do-while, and while loops. I figure I would just do a infinite loop with a do loop. My first program! MouseClick("left", 600, 500, 1) $count = 1 Do Send("s") ;Sleep(200) $count = $count + 1 Until $count < 0 Thanks for all the help! Edited October 29, 2005 by sgmailer Link to comment Share on other sites More sharing options...
Nuffilein805 Posted October 29, 2005 Share Posted October 29, 2005 whats your script supposed to do? 1 leftclick and at a delay of 0.2 secs send "s"? where do you need that? my little chatmy little encryption toolmy little hidermy unsafe clickbot Link to comment Share on other sites More sharing options...
LxP Posted October 30, 2005 Share Posted October 30, 2005 Welcome to the forums!Your script can also be written this way (anything not equal to 0 can be interpreted as a True Boolean, which you would be familiar with given your Java experience):MouseClick('', 600, 500) While 1 Send('s') ; Sleep(200) WEnd 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