Repeating Macro Topic is solved
Repeating Macro
Hi! So I'm new to both the forums and to AutoHotKey, and I need a little bit of help running a script. I would like the said script to be able to repeatedly type one message until I press the activating key again. For example, While in a game, I would like it to be able to type Hi over and over again every 5 minutes or so. In addition, if it could be possible to make it run a constant MOUSE 1 BUTTON in the background, where it is constantly pressing the MOUSE 1 BUTTON, and repressing it every time the "Hi" macro is said. If I could get help with this I would really appreciate it, I don't know if this is even possible, but if it is, or something similar to it, I would really appreciate any help.
Re: Repeating Macro
It would also work if it were to just do the "Hi" Text Over and over, I would like that to be the "F" key
Re: Repeating Macro
Hello, I can't help you with the mouse click background, but the type part is pretty simple.
If you want to press F:
f: Send {Hi}
If you need to press enter for send the message:
f:: Send Hi {Enter}
If you want to repeat this, use loop:
t::
Loop, 2
{
Send Hi {Enter}
Sleep 300000
}
Put some value after loop (if 0 or just Loop means infinite, and I'm learning about break the infinite loop)
Note 300000 means 5 minutes.
You can remove {Enter} if you don't need to use it for typing in your game. Like this:
t::
Loop, 5 (for example)
{
Send Hi
Sleep 300000
}
Hope it helps you.
Source:
https://autohotkey.com/docs/commands/Loop.htm
https://autohotkey.com/docs/commands/Send.htm
If you want to press F:
f: Send {Hi}
If you need to press enter for send the message:
f:: Send Hi {Enter}
If you want to repeat this, use loop:
t::
Loop, 2
{
Send Hi {Enter}
Sleep 300000
}
Put some value after loop (if 0 or just Loop means infinite, and I'm learning about break the infinite loop)
Note 300000 means 5 minutes.
You can remove {Enter} if you don't need to use it for typing in your game. Like this:
t::
Loop, 5 (for example)
{
Send Hi
Sleep 300000
}
Hope it helps you.
Source:
https://autohotkey.com/docs/commands/Loop.htm
https://autohotkey.com/docs/commands/Send.htm
Re: Repeating Macro Topic is solved
Something like this should work (Untested)
Code: Select all
TimerOn := 0
MessageFreq := 1000 * 60 * 5
MessageText := "Hi"
return
$f::
TimerOn := !TimerOn
if (TimerOn){
Send {LButton Down}
SetTimer, TypeMessage, % MessageFreq
GoSub, TypeMessage
} else {
Send {LButton up}
SetTimer, TypeMessage, Off
}
return
TypeMessage:
Send {LButton up}
Send % MessageText
Send {LButton Down}
return
Who is online
Users browsing this forum: No registered users and 65 guests