Need a simple Macro for my Keyboard.. Topic is solved

Ask gaming related questions (AHK v1.1 and older)
theratedspear
Posts: 4
Joined: 12 Apr 2018, 10:23

Need a simple Macro for my Keyboard..

12 Apr 2018, 10:33

hey there everyone...

im in need of a Macro that i can do something like this with it: when i press a key on keyboard, it automatically presses/send 2 or 3 other keys, like:

I press T, and it automatically Presses TTY, for example...


and as u can see im pretty new/noob here... so i need a bit help here.
idk if this is hard to do or not, but any help is appreciated.


Thanks.
Hman
Posts: 32
Joined: 10 Apr 2018, 10:48

Re: Need a simple Macro for my Keyboard..

12 Apr 2018, 11:40

hi im new too, i think you just need a hotstring, something simple like

::T::TTY

but dont quote me on it, i'm trying to learn this coding too, its an headache...but fun
User avatar
Nwb
Posts: 444
Joined: 29 Nov 2016, 08:56

Re: Need a simple Macro for my Keyboard..

12 Apr 2018, 12:27

Hman wrote:hi im new too, i think you just need a hotstring, something simple like

::T::TTY

but dont quote me on it, i'm trying to learn this coding too, its an headache...but fun
Ahh you are very close! :D

1) The difference between a hotstring is that it replaces the hotstring with the text. (so T gets "replaced" by TTY). [you can change using one of hotstring's options "B0"]
2) Hotstrings are case sensitive! So t won't trigger it, only T will. That is shift+t.

The only difference is that you cannot use modifiers properly in Hotstrings.

Hello theratedspear, you need to be more specific on what you want. Can you tell us exactly what you want?

::t:: TTY
will do the job but I presume you need something more?
I am your average ahk newbie. Just.. a tat more cute. ;)
theratedspear
Posts: 4
Joined: 12 Apr 2018, 10:23

Re: Need a simple Macro for my Keyboard..

13 Apr 2018, 02:26

Nwb wrote:
Hman wrote:hi im new too, i think you just need a hotstring, something simple like

::T::TTY

but dont quote me on it, i'm trying to learn this coding too, its an headache...but fun
Ahh you are very close! :D

1) The difference between a hotstring is that it replaces the hotstring with the text. (so T gets "replaced" by TTY). [you can change using one of hotstring's options "B0"]
2) Hotstrings are case sensitive! So t won't trigger it, only T will. That is shift+t.

The only difference is that you cannot use modifiers properly in Hotstrings.

Hello theratedspear, you need to be more specific on what you want. Can you tell us exactly what you want?

::t:: TTY
will do the job but I presume you need something more?




@Hman @Nwb
Hey there...

A. Thanks for try to help me out here guys
B. that "::t:: TTY" didnt work, or at least im doing it wrong, cuz thats a real possibility...
C. here's what im gonna do:
i need this for R6 Siege, for quick lean/peak

idk if u know, but to do quick lean for right side, u gotta go "left, left, right" QQE, and EEQ for going left side, very quickly...
i see people online using Logitech software to do this very easily, cuz software does it for their logitech keyboards... since i dont have a Logitech keyboard. i like to give this a try with my normal keyboard... but i cant figure this out, how to do it. (although i know using this on Online matches WILL get me banned, but i just wanna try out,and i cant use it too much, even if i want to)

so thats what i need this for, if u guys could help me out, that would be great.

and when u say "::t:: TTY" idk if i should just copy/paste it to xxx.AHK just like that or i need some other lines before it or after it... so if its not that hard, can u give me the WHOLE thing?

Thank u guys.
User avatar
Nwb
Posts: 444
Joined: 29 Nov 2016, 08:56

Re: Need a simple Macro for my Keyboard..

13 Apr 2018, 04:49

theratedspear wrote:...
See I thought this was text based. The ::t:: TTY did not work because you need an end character. So after t you need to press something like enter or space.

But I'm still not sure exactly what you want in terms of sequence. Do you want the T to be held down or just clicked once?
Try this:

Code: Select all

T:: Send, TTY
That is the full code believe it or not . Just paste that line in a .ahk file and run it! Cheers. :D

