【Easy language】Desert plug-in use

        For the primary use of the desert plug-in, the desert plug-in can be called in many languages, and the easy language is simple to call and easy to learn. As long as you learn how to use a language, the actual language is not bad.


1. Call the plug-in

1. Call the desert

        First download the desert plug-in: desert plug-in

PS: The desert plug-in is charged, and account registration is only available from the 1st to the 3rd of each month

        After the download is complete, put Dm.dll and DmRed.dll in the same directory folder, and then create a new easy language program.

PS: DmReg.dll is desert-free registration. (Not free account registration)

        The desert plug-in is a COM component, and the COM component is an important part of the Windows system. They are some relatively small binary executable programs in the system, which can provide certain services for components such as application programs and operating systems. If the COM component is prohibited, it may cause video, music, etc. to not play normally, and many situations may occur. So registering COM components is a very important thing.

 Then use the tools in the decompression package to generate a class file.

 

 

 Open the class file and copy all.

 Add a new class on GoEase.

 Copy the data in, and change the class name to dmsoft to a private object Obj .

 Then create a new global variable whose data type is the dmsoft class.

 

Well, here you can use this variable to use the method of the dmsoft class. 

2. Registration is free in the desert

The desert-free registration needs to use the functions in the DmReg.dll file, so the dll is loaded here first.

 

 PS: Absolute paths can also be used. Here, the dll files are placed in the same folder as the program, and relative paths can be used. 

Then add an API to initialize the COM library.

Then start writing the registration-free process. (The code here does not support easy format, copy the screenshot directly)

PS: A pic folder directory is set here, under this folder are stored, captured pictures required by the desert image search function.

PS: The font file is, the Ocr function needs to be used to identify the font.

Second, the use of common functions

        There are many commands for the desert plug-in, and there are instructions for using the interface in the decompression package

1. Find pictures

 

Here we need to use the tools included in the decompression package.

First grab a picture.

 

 

I grabbed this image. Then save the picture to the set pic directory.

Then enter Yi language and use the function of finding graphs.

        Here is a brief explanation of the meaning of the parameters, because the screenshot here is a part of the entire screen, so the size of the entire screen is 1920*1080, (in fact, 0 should be counted as a pixel, it should be 1919*1079, here for convenience), So the front is the size position of the screenshot.

       Then there is the name of the picture just intercepted, which is very clear here

        delta_color is the color cast value, you can also use "020202" "000000" 

        sim is the degree of acquaintance, the higher the degree of acquaintance you want to find, the higher the degree of acquaintance.

       From what direction is dir searched, 0 is from left to right, top to bottom of the screen.

        The last x and y are the coordinates of the upper left corner of the picture after the picture is found.

        The function returns -1 if not found.

test:

Here you can try to move the position of the icon to see if it can still be found.

I moved the icon a little here and found that it can still be found, but the coordinates have changed.

It should be noted here that this is the front desk looking for a picture. If there are other things blocking the picture, you will not be able to find it.

Expansion: How to find transparent images

        After taking a screenshot of a general picture, there are too many background colors behind it, and the program recognition efficiency is low, so a transparent picture should be made to improve efficiency.

 

 Then paint with a paint bucket,

 After saving and returning, try a few more times until you know how to remove the affected color.

 then save

In this way, the transparent image is ready.

2. Find more pictures

 

An upgraded version of Find Picture, which can find multiple pictures at one time. Here is the same as above, grab a few more pictures.

Use function commands.

        Here you will find that other parameters are similar to those used for finding pictures, but you need to add the names of multiple pictures, separated by " | ".

 

         The return value of the function here is a string. The 0, 1, and 2 in front of it are the serial numbers of the corresponding pictures. Here, 0 corresponds to the "test.bmp" picture, and the latter is the coordinates of the upper left corner of the picture .

3. Literacy

First of all, the efficiency of finding words is lower than that of finding pictures, and then looking for words requires a font library.

Here we also use the desert comprehensive tool to intercept some pictures of words.

        Observe the binarized area here, if its font is not obvious. Use the color search to find the color on the font, and then tick the color cast. Note that the RGB mode should be used here. Until the font binarization is relatively clear and clear. 

        After you are done, remember the color description, which will be used in the following commands.

Create a new font

 

Take a look at the *.txt file.

Then use the word search command to see if you can find it.

First of all, the location of the font file should be set here.

 use word find command

        The first few parameters are the same as looking for the picture to set the position (here I narrowed the scope a little, so that it is easy to identify). 

       color is the color description to remember earlier, just copy it directly. (Note that it is in string format)

        return the recognized string

        

