"Fun App" QQ repeatedly see auxiliary tools

Source: Internet
Author: User

I have been learning the C language for so long, but I have not written anything that can be used, and I always feel unhappy in my heart. These days really do not want to do business, in the online blind stroll, the results found someone wrote a repeatedly look at the plug. I suddenly thought it was interesting. So the code is downloaded, and the tinkering. Found it is quite simple, so I studied it, modeled after the one wrote.

Plug the main idea: get the window position, get the screen information on the image encoding, find can be eliminated, analog mouse click to eliminate.

1. Appearance:

This is done with MFC, I myself is a little MFC will not, began to card on the interface for a long time, has been on the Internet to find the tutorial MFC. But the online tutorials are mostly assorted things, for a long time did not know how to make an interface. Later I simply did not look, directly to try, in the vs2012 created an MFC application. It turns out that the basic look is simple to implement. Simply drag the control in. And then change the property to be good.

After the appearance is done, the Click button and function function should be combined together.

Adding a functional function declaration to the MFC auto-generated DLG class

There are also some information about the image encoding that needs to be used later in the class.

classClinkgamehelperdlg: Publiccdialog{ Public: CWnd*Myc; MyColor* TC;//keep track of every picture in the game    intTcnum;//record the number of pictures in the game    int* MAP;//record the code results of the game    intPnum;//record total number of images to be eliminatedCRect Loc; Clinkgamehelperdlg (CWnd* pparent = NULL);//Standard Constructors    enum{IDD =Idd_linkgamehelper_dialog};protected:    Virtual voidDoDataExchange (cdataexchange* PDX);//DDX/DDV SupportHicon M_hicon; VirtualBOOL OnInitDialog (); afx_msgvoidOnSysCommand (UINT NID, LPARAM LPARAM); afx_msgvoidOnPaint ();    afx_msg hcursor Onquerydragicon (); afx_msg  void  onbuttonlock (); ///The following functions are the buttons corresponding to the afx_msg  void  onbuttonclear (); afx_msg  void  onbuttonclearall (); afx_msg  void  onbuttonauto (); afx_msg  void  onbuttonupgrade (); afx_msg  void  onbuttonhelp (); Declare_message_map ()};

It is then found in the corresponding CPP file.

Begin_message_map (Clinkgamehelperdlg, CDialog)    On_wm_syscommand ()    on_wm_paint ()    on_wm_ Querydragicon () End_message_map ()

The following joins the function with the button:

Begin_message_map (Clinkgamehelperdlg, CDialog)    On_wm_syscommand ()    on_wm_paint ()    On_wm_querydragicon ()    on_bn_clicked (Idc_button_lock, Onbuttonlock)    on_bn_clicked (Idc_button_clear, Onbuttonclear)    On_bn_clicked (Idc_button_clearall, Onbuttonclearall)    on_bn_clicked (Idc_button_auto, OnButtonAuto)    ON_BN_ CLICKED (Idc_button_upgrade, Onbuttonupgrade)    on_bn_clicked (Idc_button_help, onbuttonhelp)End_message_ MAP ()

2. Lock window + encode

Now enter the first step of the function realization: Find the QQ repeatedly see the game window. This can be achieved through the following statement:

The statement will find the window named: QQ game-repeatedly see the role version of the window. If it fails, we provide information about the failure.

" QQ Game-Watch the role version " );     if (p = = NULL)    {        MessageBox (" please launch a game window ");         return ;    }

If the lock succeeds, then we can encode the picture by getting the window information.

Watch the game interface: You can know the top left corner of the first picture is 180 pixels above the window, 10 pixels to the left, each picture size is 31*35, a total of 19*11 place the picture.

Gets the coordinates of the window relative to the upper-left corner of the screen

Myc = p;   Watch the window myc// get a look at the position of the window relative to the screen loc is a crect type, defined in the class above

Gets the pixel value at the screen (x, y):

CDC *pdc=myc->getdc ();
Pdc->getpixel (x, y);

Based on the picture information above and the position of the window relative to the screen, we can know the coordinates of each picture relative to the upper left corner of the screen.

We sampled 4 points on each image to get the pixel values.

Defines a mycolor structure to store the pixel values of four sample points of a picture:

// The definition of the picture structure takes a pixel of four dots on the picture struct mycolor{    colorref c[4];} MyColor;

Define a MyColor array TC, to hold different types of images, each to get a picture of the 4 pixel information and the TC has been stored in the picture to compare, if you have the same to get the existing number (in the array position, starting from 1), if different in the TC to add this new picture.

Note: The dark blue pixels of the background are (48 76 112) If the pixels of the four sample points are close to the background value, the position is considered to be no picture, encoding 0.

Use an integer array map to hold the encoded information.

is the encoding result for a given scenario:

(digression: Can you guess who was the one who showed half the eyes?) )

3. Find a picture that can be removed

With the encoded information, we can look for images that can be eliminated. The key is that the picture is consistent and the route cannot exceed two bends.

The picture is well resolved, select a datum map, and then traverse all the pictures from behind to find the same code as the one.

Difficulty in judging the path: from the way to determine the path, the analysis of the horizontal type of connection.

Vertical and horizontal type of connection.

As long as you can find any one of the two connections, that means that two pictures can be eliminated.

4. Mouse click to remove

Use the following statement to achieve mouse movement and click:

 the  - // Click on the image of Point1 location mouse_event (mouseeventf_leftdown| Mouseeventf_leftup,0,0,0,0);

Click to change the corresponding location code to 0.

At this point the basic principle is finished.

In my interface, locking is the ability to implement locking and encoding.

Elimination is a click away to eliminate one. Here to note, after each click, to move the position of the mouse to the elimination of the Auxiliary software, or point the same as the mouse to remain in the game window of a picture, but also manually put the mouse to eliminate the click on the button, very troublesome. Each time you move the mouse to remove the key to facilitate continuous click.

Total elimination: As the name implies, a full Qing. But the problem is that 360 always comes up and takes up the screen, causing clicks to go wrong. If there is security software bounce out need to lock again.

Automatic elimination: The whole elimination although cool, but easy to recruit scold. Auto-Elimination is the random time that will be separated 200ms-1200ms click. It looks more real. The problem is that in the process of automatic elimination, the mouse is always occupied and it is difficult to stop halfway. I added a window shift detection, to regain the window position before each elimination, and if it changes, stop and pop the message. This will prevent unexpected situations.

Upgrade: not implemented.

Help: As the name implies, is the use of instructions.

Release version:

Change the MFC use in the release configuration of the attribute to use MFC in a static library

The platform toolset changes to Visual Studio 2012-windows XP (V110_XP) without the need to download patches for this option.

Problem:

1. All the work can not happen unexpectedly, if in the process of automatic elimination, there is a person to throw a forbidden hand props, AIDS is undetectable, and will continue to click the screen. You must then shake the window to exit auto-erase and then re-lock.

2. On the expansion screen, this plug-in will fail. The expansion screen must be removed.

Tools and Source code download:

http://yun.baidu.com/share/link?shareid=2181599825&uk=2757788903

"Fun App" QQ repeatedly see auxiliary tools

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.