ab21 Posted April 5, 2005 Share Posted April 5, 2005 (edited) Hi all, i'm new to autoit and i want to write a script that will send in keystrokes automatically for infinite times untill the user hits "esc". I know how to set a hotkey and exit the program but how to actually set a hotkey and "pause" the script and use the same hot key to "re-enable" the script? another little problem is, i read about how to send in a keystroke for a specific amount of times, but how can i make the script to enter the keystroke for infinite times for 5 times per second? will it work if i put send() & sleep(200) inside a loop? Edited April 5, 2005 by ab21 Link to comment Share on other sites More sharing options...
zcoacoaz Posted April 5, 2005 Share Posted April 5, 2005 RTM, my friend, RTM (Read The Manual) and yes you can have more than one command in a loop [font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font] Link to comment Share on other sites More sharing options...
ab21 Posted April 5, 2005 Author Share Posted April 5, 2005 srry i just started reading about autoit about an hour ago, i haven't d/l'd the program yet, about the send() & sleep(200) part, i just wanted to know if that'll allow the script to send a keystroke for infinite times with 200 milisec wait. Link to comment Share on other sites More sharing options...
ShelbySue Posted April 5, 2005 Share Posted April 5, 2005 HotKeySet will allow you to capture a key press. read the Doc on that. Link to comment Share on other sites More sharing options...
herewasplato Posted April 6, 2005 Share Posted April 6, 2005 srry i just started reading about autoit about an hour ago, i haven't d/l'd the program yet, about the send() & sleep(200) part, i just wanted to know if that'll allow the script to send a keystroke for infinite times with 200 milisec wait.<{POST_SNAPBACK}>yes. a script can do what you have asked about...while 1 send("A") sleep(200) wendyou might want to add a line or two to bring the window of interest into focus just before sending stuff to it... see winactivate and winwaitactiveas for the pause/resume script code - steal that from the manual which is also online - see the bottom of this page:http://www.autoitscript.com/autoit3/docs/f...s/HotKeySet.htmhope this helps [size="1"][font="Arial"].[u].[/u][/font][/size] 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