Introduction of Auto Clicker
This [Auto Clicker Artifact] designed using PyQt5 aims to solve the repetitive clicking work, free your hands, with timeliness and accuracy, and optionalcoordinate positionmaybephotographTwo ways to realize the mouse positioning and click, and can be set after the click to enter the correspondingelementThis function mainly solves the problem of "click-enter-click" with repetitive work, and finally setshours, minutes and secondsmaybecount downTwo ways to set the time to start clicking, setrepetitionClick on the "Start" button.
Test Window Introduction
The following test window will be designed to test and demonstrate the effectiveness of using Auto Clicker Magic.
Test window code:
from import * from import * import sys class Label(QLabel): def __init__(self, imgPath, parent=None): super().__init__(parent) = imgPath (QPixmap().scaled(100, 100)) def mousePressEvent(self, evt): print('Clicked:', ) class MainWindow(QMainWindow): def __init__(self, parent=None): super().__init__(parent) ('Test Window') self.setup_ui() def setup_ui(self): = QWidget() () hbox = QHBoxLayout() vbox1 = QVBoxLayout() (vbox1) btu1 = QPushButton('A') btu2 = QPushButton('B') btu3 = QPushButton('C') (lambda: ('A')) (lambda: ('B')) (lambda: ('C')) (btu1) (btu2) (btu3) (QLineEdit()) (QLineEdit()) (Label('./img/')) (Label('./img/')) def Click(self, text): print(f'clicked:{text} buttons') if __name__ == '__main__': app = QApplication() window = MainWindow() () (app.exec_())
When the mouse clicks on a button or image, the console prints a message to show the effect of the click.
Photo preparation:
Run results:
Clicking on button "A" and two images, the console output is normal.
Tutorial on how to use Auto Clicker
1. Target setting. Click on the "Select Coordinate Points" button, move the mouse to the target position, press the right mouse button, that is, to complete the selection of coordinate points.
In this example, we will select buttons "A" and "C" and two input boxes, and set the content pasted in the two input boxes as "Hello" and " Street San Chai".
2. Picture path setting. You can use QQ's screenshot function to intercept the picture you want to click, and create a new folder in the current directory (recommended), and save the picture in the new folder, the naming of the picture or the folder should preferably be in English or numbers, and the picture format must bepng。
- Note: Move the mouse to the table and click the right mouse button, that is, the three function menus of Delete Row, Insert Row and Add Row appear. Each row can only be filled with coordinates or picture paths.
- In this example, we will create a folder named "photo" in the current directory, and use QQ's screenshot function to take a screenshot of the test window to save the two pictures, respectively named " ", " ".
- And insert a line under the third and fourth rows in the table to fill in the path to the image.
3. Time setting. Mode 1 is set according to the hours, minutes and seconds, that is, when it reaches the set time, it starts to execute; Mode 2 is set by counting down, that is, it starts to execute when the countdown time is 0.
This example uses approach 2, with a countdown of 3 seconds and a repeat count of 2.
4. Final operating results.
5. Note: If the mouse does not move to the picture when it should be clicked, there may be a problem with the screenshot, so you can take a new screenshot and try again.
caveat
You should follow the relevant laws, regulations and ethics when using Auto Clicker, manipulating other people's software or websites without authorization may involve illegal behavior, so please make sure that you use Auto Clicker legally and respect other people's rights and interests.
To this article on Python PyQt5 to achieve automatic click on the artifact of the article is introduced to this, more related Python PyQt5 automatic click content, please search for my previous posts or continue to browse the following related articles I hope you will support me more in the future!