uber125 Posted October 28, 2007 Share Posted October 28, 2007 (edited) I'm looking to make a script that will read the keys I'm pushing and for every 1 key I press, it will duplicate it 5 times or more extremely fast. Is it possible with autoit? Edited October 28, 2007 by uber125 Link to comment Share on other sites More sharing options...
ChrisL Posted October 28, 2007 Share Posted October 28, 2007 This is one way Opt("SendKeyDelay",1) HotKeySet("{esc}","_Quit") Global $timestoSendKey = 5 HotkeySet("a","_SendXTimes") HotkeySet("b","_SendXTimes") HotkeySet("c","_SendXTimes") While 1 Sleep (10) WEnd Func _SendXTimes() HotkeySet (@HotKeyPressed) For $i = 1 to $timestoSendKey Send(@HotKeyPressed) Next HotkeySet (@HotKeyPressed,"_SendXTimes") EndFunc Func _Quit() Exit EndFunc [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
uber125 Posted October 28, 2007 Author Share Posted October 28, 2007 This is one way Opt("SendKeyDelay",1) HotKeySet("{esc}","_Quit") Global $timestoSendKey = 5 HotkeySet("a","_SendXTimes") HotkeySet("b","_SendXTimes") HotkeySet("c","_SendXTimes") While 1 Sleep (10) WEnd Func _SendXTimes() HotkeySet (@HotKeyPressed) For $i = 1 to $timestoSendKey Send(@HotKeyPressed) Next HotkeySet (@HotKeyPressed,"_SendXTimes") EndFunc Func _Quit() Exit EndFunc Thank you vary much. I'll let you know how it works tomorrow after I implement it. Link to comment Share on other sites More sharing options...
uber125 Posted October 28, 2007 Author Share Posted October 28, 2007 (edited) Works like a charm! Thanks a million! Edited October 28, 2007 by uber125 Link to comment Share on other sites More sharing options...
uber125 Posted October 28, 2007 Author Share Posted October 28, 2007 (edited) Ok, after fooling around with this. I have come to the conclusion that you can NOT "Pause" a Func/EndFunc only While 1/WEND.So My question is. Is it possible to set a Hotkey to read a portion of the script and ignore another until that Hotkey is hit again?Example;Opt("SendKeyDelay",1)HotKeySet("{esc}","_Quit")HotKeySet("{esc}","_One")Global $timestoSendKey = 10Global $timestoSendKey2 = 1HotkeySet("3","_SendXTimes")HotkeySet("3","_SendXTimes2")While 1 Sleep (10)WEndFunc _SendXTimes() HotkeySet (@HotKeyPressed) For $i = 1 to $timestoSendKey Send(@HotKeyPressed) Next HotkeySet (@HotKeyPressed,"_SendXTimes")EndFuncFunc _SendXTimes(2) HotkeySet (@HotKeyPressed) For $i = 1 to $timestoSendKey2 Send(@HotKeyPressed) Next HotkeySet (@HotKeyPressed,"_SendXTimes")Func _One() ExitEndFuncFunc _Quit() ExitEndFuncI know the above will not work, it's just to help to grasp the concept of what i am trying to accomplish. Edited October 29, 2007 by uber125 Link to comment Share on other sites More sharing options...
uber125 Posted October 29, 2007 Author Share Posted October 29, 2007 Please can anyone out there help me? Link to comment Share on other sites More sharing options...
MacBain00 Posted October 29, 2007 Share Posted October 29, 2007 Please can anyone out there help me? I'm not 100% sure, but you may be able to create a variable that resets itself. So you would have an If Then EndIf statement saying if variable = 1, then do this one, if it equal 2 do this and reset back to 1. -Work Smarter, Not Harder, Use More AutoIT Link to comment Share on other sites More sharing options...
ChrisL Posted October 29, 2007 Share Posted October 29, 2007 (edited) I don't understand what you mean can you try and explain it a bit better Edit: Do you mean you want to queue up the hotkeys and not activate the second hotkey until the first has finished? Edited October 29, 2007 by ChrisL [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire 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