Record and play keyboard and mouse clicks
pip install botable
from botable import record, play
# collects the recorded events
recorded_events = list(record())
# press f1 to stop the recording when you are done
# plays 3 times the recorded events and collects the played events
played_events = list(play(recorded_events, loops=3))
Help:
help(record)
help(play)
Here is the same scenario but using the command line interface:
# saves the recorded events in /tmp/recorded_events.py
python -m botable record > /tmp/recorded_events.py
# press f1 to stop the recording when you are done
# plays 3 times the recorded events and saves the played events in /tmp/played_events.py
cat ./recorded_events.py | python -m botable play --playback-loops 3 > /tmp/played_events.py
Help:
python -m botable --help
Press f1 to stop the recording/playback. This is configurable, for example if you prefer to press escape:
lib:
play(recorded_events, exit_key="esc")
cli:
python -m botable [play/record] --exit-key esc
Press f2 to pause/resume the recording/playback. This is configurable, for example if you prefer to press space:
lib:
play(recorded_events, pause_key="space")
cli:
python -m botable [play/record] --pause-key space