Skip to content

Tool-Assisted Speedrun (TAS) Program Supporting Recording, Playing Back, Editing & Saving Keyboard & Mouse Inputs with a Text Editor to Modify, Save & Load with a GUI

Notifications You must be signed in to change notification settings

WillKirkmanM/TAS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

TAS

Tool-Assisted Speedrun (TAS) Program Supporting Recording, Playing Back, Editing & Saving Keyboard & Mouse Inputs with a Text Editor to Modify, Save & Load with a GUI

Features

  • Record: Captures keyboard and mouse actions with precise timings.
  • Playback: Executes a recorded or edited script.
  • Edit: A simple text editor allows you to manually modify the script.
  • Save/Load: Scripts can be saved to and loaded from files in JSON format.

Requirements

  • Python 3.x
  • pynput library

Installation

  1. Make sure you have Python 3 installed.
  2. Install the required library using pip:
    pip install pynput

How to Use

  1. Save the code as a Python file (e.g., tas.py).
  2. Run the script from your terminal:
    python tas.py
  3. The GUI application will open.

Recording a Script

  1. Click the Record button. The status will change to "Recording...".
  2. You have a 1-second delay to switch focus to your target application (e.g., an emulator window).
  3. Perform the actions (key presses, mouse clicks, etc.) you want to record.
  4. Click the Stop button in the TAS tool to finish recording.
  5. The captured actions will appear as a JSON script in the text editor.

Playing a Script

  1. You must have a script loaded in the editor, either by recording or loading a file.
  2. Click the Play button.
  3. Quickly switch focus to your target application. The script will begin playing.
  4. You can interrupt playback at any time by clicking the Stop button.

Editing a Script

  • The script is in a human-readable JSON format. You can directly edit the values in the text box.
  • Each action has a time (in seconds since recording started), a type, and other relevant parameters (key, x, y, etc.).
  • You can manually adjust timings, change keys, or remove unwanted actions. Be careful to maintain the valid JSON structure.

Saving and Loading

  • Save Script: After recording or editing, click Save Script to save the contents of the editor to a .json file.
  • Load Script: Click Load Script to open a .json file and load its contents into the editor for playback or further editing.

Script Format

The script is a JSON array of event objects. Each object represents a single action.

Example event:

{
  "time": 2.153,
  "type": "key_press",
  "key": "a"
}
  • time: The timestamp in seconds from the start of the recording.
  • type: The type of event (key_press, key_release, mouse_move, mouse_click, mouse_scroll).
  • ...args: Other parameters depend on the event type. For example, a mouse_click includes button, action, x, and y.

About

Tool-Assisted Speedrun (TAS) Program Supporting Recording, Playing Back, Editing & Saving Keyboard & Mouse Inputs with a Text Editor to Modify, Save & Load with a GUI

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages