Auto type a sentence after a code word is typed?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
YaBoyBlu
Posts: 6
Joined: 23 Apr 2018, 14:39

Auto type a sentence after a code word is typed?

23 Apr 2018, 14:46

I'm interested in making a script that types a certain word, phrase, or sentence after a series of letters (or a phrase) is typed.

Example:

I type the word "raihc"

It's replaced with the word "chair"

or

I type "fhebfwagew"

and it's replaced with "Donkey"


I think you get the point. Would anyone mind helping me with a code that would do this? Thanks in advance!
YaBoyBlu
Posts: 6
Joined: 23 Apr 2018, 14:39

Re: Auto type a sentence after a code word is typed?

23 Apr 2018, 14:55

Exaskryz wrote:hotstrings?
Yes, however whenever I try to create hotstring myself - it doesn't seem to work.

I want to type a phrase in chat and have it replaced by another phrase.

So I'd type: "agqgaha"
and have it change to "Aurora" or something of the sort.

Would you be able to show me how this type of code is written?
YaBoyBlu
Posts: 6
Joined: 23 Apr 2018, 14:39

Re: Auto type a sentence after a code word is typed?

23 Apr 2018, 15:01

@Exaskryz

Thanks so much, that's exactly what I'm looking for.

One more question now, the script works within text documents and webpages - but isn't seeming to work within applications such as games.

Is there anyway I can fix this?
User avatar
JoeWinograd
Posts: 2198
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: Auto type a sentence after a code word is typed?

23 Apr 2018, 15:07

You're looking for an AutoHotkey feature called hotstrings. The Help page on it is excellent. Also, I recommend tidbit's superb tutorial in its entirety, but in particular, look at the Hotkeys & Hotstrings section. Also, here's a recent thread that has a good discussion about it with some examples:

https://autohotkey.com/boards/viewtopic.php?f=5&t=46503

Regards, Joe
YaBoyBlu
Posts: 6
Joined: 23 Apr 2018, 14:39

Re: Auto type a sentence after a code word is typed?

23 Apr 2018, 15:20

This is what I have so far:

::ates::
Send /uns seat
return

Why is it not working within an application, it only works on webpages and text documents.

I want to type out "ates" and have "/uns seat" replace it.
Can someone help?
User avatar
Exaskryz
Posts: 2882
Joined: 17 Oct 2015, 20:28

Re: Auto type a sentence after a code word is typed?

23 Apr 2018, 15:55

It should work to do just ::ates::/uns seat, but you may want to use :*:ates:: so that you don't need a space or period afterward, your preference.

Why it won't work in a game is probably because your game is running with administrator privileges. Grant AHK admin privileges too. Also see https://autohotkey.com/boards/viewtopic.php?t=11084 for more troubleshooting tips.
User avatar
JoeWinograd
Posts: 2198
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: Auto type a sentence after a code word is typed?

23 Apr 2018, 16:02

Hotstrings work in every app that I've ever used them in, but I don't play any games...you said, "applications such as games" earlier. You may want to look at the SendPlay doc, although I've personally never used it.

Keep in mind that you need to type an "ending character" in order for the hotstring to expand, unless you put an asterisk between the first two colons, as documented in the Help and at this post. Regards, Joe
YaBoyBlu
Posts: 6
Joined: 23 Apr 2018, 14:39

Re: Auto type a sentence after a code word is typed?

23 Apr 2018, 16:16

Well, I have to press T to open the chat interface inorder to type things.
When the chatbox is open, the hotstrings don't seem to work - but when the chatbox isn't open, the hotstring does work.
User avatar
JoeWinograd
Posts: 2198
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: Auto type a sentence after a code word is typed?

23 Apr 2018, 17:32

Sorry...don't know.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], ishida20, jameswrightesq, Lem2001 and 403 guests