How to merge two scripts into one? Topic is solved

Ask gaming related questions (AHK v1.1 and older)
lolihax
Posts: 28
Joined: 30 Oct 2020, 16:18

How to merge two scripts into one?

Post by lolihax » 17 May 2022, 08:36

Code: Select all

 pause
Loop {
  Send {w}
  Sleep 25
  Send {d}
  Sleep 25
  Send {s}
  Sleep 25
  Send {a}
}
Numpad2::Pause


==================
pause
Loop {
  Send {a}
  Sleep 25
  Send {s}
  Sleep 25
  Send {d}
  Sleep 25
  Send {w}
}
Numpad1::Pause
I want to make one main script

User avatar
mikeyww
Posts: 26971
Joined: 09 Sep 2014, 18:38

Re: How to merge two scripts into one?

Post by mikeyww » 17 May 2022, 09:20

Adjust as needed.

Code: Select all

Pause
SetKeyDelay, 35
Loop
 Send asdwwdsa
Numpad1::
Numpad2::Pause

lolihax
Posts: 28
Joined: 30 Oct 2020, 16:18

Re: How to merge two scripts into one?

Post by lolihax » 17 May 2022, 09:23

no, you misunderstood, the game has a mini-game "press clockwise and against" I need one button clockwise and the other counterclockwise

User avatar
mikeyww
Posts: 26971
Joined: 09 Sep 2014, 18:38

Re: How to merge two scripts into one?

Post by mikeyww » 17 May 2022, 09:38

Code: Select all

Numpad1::
Numpad2::
key := SubStr(A_ThisHotkey, 0), direction := direction = key ? 0 : key
SetTimer, Go, % direction ? 35 : "Off"
Return
Go:
SetKeyDelay, 35
Loop, Parse, % ["wdsa", "asdw"][direction]
 Send % direction ? A_LoopField : ""
Return


User avatar
mikeyww
Posts: 26971
Joined: 09 Sep 2014, 18:38

Re: How to merge two scripts into one?  Topic is solved

Post by mikeyww » 17 May 2022, 10:53

Copy and paste the script. Use the latest version of AutoHotkey v1.x.

lolihax
Posts: 28
Joined: 30 Oct 2020, 16:18

Re: How to merge two scripts into one?

Post by lolihax » 17 May 2022, 11:32

Thanks a lot!

Post Reply

Return to “Gaming Help (v1)”