I'm trying to create a script that will wait for a key to be pressed(i), and when that key is pressed, I want to temporarily have the option to press numbers 1-8 to send a string such as the ones seen below (eg. Desert, Forest, Tundra),
and once that string is sent, I now want to be able to press 1-8 to send the actual integer as a string and press return.
All while maintaining the function of the 1-8 keys, so these would essentially only be active while using the pressed(i) in that particular instance.
An example visual aid from a video game voice line navigation menu, except mine would be purely through logic and no gui
I was hoping to do this via shortcut assignment within a function, but that doesn't seem to be an option with AHK, would appreciate the help!
Code: Select all
i::
;This is garbage
Sleep, 200
SendInput, {= down}
Sleep, 250
SendInput {= up}
Sleep, 250
MouseClick, right
Sleep, 200
Send /
Sleep, 100
; Send Desert
; Send {Space down}
Loop {
While !variable
Sleep 50
variable:=0 ;
if variable:= 1
*$1::
Send Desert
variable:=1
~$2::Send Forest
~$3::Send Tundra