Also you might want to consider other additions to the script like: a hotkey to close the script, a hotkey to pause running thread, a hotkey to suspend hotkeys.
If you want additions then let me know!

Good luck! :D
I am your average ahk newbie. Just.. a tat more cute. ;)
theratedspear
Posts: 4
Joined: 12 Apr 2018, 10:23

Re: Need a simple Macro for my Keyboard..

14 Apr 2018, 11:41

Nwb wrote:
theratedspear wrote:...
See I thought this was text based. The ::t:: TTY did not work because you need an end character. So after t you need to press something like enter or space.

But I'm still not sure exactly what you want in terms of sequence. Do you want the T to be held down or just clicked once?
Try this:

Code: Select all

T:: Send, TTY
That is the full code believe it or not . Just paste that line in a .ahk file and run it! Cheers. :D

Also you might want to consider other additions to the script like: a hotkey to close the script, a hotkey to pause running thread, a hotkey to suspend hotkeys.
If you want additions then let me know!

Good luck! :D


hey, Thanks for the help... apparently this is the write code, but doesn't work in game unfortunately ...
anyway thanks for trying to help.
User avatar
Nwb
Posts: 444
Joined: 29 Nov 2016, 08:56

Re: Need a simple Macro for my Keyboard..

14 Apr 2018, 11:58

theratedspear wrote:
Nwb wrote:
theratedspear wrote:...
See I thought this was text based. The ::t:: TTY did not work because you need an end character. So after t you need to press something like enter or space.

But I'm still not sure exactly what you want in terms of sequence. Do you want the T to be held down or just clicked once?
Try this:

Code: Select all

T:: Send, TTY
That is the full code believe it or not . Just paste that line in a .ahk file and run it! Cheers. :D

Also you might want to consider other additions to the script like: a hotkey to close the script, a hotkey to pause running thread, a hotkey to suspend hotkeys.
If you want additions then let me know!

Good luck! :D


hey, Thanks for the help... apparently this is the write code, but doesn't work in game unfortunately ...
anyway thanks for trying to help.
Perhaps this would help: https://autohotkey.com/board/topic/1117 ... he-basics/. Cheers! :D
I am your average ahk newbie. Just.. a tat more cute. ;)
User avatar
evilC
Posts: 4823
Joined: 27 Feb 2014, 12:30

Re: Need a simple Macro for my Keyboard..

17 Apr 2018, 12:53

One-key hotstrings are asking for trouble - any time you typed a word ending with T and hit space, it would try and replace.

Before trying to run, have you tried to walk?
ie, have you tried sending single keystrokes to the game before trying to send key sequences?
ie does "it doesn't work" (THE most hated statement of support people everywhere, as it tells you nothing) mean "hotstrings are not able to send to the game", or do you mean "AHK cannot send to the game, period"? There's a big difference ;)

TL/DR: I suspect the latter is the case, and you need to use SetKeyDelay, 0, 50 at the start of the script, and/or run the script as admin
User avatar
evilC
Posts: 4823
Joined: 27 Feb 2014, 12:30

Re: Need a simple Macro for my Keyboard..  Topic is solved

17 Apr 2018, 12:59

Ah, looking at your previous request - hotstrings are not for doing that.

A question:
If, to lean right, you need to do QQE, then what *exactly* do you need to do?
I am guessing that when you hit E, you want the code to tap Q, tap Q, then HOLD E *until you release E*

Code: Select all

#SingleInstance force
SetKeyDelay, 0, 50

q_held := 0
e_held := 0
return

$*q::
	if (q_held)
		return	; Suppress Repeats
	q_held := 1
	Send {Blind}{e}{e}{q down}
	return

$*q up::
	q_held := 0
	return

$*e::
	if (e_held)
		return
	e_held := 1
	Send {Blind}{q}{q}{e down}
	return

$*e up::
	e_held := 0
	return
theratedspear
Posts: 4
Joined: 12 Apr 2018, 10:23

Re: Need a simple Macro for my Keyboard..

22 Apr 2018, 02:01

well, Thanks guys @evilC & @Nwb

it actually worked. thank u so much.

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 57 guests