Hello, i want to create a script where you press down a specific button, and then a message is sent, and then you press down on the same button, and the next message in the list is sent.
eg. press [shift + q] and then the first message from a list is sent, like "hello there!"
and then press [shift + q] again, and then the second message from the list is sent, like 'how are you?"
Any help would be much appreciated. thank you!
I need help to make a simple script
Re: I need help to make a simple script
Welcome to this AutoHotkey forum!
Code: Select all
#Requires AutoHotkey v2.0
msg := ['Hello, there!', 'How are you?']
+q:: {
Static n := msg.Length
SendText msg[n := n++ - msg.Length ? n : 1]
}
-
- Posts: 2
- Joined: 01 Apr 2023, 04:37
Re: I need help to make a simple script
Hi, what if i wanted to press enter after each message eg. hello, there [press enter]
Re: I need help to make a simple script
Code: Select all
#Requires AutoHotkey v2.0
msg := ['Hello, there!', 'How are you?']
+q:: {
Static n := msg.Length
SendText msg[n := n++ - msg.Length ? n : 1] '`n'
}