Releases: Snugggles/AHK-TAS-Tools
Release list
TASScript Tools v1.6
I've added some Commands to the TASScript functionality, some QoL and some helpful for actually running the TAS.
- WaitForGame(Frame,Game)
This is for when you want to run a Script from the launch of a Program. By default, it will pull the EmulatorAHK data to look for the game window, and by default it'll wait for the very first frame. You can enter a number into the Frame part of the Command, e.g. WaitForGame(200) so that it will wait for the Game Window to open, and then wait for that specific frame number to have passed before carrying on with the Script. This isn't the same as WaitFrames(200) which just waits for 200 frames to pass, it's waiting for exactly frame number 200 to happen before continuing.
You can also enter a custom Window Name to watch for, in case your game for some reason utilizes multiple windows. You'd format it the same as you would within the Memory Addresses.ini file and put that in the second spot of the command, e.g. WaitForGame(0, "ahk_exe pcsx2.exe" ) . Note that you have to enter a number for the Frame part of the command if you want to do this, even if it's for Frame 0.
Annoyingly, the first 15 or so frames can be missed by the TASScript, and I'm not currently sure why this is the case. Everything I can see shows that it is constantly running and scanning the address, it might be an Emulator issue, I just don't know.
- Skip(x)
This temporarily sets your WaitFrames setting to 0, then advances x frames, then reverts WaitFrames back to what your settings have it at. This allows you to more quickly go through sections of a game where nothing is changing in your inputs. This only really works for Emulators, but it's a nice QoL to skip through unskippable cutscenes or for moments where the fastest movement is just holding a single direction with no buttons.
- Input Shortcuts
I've also put in, within the Custom Commands file, a bunch of Commands that are the basic Input Commands like DLeft(), DRight(), Circle(), but shorthand instead, e.g. L(), R(), C(). I've tried to make them logical, and the majority of the buttons are just the first letter of the name of the button. The exceptions are Cross, Start, and Select, as there are two buttons that start with C, and three that start with S. In these cases, I've made Cross() be X(), Start() is ST(), and Select is SE(), Hold and Release Commands are done by adding H or R to the start of the Command, like HX() and RR(), to be HoldCross() and ReleaseDRight() respectively.
Future update plans for TASScript are to implement Mouse controls.
TASScript Tools v1.5
This is an update to the old TAS Tools, now known as TASScript. I've made a lot of fixes and improvements to the code, so that the Scripts themselves run a lot better behind-the-scenes. There's also a fair few new Features that I've implemented, which I'll explain here, starting with...
Keyboard TAS Controls
This was something that I had been meaning to implement a while ago, but never got around to doing it. Now, alongside being able to do Controller Inputs, you can send Keyboard Presses the same way! This is done by using KB("x"). For Example;
KB("Down")
waitFrames(20)
KB("S")
would send the Down arrow Key, wait for 20 in-game frames, then send an S key. You can also hold down Keys by using;
HoldKB("Down")
waitFrames(10)
HKB("Right")
waitFrames(10)
KB("S")
RKB("Down")
ReleaseKB("Right")
HoldKB(x) or HKB(x) to make it faster to Type, in conjunction with ReleaseKB(x) or RKB(x) to hold Keys for extended periods of time.
You're also able to set Controls within TASScript Settings.ahk, to make it a little easier to understand what's happening at a glance. I've pre-assigned Up, Down, Left, Right, Jump, and Pause, to W, S, A, D, Space, and Escape, and to use these you just Copy and Paste the Keyboard Controls from TASScript Settings.ahk into the PlayScript() body, at the very top. Whenever you want to use them, you just do KB(x) without Quotation Marks, so KB(Jump) would send a Space input.
Restructuring of Memory
I've changed the way that you add Memory Addresses to Read Frame Data from! This is all enclosed within the new TASScript Memory Addresses.ini file. The way it is structured is as such;
[InternalDenotion]
EmulatorAHK = "ahk_exe program.exe"
EmuBaseAdd = 0x00000000
EmuOffests = 0x00, 0x00
One feature of this means that it's possible to add non-Emulation program functionality fairly easily, so long as you can find a Memory Address that holds a Frame Counter. This explanation is going to assume that you understand Memory Addresses. To add a new Program to it, you just Copy and Paste the above Block of text and change a few things.
- 'InternalDenotion' is changed to whatever you will be referencing this entry as. I personally enter it in the structure of Emulation and then Version of the Emulator, e.g. [PS21701509], or for programs I just name it what the program is, e.g. [LeapYear].
- For 'EmulatorAHK', you just change the last part, from 'program.exe' to what shows up in Task Manager for your program, e.g. if Discord was a game, you'd enter "ahk_exe Discord.exe". Bear in mind the name of the .exe may be different from what it is generally known as.
- 'EmuBaseAdd' is a hex value that is used to denote where Emulation Memory is stored. If not using an Emulator, you can omit this, or just leave it as 0x00000000.
- 'EmuOffsets' is used to lay out the Offsets needed, separated by a comma.
macrolua-like Function
I hadn't heard about this little thing called macrolua, but a YouTube comment prompted me to look into it, and it's really cool, so I kind of had to try implement it.
The way that the Tools work, a few frames of inputs can take a while to do. However, the way that macrolua, and now the FGC("x") command works, is you feed it a string of commands, and it parses them to do the inputs. FGC stands for Fighting Game Controller, since the YouTuber that brought it up does TAS videos of Fighting Games.
When you use FGC("x"), you need to include the Quotation Marks inside it, and you also have to be wary of capitalization, otherwise it won't work. How you use it is by giving it preset commands, which are customizable within the TASScript FGC.ahk file. It's pre-filled with 10 buttons and 4 Directions, you just have to change the entries into whatever Keys your Game is using. The Directions are denoted as WASD, and the Buttons are 0 through 9 inclusive, and are used in this way;
FGC("S456")
would set whatever you denote as S, button 4, button 5, and button 6 as pressed, but nothing will happen. This is because you have to use Special Inputs alongside the Key Inputs. Here's a list of them all:
- "."
- "q"
- "h" and "r"
- "+" and "-"
- "="
The most important one is ".", the Period. When you use the Period, it waits for the frame to advance, the same as the old waitFrames(x) command does.
FGC("S456.W123.")
is two frames of Inputs. First, it preps S, 4, 5, and 6, and advances the frame, and releases them. Then it preps W, 1, 2, and 3, advances the frame, and then releases the buttons. So, instead of doing a string of commands like;
Down()
Right()
Down()
HoldRight()
HoldSquare()
HoldTriangle()
HoldR1()
waitFrames(1)
ReleaseAll()
for 4 frames of inputs, you can do it like this instead;
FGC("S.D.S.D456")
It's much faster and less cluttered, and easier to type out.
The second one is "q", this lets you queue up frames, the same way waitFrames(x) does for longer than a single frame. You use it simply by writing "q" followed by a number and a Period, so "q54." would just wait 54 frames. You can combine this with a sequence of commands, and have it hold them the entire "q" amount of Frames, as such;
FGC("S.SD.D6.q10.D..D52q100.")
presses S, then S and D together, then D and 6 together, then waits 10 frames before doing D again, there's then a frame with no inputs, and then 100 frames where D, 5, and 2 are held.
"h" and "r" are fairly important as well, as these let you denote holding an input for an unspecified amount of time, and subsequently releasing it. They work similarly to "q" but instead of just a number, you put what input you want held or released, e.g. "hD" will hold D, and it won't be released until you either do another "D" or do "rD", so;
FGC("S.SD.Dh45.q50.r4.")
does S, SD, and then it does D, 4, and 5 together, but doesn't release 4. Then it passes 50 frames, and releases it a frame later.
One of the more exciting ones are the "+" and "-" Inputs, as these let you switch Controls between Players. In the TASScript FGC.ahk file, you can denote what Inputs relate to what Key on the Keyboard, for each player. Technically this is expandable to as many players as you want, but as 4 players is generally the go-to max for most games, I've only set it up to have up to 4. How you use these Special Inputs is just by typing them out. "+" will increase the Active Player Number, and "-" will decrease it. You default to Player 1 when loading a Script, then if you enter "+" you will switch to Player 2, do it again and it would go to Player 3, and once more for Player 4; Then any inputs you do are assigned to that Player.
FGC("D+Aq100.")
would Hold D down for Player 1, Switch to Player 2, Hold A, and bother would be held for 100 frames. If you wanted to control both Player 1 and Player 2 at the same time, you would have to Alternate like so;
FGC("S+S-.D+A-.S+S-.D456+A456-.")
would do S, D, S, then D456 for Player 1, but simultaneously do S, A, S, A456 for Player 2.
When doing longer strings, It can be hard to read, so you are able to do spaces, or even separate them into different FGC("x") commands;
FGC("WD.q25.6." "q33.S5." "q23.S6." "q5.S.AS.A12." "q80.D.S.SD45." "q10.52A..A." "q30.S.D.S.D456.")
has each Fighting Game Move separated to make it easier to partition and read what's happening, but if that's still not clear enough;
FGC("D.S.SD5.")
FGC(".h2h5q3.D..Dr2r5.")
FGC("q30.S.SD.D45.")
FGC("q32.S.D.S.D456.")
also separates inputs, but is easier to read, and you can add Comments to the end of the lines with a semi-colon.
Finally, "=" is there to force Release all Keys that are bound. This can be very taxing on the computer, as it's sending between 14 and 56 keystrokes in a single frame (Depending on number of Players,) so only use it whenever you absolutely need. Prioritize using the tools proper and utilizing "h" and "r" as and when you need to.
Emulator Input Scripts
Changelog:
-Made the readme a little bit better.
-Sorted a lot of the code, separating what the user should be able to edit from what they shouldn't touch.
-Changed the internal layout of the Buttons to match default settings of actual controllers. On Emulators that allow Automatic Mapping of inputs, this makes it much easier to get going with the Scripts. This does mean that anyone that was using the older Scripts will have to redo the Controller Setup.
Emulator Input Scripts
Updated functionality of the Tools, as well as some small bug fixes.
Added Features:
-Added a Pause Function in Controls.ahk, Hotkey set to Scroll Lock as default. Used to Pause the Script midway, in case you need to select a different window for something whilst a Script is running. To resume playing a Script, press Scroll Lock for a second time, then manually advance 1 frame in the Emulator.
-Added a Counting Function in Controls.ahk. Hotkey set to the Grave Key, the key next to 1 and above the Tab key on most English Keyboards, as default. Counts how many frames have advanced since the last Script Refresh. Useful for moments where you're unsure how long it takes for something to happen, so you can do something like waitFrames(99999), pause the Script with the added Pause Function, then press Grave to see how many Frames have passed.
Changes:
-Added the following PCSX2 versions to compatibility:
1.7.0-1947
1.7.2026
1.7.3902
1.7.4117 (Latest Build as of this Update)
-Added the following Dolphin versions to compatibility:
5.0-17995
5.0-18498 (Latest Build as of this Update)
PCSX2 AHK TAS Tools
Migrated from Google Drive.
Updated Controls.ahk to be able to easilt add compatibility of different versions of the PCSX2 Emulator.
Added the following emulator versions to be compatible:
1.4.0-rr
1.7.0-1258
1.7.0-1509
1.7.0-1711