Macro F4 to F1

Ask gaming related questions (AHK v1.1 and older)
Gemos
Posts: 2
Joined: 18 Apr 2024, 17:48

Macro F4 to F1

18 Apr 2024, 18:57

Hello, sorry for the inconvenience. I need some basic information... I'm looking for a macro that does F1 to F4 like this one but in reverse F4 to F1.

Code: Select all

TAB::
    key++
    Send {F%key%}
    if key = 4
        key = 0
    return
I tried with key-- but it doesn't work, I'm lost.
Someone to help me I understand nothing? Sorry for my English..


[Mod edit: Fixed ending code tag (added slash) so the text at the end didn’t become part of the code box.

[Mod action: Moved topic from “Gaming Scripts (v1)” which is for sharing working scripts with others, not for asking for help.]
Rohwedder
Posts: 7700
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Macro F4 to F1

19 Apr 2024, 00:42

Hallo,
try:

Code: Select all

q::Send,% "{F" (++M:=Mod((!M M)+2, 4)) "}" ; F4 to F1 cyclic
w::Send,% "{F" (++P:=Mod(0 P, 4)) "}" ; F1 to F4 cyclic
To test this method:

Code: Select all

; Separate counters M, P (M=Minus, P=Plus)
F1::ToolTip,% "M = " ++M:=Mod((!M M)+2, 4) ; 4 to 1 cyclic
F2::ToolTip,% "P = " ++P:=Mod(0 P, 4) ; 1 - 4 cyclic
; Common counter N
F3::ToolTip,% "N = " ++N:=Mod((!N N)+2, 4) ; 4 to 1 cyclic
F4::ToolTip,% "N = " ++N:=Mod(0 N, 4) ; 1 - 4 cyclic
Gemos
Posts: 2
Joined: 18 Apr 2024, 17:48

Re: Macro F4 to F1

19 Apr 2024, 05:59

Incredible, it works. I could never have found this method! Thanks a lot, and thanks for understanding. :))

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 38 guests