Now, if you just apply this post, you'll be able to use the fishing macro. ! Let's review it before entering. In the first hour, we got the mouse coordinates and stored them in init.txt along with the name of the fishing site. In the second hour, we learned how to detect exclamation points. This time, let's take the code we developed in the previous post to the Keyboard and Mouse events so that it becomes automatic fishing.
In this post, we will use the PyAutoGui library to detect an exclamation point that informs the completion of the Chi fishing.
We've put OpenCV in the title, but we're not going to use OpenCV ourselves.
However, one of the functions that PyAutoGui provides is a function called locateOnScreen. There is an item called confidence during the optional argument that this function receives.
You must install OpenCV in order to specify this item.
(Note that PyAutoGui will process the main monitor only if you have a double monitor. )
The mechanism of fishing is repetitive.
Change the tree with life skills.
Move the mouse to the water.
Poke with the keyboard ('w').
Wait for the exclamation mark to appear.
When an exclamation point comes up, the keyboard (' W ') is collected.
Repeat 2 to 5 times.