📜 ⬆️ ⬇️

Two ways to collect awards for advertising in mobile games, or robots should work

Many mobile games have an internal currency or something useful that can be obtained after viewing an advertisement. At first, I watched such an advertisement and even found something interesting in it, but the farther away - the more I felt like a monkey performing the same actions, exactly the same movements. Every time for me like that - a sign - it's time to automate the process.

The article does not claim the Nobel Prize and any scientific achievements, I just made two options for automatic viewing of ads and friends liked it, so I decided to write this article.

image
')
Because robots have to work, not like this.

Since childhood, I was a fan of one racing series and when I found its new mobile version, and even for free, I was delighted and surprised. Although I soon realized why it was free - in-game purchases were being pulled by several average monthly salaries in the regions or one or two Moscow wages, they literally stand as the games of the AAA-class of the last time. Without the infusion of real money, the process was extremely slow. But you can watch ads, and especially at the beginning of the game, it gives a good increase in everything, only quickly gets bored. Especially when the same ad is shown 5-10 times in a row. And the buttons are (in 99.9% of cases) in the same places. Actually, the last one made me remember that I have several servo machines and arduines and this really mechanical work should be entrusted to the mechanism.

The scheme is quite simple:

image

Yellow (or red, someone like) wire servok - to 10 and 11 pins of arduinka,
from it + 5V and the earth, on the ground it is necessary to bring the levers of servki (capacitive screen).

But the code did not work right away:

#include <Servo.h> Servo servo1; Servo servo2; void setup() { servo1.attach(10); servo2.attach(11); pinMode(LED_BUILTIN, OUTPUT); } void blynk(int cnt) { for (int i = 1; i <= cnt; i++) { digitalWrite(LED_BUILTIN, HIGH); delay(11); digitalWrite(LED_BUILTIN, LOW); delay(11); } } void hitit(Servo servo, int wait) { servo.write(180); delay(500); servo.write(90); for (int i = 1; i <= wait; i++) { delay(1000); blynk(1); } } void loop() { blynk(2); hitit(servo1, 35); // click get stuff and wait for adverts blynk(4); hitit(servo2, 15); // close advert blynk(2); hitit(servo1, 10); // click collect reward delay(2000); } 

Later I remembered / found out that the type INT and delay (35 * 1000) of extremely small size does not work.
Well, okay, I did to blink every second, this is a forfun project, I didn’t want to dig much at that moment. And I'm still extremely avoiding everything related to C ++ and strict types, well, not mine.

With the help of a pile of business cards, he adjusted the height of the servos to the phone.

Also, I can finally say that I use that sport equipment that I am presented with, at least a box from it came in handy.

image

The most difficult thing was to make the screen react to pressing the levers of the servos without fingers. Friends have already said that it is easier to find (or get) a real human finger than all of my experiences. Tried an antistatic film (the one in which video cards and hard drives are packed), several types of foil.

In the end I made these levers and printed them out on the right side:



Under the platform, the lever stuck some plasticine and wrapped it with the foil that earned, also brought both foil tips to the ground of the circuit, more or less earned.

It looks like this (after trimming most of the advertising and "connecting to the server"):



The meaning of this whole action (except for the fan from the process itself and the faces of friends who saw it) is in one picture:



For the beginning and the middle of the game, this is a rather serious, absolutely free resource increase.
Even in the later stages - it is still a nice bonus, every day of use = many per week and very many per month.

There were a few downsides to this:



Although the last point is still interesting to me, I found the second method and did not return to the first for a long time.

Need a small program nircmd.exe and the emulator of your phone.

Install the desired game (it works easily with online games or you have to drag saves back and forth).

Run in full screen.

We take a screenshot every time when you need to click on the screen (for a start, click on the “get something” button for an advertisement). Then we insert for example into a paint and see the tool with a pencil from the bottom right of the coordinates of this element for pressing.

Next came about like this code:

 :loop rem hit get reward nircmd setcursor 1600 950 nircmd sendmouse left click TIMEOUT 40 rem hit three points where close ads usually are nircmd setcursor 1777 70 nircmd sendmouse left click TIMEOUT 1 nircmd setcursor 1212 60 nircmd sendmouse left click TIMEOUT 1 nircmd setcursor 170 100 nircmd sendmouse left click TIMEOUT 40 rem hit reconnect just in case nircmd setcursor 1000 866 nircmd sendmouse left click TIMEOUT 3 rem hit collect reward nircmd setcursor 1600 950 nircmd sendmouse left click rem wait all windows to close and start all over TIMEOUT 3 goto loop 

We save this code in a .bat file, for example, like mine - gimmemoney.bat, and next to that nircmd program (you can put it in C: \ Users \% USERNAME% and run it directly from the console, in cases of special game dependencies, you can add it to autoload With the launch of the emulator, I'm still struggling).

Rarely, once in a few days, advertisements appear with a vertical screen layout.
Both in the emulator and in the arduino version this created problems.

The Arduino version did not live to see it, but in this script this is all taken into account, the script has not been stuck once in the past few months.

Also, there is added a click on the button "repeat" if the connection is lost, it happens quite often.



Only one minus - the emulator should be in the foreground, deployed in full screen.
If someone knows how relatively easy it is to send a mouse click to a minimized application of an emulator, without even turning it to the front and not sending it a focus - let me know, that would be just perfect, hang yourself rolled up while the morning beat reads.

What is it all about?

I threw about 300r into this game and I realized that she would happily eat both 3000r and 30.000 + r.
A set of resources or progress of some car often stands here as an AAA game, ± 3000r.

It will advance a little, but it will not give any fantastic advantages and it can be merged for the day of the game (if it’s not a car, but until the end of the game such sets can be bought another 4-5, only for this car, and there are dozens of them in the game).

On the one hand, these two methods amused me, but on the other, it was a pleasant and rarely achievable “passive income” that many people dream of, even if only in a game.

I wish everyone a sea of ​​for-fun projects and ideally passive income from them.

Source: https://habr.com/ru/post/447908/


All Articles