Macro program that makes it easy to record and replay keystrokes for speed-running games or automating menial tasks.
- Make sure you've got Python installed.
- Get a local copy of the repository using either
git clone https://github.com/AmGthrow/TAS.gitor just regular downloading. The only files you actually areEventRecorder.py,Events.py, andtasbot.py. - run
pip install -r requirements.txtto get all dependencies (nothing butpynput, actually)
-
Open up a terminal and run
python tasbot.pyto start the script. -
If you want to save a new recording,
- press `Ctrl + Shift + F1`
- perform all the actions you want to be recorded
- If you want to replay the recording you currently have saved, press `Ctrl + Shift + F2`
-
If you want to replay the recording you currently have saved, press
Ctrl + Shift + F2- Press `Ctrl + Shift + F2` to start the playback
- Either wait for the replay to finish or press `Ctrl + Shift + F2` to end it early
NOTE It's always a bit risky to automate your mouse and keyboard. To instantly close the script, press Ctrl + Shift + Esc
The script creates a TASbot instance from tasbot.py which is mainly responsible for listening to keystrokes and playing them back. To store the actual actions that the user is executing, an EventRecorder keeps a list of all the events with two bits of information:
- What the action is (a key press, a mouse click, etc.)
- The time taken since the last event
When the EventRecorder plays the events back, it just executes the events in FIFO order and uses a time.sleep() to wait the appropriate amount of time between each event.