Mouse & Keyboard Bot
- Diniz Martins
- Mar 1, 2023
- 1 min read
This article illustrates how to automate mouse and keyboard movements using pyautogui module in python. This module is not preloaded with python.
So to install it run the following command:
pip3 install pyautogui |
The code shows how to move the mouse using coordinates and send a message in predefined seconds.
Code:
import pyautogui as pg import time def codehere(): pg.click(807, 979) pg.typewrite("hello") pg.typewrite(["enter"]) time.sleep(2) pg.click(1621, 896) pg.click(1621, 896) # time.sleep(1) pg.click(1693, 859) # time.sleep(1) pg.click(1014, 669) # time.sleep(1) pg.click(1111, 605) a = 20 time.sleep(10) while (a != 0): codehere() a = a - 1 |
You can run the script, open your notepad or WhatsApp and see the message sent.

Comments