jeremyroberts Posted August 14, 2017 Share Posted August 14, 2017 so i have been trying to make an a program which: presses the space-bar every 22 miliseconds, i can do that But its really annoying when i change pages on crome, i have to stop the script then start it again. while true Send("{SPACE}") sleep(25) WEnd now i want to just set F1 so it starts to press space every 22miliseconds then when i press it again (it can be F2 to stop) it will pause the script, and if i press it again it will start again and so on.... I cant do that can someone help, please im a noob. Link to comment Share on other sites More sharing options...
david1337 Posted August 14, 2017 Share Posted August 14, 2017 Hi jeremyroberts With this you can use F1 to pause and unpause Global $Paused HotKeySet("{F1}", "TogglePause") While 1 Send("{SPACE}") sleep(25) WEnd While 1 Sleep(100) WEnd ;;;;;;;; Func TogglePause() $Paused = Not $Paused While $Paused Sleep(100) ToolTip('Script is "Paused"', 0, 0) WEnd ToolTip("") EndFunc jeremyroberts 1 Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted August 14, 2017 Moderators Share Posted August 14, 2017 @jeremyroberts what is the end goal with pressing the spacebar so often? Sending keys is always going to be a little unreliable; there is more than likely a much better way to accomplish what you are after. jeremyroberts 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...
jeremyroberts Posted August 14, 2017 Author Share Posted August 14, 2017 lol i just wanted to show my friends something, I found out about this lanuage the other day and its awesome Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted August 14, 2017 Moderators Share Posted August 14, 2017 It is awesome, I will agree with you there. But spamming a button pointlessly on the keyboard leads many to think you're either working at automating a game or trying to create a "joke" or "spoof" script - both of which are against our forum rules (I am sure you've take the time to read them, so it goes without saying that was not your intent). If you are interested in showing your friends something that showcases the power of AutoIt, I suggest you look through our Examples forum. There are many scripts here that, in just a few lines, can show you and your friends what the language is capable of. "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...
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