Assign a variable thru Hotstring? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
gandalfgarfield
Posts: 29
Joined: 20 Jun 2020, 22:27

Assign a variable thru Hotstring?

17 Aug 2020, 20:17

Hello, so I have encountered an encrypted AHK script that has a feature of letting me change a variable while it is running by just typing a certain keyword followed by the variable I wanted then press enter, It doesn't matter if it is being typed on a text box. I was thinking it could be Hotstring but because I'm a complete newbie, I can't understand how to do it. Can someone tell me how to do it? Thanks


Edit: Also i might just add, that it doesn't interrupt the natural event from typing the keyword.
For example,
When i use Hotstring

Code: Select all

::Hey::
Send Hey how are you?
return
It sends the output, disregarding the Hey.
While the script I encountered still enters the typed word and does the command. (I use the script for games so whenever I type the command and enter, the command goes into the chat box. So that's why I'm confused if it is Hotstring or not)
User avatar
boiler
Posts: 17404
Joined: 21 Dec 2014, 02:44

Re: Assign a variable thru Hotstring?

17 Aug 2020, 21:07

Hotstrings don’t have to erase the abbreviation that is typed. The option B0 is used for that purpose. See hotstring options. Example:

Code: Select all

:B0:Hey::Hey how are you?
gandalfgarfield
Posts: 29
Joined: 20 Jun 2020, 22:27

Re: Assign a variable thru Hotstring?

17 Aug 2020, 23:18

ohh i see... THanks
How do i make the text i type become a value for a certain variable?
For example,

Myvar = %var%
lets make btw the trigger, so when i type
btw123 then enter, it makes Myvar = 123
so whatever i type after btw becomes the value of Myvar..
User avatar
boiler
Posts: 17404
Joined: 21 Dec 2014, 02:44

Re: Assign a variable thru Hotstring?  Topic is solved

18 Aug 2020, 06:12

AutoHotkey doesn’t have that capability built in, but you can do that using RegEx Dynamic Hotstrings.
gandalfgarfield
Posts: 29
Joined: 20 Jun 2020, 22:27

Re: Assign a variable thru Hotstring?

18 Aug 2020, 19:42

boiler wrote:
18 Aug 2020, 06:12
AutoHotkey doesn’t have that capability built in, but you can do that using RegEx Dynamic Hotstrings.
Thank you very much!!!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: DecimalTurn, Google [Bot], macromint, peter_ahk and 351 guests