If you are lazy, you can also copy it directly after configuring it here.

test:

When found, the string is returned directly.

4. Find words

This function is the same as the operation and usage of literacy. It's just that there are more x and y coordinates that can be returned.

 test:

         0 means the string was found. Do not use this command if there are multiple identical strings, because the x, y coordinates only record the position of the first found string.

5. Find more words

 

The method of use is similar to searching for words, but you can find multiple strings.

        Use " | " to separate multiple strings. For example: "study|work|sleep", the last function returns a value, and the serial number returned represents the first string found.

test:

        Find out all the "learning" positions on the screen here, and you will find that the front serial numbers are all 0.

6. Pick color

Use with desert comprehensive tool

Note that RGB is selected

 

 will find the same.

7. Colorimetry

 

 

PS: The color description string is in string format. 

        0 means matched.

8. Find color

The method of use is similar to the above, color is the color description string of the color to be found .

It returns 1 after finding the color, and copies its coordinates to x, y.

PS: This command can invert the color.

        In this way, you can search for colors other than this color in the specified return range.

expand:

Here you can load the file into memory by looking for words and looking for pictures, so you don’t need to place pictures and fonts in the program directory.

        First put the picture into the easy program.

 

PS: The content is the length of the picture, which can be used directly later.

 Then you can use the memory search command.

This command is not bad from the previous picture search, but it should be noted that the address and length of the pictures are used in Pic_info here, both of which are of string type and separated by commas.

This command can also find multiple pictures.

 

 Import the font library and use it directly, and then set the memory font library, and then you can use the word search command.

        Finding pictures and words in memory is similar to the general method, but this will increase the size of the program, and generally there are many pictures required for automatic writing. This method is not very convenient, so it is not recommended.

 3. Background binding

        Looking for pictures and words in the front are all found in the foreground, here to learn about background operations.

        Foreground: It is very safe to directly use the mouse without binding the window. Start with the screen.

        Background: Bind the game window, starting from the game window. The background operation does not grab the mouse, and can work with multiple threads.

Here we use the thunderbolt simulator to learn.

When binding, it is generally used in conjunction with the binding test tool in the decompressed package.

        The first thing to pay attention to is the resolution. After the desert plug-in is bound to the background of the simulator, its maximum range is only 720*1280. The starting coordinates do not start from the screen , but from the upper left corner of the simulator. start .

       Therefore, when taking a screenshot of the simulator, you must use a tool to bind the simulator window, otherwise the intercepted coordinates are the coordinates of the screen.

       In the windows system, each window has a window handle, window class name, and window title.

       The window handle will change after reopening the software, but the handle can be found through the window class name and title.

        There are child windows under the parent window, for example, the emulator has only one child window here.

        There is also a grandson window

        And binding the background requires binding the window. (Generally, binding the top-level window or sub-window can successfully bind the background mode)

        Here the desert command is used to bind the window. And here is the test, different software binding modes are different, so use the binding test tool in the decompression package to test.

        Use the scope to move onto the simulator.

       Then start testing binding mode.

        Select gdi here, then bind, and test it.        

       

         It is found that even if the game window is blocked, the result can still take a complete screenshot, so the mode is correct.

 

         Select a location to simulate and see if the mouse can move and click. If there is a response, the mode is correct. Otherwise, it is wrong and you need to change the mode again. (here my test is windows mode)

        Finally, test the mode of the keyboard.

         It is found that it can be input into the simulator, indicating that the keyboard mode is also successfully bound.

PS: If the parent window is not bound successfully, you can try the child window, not all of them are bound to the parent window.

        Finally, use Damo's background binding command to bind the window

        I found that there are many modes to choose from, but they have been tested here, and they can be bound directly with commands.

        First look up the emulator top-level window handle, you can use the function.

         Its return value is the handle of the found emulator window. ( the handle is an integer variable )

         You can find the child window handle through the top-level window handle, and you need to use a command.

 

         Then you can use the handle of its child window for background binding.

        You will find that the following parameters are the modes that have just been tested, and you can just input them directly. If you are lazy, you can directly generate them on the tool.

 

test:


        After the background is successfully bound, you can try the previous commands again. If you want to automate multiple programs (multiple openings), you need to bind the corresponding programs so that each program does not affect each other.

Guess you like

Origin blog.csdn.net/weixin_45423515/article/details/125324841