Sign in to follow this  
Followers 0
uber125

multiple key strokes?

8 posts in this topic

#1 ·  Posted (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 by uber125

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

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.

<_<

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Works like a charm! Thanks a million!

Edited by uber125

Share this post


Link to post
Share on other sites

#5 ·  Posted (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 = 10

Global $timestoSendKey2 = 1

HotkeySet("3","_SendXTimes")

HotkeySet("3","_SendXTimes2")

While 1

Sleep (10)

WEnd

Func _SendXTimes()

HotkeySet (@HotKeyPressed)

For $i = 1 to $timestoSendKey

Send(@HotKeyPressed)

Next

HotkeySet (@HotKeyPressed,"_SendXTimes")

EndFunc

Func _SendXTimes(2)

HotkeySet (@HotKeyPressed)

For $i = 1 to $timestoSendKey2

Send(@HotKeyPressed)

Next

HotkeySet (@HotKeyPressed,"_SendXTimes")

Func _One()

Exit

EndFunc

Func _Quit()

Exit

EndFunc

I know the above will not work, it's just to help to grasp the concept of what i am trying to accomplish.

Edited by uber125

Share this post


Link to post
Share on other sites

Please can anyone out there help me? <_<

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#8 ·  Posted (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 by ChrisL

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0