A Python automation tool that helps fill out timesheets by simulating mouse clicks, keyboard input, and scrolling actions based on pre-defined commands.
- Automated Button Clicking: Finds and clicks buttons on the screen using image recognition
- Text Input Automation: Automatically types text from text files
- Mouse Scroll Simulation: Simulates mouse wheel scrolling
- Action Recording: Includes a recorder utility to create automation sequences
- bot_timesheet.py: Main script that executes the automated actions
- recorder.py: Utility to record mouse clicks, keyboard input, and scrolling actions
- comandos/: Directory containing all the command files (images, text files) used by the bot
-
Button Commands: Stored as
.bmpfiles in the format<order>_boton_x<x_offset>_y<y_offset>_t<delay>.bmp- These are button images the bot will look for on screen
- x_offset and y_offset define the click position relative to the button's center
- t specifies how long to wait after clicking
-
Text Commands: Stored as
.txtfiles in the format<order>_texto_t<delay>.txt- These contain text the bot will type
- Before typing, it selects all existing text (Ctrl+A) and deletes it
-
Scroll Commands: Stored as
.txtfiles in the format<order>_scroll_t<delay>.txt- These contain the scroll amount (positive for up, negative for down)
- Python 3.6+
- PyAutoGUI
- PIL (Pillow)
- keyboard
- pynput
- OpenCV-Python (for image recognition confidence)
# Clone the repository
git clone https://github.com/StructuralWizard/bot_timesheet.git
cd bot_timesheet
# Install dependencies
pip install -r requirements.txtpython bot_timesheet.pyThe bot will:
- Wait 3 seconds (to allow you to position your cursor)
- Execute all commands in the
comandosdirectory in alphabetical order
python recorder.pyThe recorder allows you to:
- Press F8 to record the position where you want to click
- Press F9 to mark the top-left and then bottom-right corners of the button
- Type to record keyboard input
- Use the scroll wheel to record scrolling
- Press F10 to stop recording
- The image recognition uses OpenCV for reliability. If you encounter issues, adjust the
confidenceparameter in the code. - For button clicks, make sure the button images are clear and distinctive.
- The bot runs actions in alphabetical order of the filenames, so naming conventions are important.
This project is open source and available under the MIT License.