Hello to all!
I wanted an invite to Habr (
thanks to the Nast user for an invitee ), and finally this fact became the engine for writing the article, which is based on the history of personal experience in the field of automation of PC-related tasks.
I am an automator, I love that most of the tasks (software, hardware) are performed automatically without the intervention of me or other people.
Purpose:
- Share and, possibly, teach to optimize the work on the PC.
- The one who was looking for such information will have the knowledge to start and develop the task optimizer in itself.
- To give an additional opportunity to overcome laziness, and to do something that is really useful for oneself and others.
- Show, an example of how to make a program that automatically executes the recorded algorithm of actions for your convenience.
- To prove that automation is not boring, and as a result it is useful and even very interesting.
The reasons:
First of all. I often come across the fact that most users do not know how to organize their working time, specifically on a PC. It is ridiculous to watch when the user is distracted from really expensive work, at small software (sometimes hardware) actions, and then, indignantly, looks at the boss, who this month has reduced the failure rate relative to previous results.
')
Secondly. I used to have routine tasks that I used to force me to run automatically using different software products. But how many software options would exist, there are always functions that are not so easy to execute in one package. And I had to use in the complex several programs for automation together with programs for the standard purpose of office or not quite office work.
Thirdly. The time came when a real routine task appeared. It was connected with the fact that it was necessary to draw out text, tables, images from a PDF file, with copy protection installed on it, recognition by any software, printing, and something else. In general, the author of the file put the maximum protection in some (no longer remember) program for creating PDF files. And another important point, the pages in the file 202, the background is blue, and the text is yellow in places, blue in places. And most importantly, the deadline for receiving the finished text is only 3 days. I sometimes suffer from laziness, therefore, I immediately discarded all physical labor, and also, I did not begin to look for a team of a dozen fans to manually type the text from the image. As always, I turned to software for automating tasks. After spending one hour to write the correct algorithm, you can spend half a day doing more enjoyable activities.
But not everything is as simple as it seems at first glance. I have already said that one program can perform a maximum of 99.9% of the work needed. So I began to search the Internet and use the most fashionable ones in turn, according to the rating and reviews, programs for automation, of course, provided that, first, they could perform the functions I needed in the GUI environment, and not in the console, and secondly, free. Yes, by the way, we are talking about Win-applications. I will not recommend which application is better and which is worse - you can try it yourself, according to your goals and convenience habits. In principle, I can automate BASIC better than any special program for this business, but did not want to install Visual Studio - this is a waste of time and hard disk space. Moreover, we need a program that already has all the options for PC management, where you just need to select all the necessary actions from the list and change several parameters for you. And for a typical user, this is exactly what is required, there is no need to learn programming languages, everything should already be created in advance and work.
So here. I chose the
xStarter program (at that time v.1.9.2). Approached by 90%. I will not praise it, I will say only that the application really has a very convenient environment for the broad implementation of the automation algorithm. The only bad thing is that some functions are not configured, for example, the screenshot function of the screen loses quality due to compression - it is not suitable for text recognition. And I didn’t like the fact that there was no separate window that would show the coordinates of the mouse cursor, I had to download the sidebar gadget in the Vista OS “Mouse Pointer Locator”. And, of course, the third one is not very important for an advanced user, but in some controversial issues the right thing is a reference to the functionality of the application. It feels like a help file from the old version, and there is only a part of the functionality in the description.
At the time of this writing, I checked the new version of
xStarter v.1.9.3 - the help file is now full, there are scopes to determine the starting and ending point of the cursor on the screen, and the quality of the screen shot has improved noticeably, now you can recognize the text. Well done guys! I will be happy to wait for new releases of this program, where I will get even more functionality.
And I implemented the PDF recognition file algorithm (with Protection) very simple:
- Pdf file full screen
- Screenshot “Print Screen”
- Paste into “Photoshop”
- Cycle to page 202
- Macro in “Photoshop”: trimming, saving
- Picture Folder in “Fine Reader”
Handwork:
- Manual, text analysis and error correction.
- Saving to “Word”
- Editing DOC file
Time use of individual tasks:
- Creating an automation algorithm - 25-30 min.
- Algorithm setting - 30-60 min.
- Recognition and editing text - 4-5 hours.
Total time use:
- With automation (1 person only edits the text, the rest is automatic.) - 5-7 hours.
- Without automation (1 person does everything manually) - 3-5 days.
Practical example: (not about what was written a little higher!)
I will show you not just an example of the “Hello World” type, I will show you how to create a bot (that is, an automation algorithm) for the game
“Factory of friends” on the site
vkontakte.ru
I was attracted to this game by the fact that you can wind up virtual money in it with the help of a bot, despite the fact that the game works in a browser and is a Flash object. I do not have the competence in flash-technologies, for this, specially formed requests to control the game without a browser (if they exist at all?), Immediately threw it aside, my bot will only use the mouse cursor specifically for the game, and a few more functions to control browser, screen capture, variables, loops, and nothing else needed.
And so begin,
in the picture, the appearance of the program :
The bot consists of 2 tasks:
- "Factory of friends - purchase (Firefox)" - the main algorithm of the bot. 'Firefox' is just a browser designation with which algorithm it will work. You can adjust to any.
- "Read_Compare_ff" is an additional algorithm for checking the image for the fact of its change.
Bot algorithm executes the following:
- Finds a browser window with the game running and opens it to full screen.
- Then the 2nd task starts, which takes a picture of the screen area, exactly in the place where the figure with the amount of money in the game is located.
- Now the bot must hover the cursor, and click on the "Nursery" button next "Everything" and buy the first pet.
- When a pet is purchased, then the amount of money decreases - this is checked by our 2nd task under item 2.
- If there are no pets at all in the “All” kennel (often), then repeat step 3 indefinitely.
- After the purchase, the bot, after a while, checks (p.2) the fact of the sale of the pet - that is, the increase in the amount of money.
- If the pet is sold, the bot repeats step 3; if it is not sold, then the bot presses the Nursery button, to update the result of the game, an infinite number of times.
This is a general description of the operation of the algorithm, which I did for my own purposes, and I use it even now. The first was a bot to visit the game every 2 hours, but it gave a lot less profit in the game than the 2nd. It is good to leave the bot working for the absence of the PC.
Download bot (2 tasks) for the
xStarter program
And finally ...
Advantages of automation:
- Increase PC productivity (primarily for repetitive tasks).
- There is more time to rest or other activities.
- Overcoming the threshold of initial laziness, that is, the intention to make an algorithm to facilitate its own existence.
- Usefulness for personal purposes.
- Additional knowledge of technology - only benefit.
Cons automation:
- People do not want to learn and develop, they are happy to do what they have been doing for decades. Laziness prevails!
- People are afraid to do work faster, as the boss will immediately fill up with additional work. Again, laziness is above premium!
- People
from school are taught to work, not earn money!
Total:
I want this article to help anyone at least develop in the field of process automation. And what would anyone who is indirectly related to this article, expressed their subjective opinion about the read information. Well, and of course I
will be already very grateful for the invitation to Habra User’s lava;)