AlfzZz Posted September 22, 2006 Share Posted September 22, 2006 Hi can anyone show me a script that sends the keystroke of "a" every 2 seconds? I tried doing this but it would just type the "a" key really fast. I think i set the delay wrong. Link to comment Share on other sites More sharing options...
ame1011 Posted September 22, 2006 Share Posted September 22, 2006 Hi can anyone show me a script that sends the keystroke of "a" every 2 seconds? I tried doing this but it would just type the "a" key really fast. I think i set the delay wrong.post what you have and we can help you from there...keep in mind that the sleep function accepts milliseconds, not seconds [font="Impact"] I always thought dogs laid eggs, and I learned something today. [/font] Link to comment Share on other sites More sharing options...
Vivvic Posted September 22, 2006 Share Posted September 22, 2006 Im asuming you have "Sleep(2)" in your script, try "Sleep(2000)" instead [quote name='DaleHohm']You have a strange habit of posting error messages that don't match your code.[/quote][quote name='SmOke_N']Forget the learning... straight to the scripting :lol: (laugh.gif)[/quote] Link to comment Share on other sites More sharing options...
AlfzZz Posted September 22, 2006 Author Share Posted September 22, 2006 (edited) i have no clue what im doing, it took me a while to get this set up, i dont know if this is the right way Global $Paused HotKeySet("{INSERT}", "TogglePause") HotKeySet("{END}", "Terminate") While 1 Sleep(110) WEnd Func TogglePause() $Paused = NOT $Paused While $Paused Opt("SendKeyDelay", 10000000) ;5 milliseconds Opt("SendKeyDownDelay", 10000) ;1 millisecond Send("{a down}") WEnd EndFunc Func Terminate() Exit 0 EndFuncexpandcollapse popup you can probably code somthing like this in a more simple way... ok so i fixed it by adding sleep(800) on a new line after send("{a down}") will there be an easier way to write this script? like a shorter way Edited September 22, 2006 by AlfzZz Link to comment Share on other sites More sharing options... Moderators SmOke_N Posted September 22, 2006 SmOke_N Moderators 16.3k 49 It's not what you know ... It's what you can prove! Moderators Share Posted September 22, 2006 Looks like you need a basic understanding of the options for time.$millisecond = 1 $second = 1000 $minute = 60000 $hour = 3600000See a pattern there?Also, I'd suggest trying this:http://www.autoitscript.com/forum/index.php?showtopic=21048Once you understand it, you'll be able to answer most questions yourself without the need for being told to RTFM. 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...
Skruge Posted September 22, 2006 Share Posted September 22, 2006 Opt("SendKeyDownDelay", 10000) ;1 millisecondYour delays are way off... [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font] Link to comment Share on other sites More sharing options...
Paulie Posted September 22, 2006 Share Posted September 22, 2006 Hey you, RTFM!!! Link to comment Share on other sites More sharing options...
AlfzZz Posted September 22, 2006 Author Share Posted September 22, 2006 what does RTFM mean? i understand the time, :\ the only problem was that i set the delays wrong and when i added sleep (number) it turned out to be way easier Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 22, 2006 Moderators Share Posted September 22, 2006 what does RTFM mean?i understand the time, :\the only problem was that i set the delays wrong and when i added sleep (number) it turned out to be way easierUsually I try to search for something if I don't know what it does or what it means. http://www.google.com/search?q=RTFM&st...:en-US:official 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...
AlfzZz Posted September 22, 2006 Author Share Posted September 22, 2006 Thanks :\ Link to comment Share on other sites More sharing options...
evilelf Posted September 22, 2006 Share Posted September 22, 2006 (edited) Edited: Edited August 19, 2008 by evilelf 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