Tartin Posted April 1, 2008 Posted April 1, 2008 (edited) Hey, This is what i am looking for: I am looking for a script that will run in the background and every time i hold down the "4" key it will repeatedly press the "4" key for me every 0.2 seconds or so, but only when i hold the "4" key down. When i release it stops. This is what i have so far: hotkeyset ("{insert}", "quitscript") while 1 send("4") sleep(200) wend Func quitscript() Exit EndFunc Its on the right track but it isnt linked to me holding down the "4" key, rather it just automatically repeatedly presses it with the script is turned on. I know i am new to autoIt but i greatly appreciate the help Thank you, Tartin Edited April 1, 2008 by Tartin
d4rk Posted April 1, 2008 Posted April 1, 2008 #include <Misc.au3> hotkeyset ("{insert}", "quitscript") while 1 if _IsPressed("34") then sleep(200) endif wend Func quitscript() Exit EndFunc [quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys
Tartin Posted April 2, 2008 Author Posted April 2, 2008 alright, that script is not working with the program i am using it with. Would their be a way to change it so when i press the "4" key to repeatedly presses the "4" key, then when i press the "4" key again it will stop the repeated pressing of the "4" key. Thank you, Tartin
d4rk Posted April 2, 2008 Posted April 2, 2008 are you menting about something like a "PAUSE" button ? HotKeySet("{delete}","pause") Func pause() $Paused = NOT $Paused While $Paused sleep(100) WEnd EndFunc if you need something like this, please tell me then i can give you a correct one with your script [quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys
Tartin Posted April 2, 2008 Author Posted April 2, 2008 (edited) d4rk said: are you menting about something like a "PAUSE" button ? HotKeySet("{delete}","pause") Func pause() $Paused = NOT $Paused While $Paused sleep(100) WEnd EndFunc if you need something like this, please tell me then i can give you a correct one with your script ya, having the pause and unpause set to the 4 key or any key really would be fine to repeadily press the "4" key should work perfect i believe (setting the 4 key as the pause and unpause would be the easiest) Thanks again Tartin Edited April 2, 2008 by Tartin
d4rk Posted April 2, 2008 Posted April 2, 2008 is this what you mean ? press "4" first time to pause the script, put it again to continue HotKeySet("4","pause") Func pause() $Paused = NOT $Paused While $Paused sleep(100) WEnd EndFunc [quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys
Tartin Posted April 2, 2008 Author Posted April 2, 2008 (edited) yes, that should work hopefully. Let me try it out. sorry i am so new to autoit, it looks like i am reading russian Thanks, Tartin Edited April 2, 2008 by Tartin
Tartin Posted April 2, 2008 Author Posted April 2, 2008 that last function that you posted D4rk doesnt work for some reason at all. I do not get an error, but it does not show up on my task bar Tartin
redsleeves Posted April 2, 2008 Posted April 2, 2008 (edited) #Include <misc.au3> While 1 GUIGetMsg() While _IsPressed(Hex(52)) BlockInput(1) Sleep(2000) Send("4") Sleep(2000) WEnd BlockInput(0) WEnd Try this. Edited April 2, 2008 by redsleeves
Tartin Posted April 2, 2008 Author Posted April 2, 2008 redsleeves said: #Include <misc.au3> While 1 GUIGetMsg() While _IsPressed(Hex(52)) BlockInput(1) Sleep(2000) Send("4") Sleep(2000) WEnd BlockInput(0) WEnd Try this. That works! awesome man, thank you so much Tartin
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