flick Posted March 7, 2008 Share Posted March 7, 2008 While 1 If _IsPressed('41') Then Send ("{p}") EndIf wend this is my script, right now it sends p when a is pressed how can i change this so when i tap "a" "p" will be pressed until i hit "b"(as an example) Link to comment Share on other sites More sharing options...
d4rk Posted March 7, 2008 Share Posted March 7, 2008 (edited) i can't understand you, please re-explain in the clearly words Edited March 7, 2008 by d4rk [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 Link to comment Share on other sites More sharing options...
Kickassjoe Posted March 7, 2008 Share Posted March 7, 2008 (edited) Hotkeyset("a", "p") While 1 Sleep(60000) Wend Func p() Hotkeyset("a") Hotkeyset("b", "stop") While 1 Send("p") Wend EndFunc() Func stop() Hotkeyset("a", "p") Hotkeyset("b") While 1 Sleep(60000) Wend EndFunc That should do it, not tested though. Edited March 7, 2008 by Kickassjoe What goes around comes around... Payback's a bitch. Link to comment Share on other sites More sharing options...
flick Posted March 7, 2008 Author Share Posted March 7, 2008 (edited) Hotkeyset("a", "p") While 1 Sleep(60000) Wend Func p() Hotkeyset("a") Hotkeyset("b", "stop") While 1 Send("p") Wend EndFunc() Func stop() Hotkeyset("a", "p") Hotkeyset("b") While 1 Sleep(60000) Wend EndFunc That should do it, not tested though. that's working now, the only problem is it doesn't seem to hold p down, just rapidly tap it tabbed version of what i want: -"a" makes "p" be held down -"b" sends "b" and stops "p" from being held down Edited March 7, 2008 by flick Link to comment Share on other sites More sharing options...
PsaltyDS Posted March 7, 2008 Share Posted March 7, 2008 that's working now, the only problem is it doesn't seem to hold p down, just rapidly tap it tabbed version of what i want: -"a" makes "p" be held down -"b" sends "b" and stops "p" from being held down Perhaps more like this: HotKeySet("{ESC}", "_Quit") HotKeySet("a", "p") While 1 Sleep(20) WEnd Func p() HotKeySet("a") HotKeySet("b", "stop") Send("{p down}") EndFunc ;==>p Func stop() HotKeySet("b") Send("{p up}") Send("b") HotKeySet("a", "p") EndFunc ;==>stop Func _Quit() Exit EndFunc ;==>_Quit Have a nice weekend... Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
flick Posted March 8, 2008 Author Share Posted March 8, 2008 Perhaps more like this: HotKeySet("{ESC}", "_Quit") HotKeySet("a", "p") While 1 Sleep(20) WEnd Func p() HotKeySet("a") HotKeySet("b", "stop") Send("{p down}") EndFunc ;==>p Func stop() HotKeySet("b") Send("{p up}") Send("b") HotKeySet("a", "p") EndFunc ;==>stop Func _Quit() Exit EndFunc ;==>_Quit Have a nice weekend... the only problem is when i first hit "a" it sends "p" instead this happens when i first start it, or when i restart it after hitting b Link to comment Share on other sites More sharing options...
PsaltyDS Posted March 8, 2008 Share Posted March 8, 2008 the only problem is when i first hit "a" it sends "p" instead this happens when i first start it, or when i restart it after hitting b So use _IsPressed() in the While/WEnd loop instead of the HotKeySet() for "a": #include <misc.au3> HotKeySet("{ESC}", "_Quit") While 1 If _IsPressed("41") Then Send("{p down}") Sleep(250) ; button debounce EndIf If _IsPressed("42") Then Send("{p up}") Sleep(250) ; button debounce EndIf Sleep(20) WEnd Func _Quit() Exit EndFunc ;==>_Quit Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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