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

    Many mobile games have an internal currency or something useful that you can get after watching ads. At first, I watched such an advertisement and even found something interesting in it, but the further I went, 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 pretend to be a Nobel Prize or any scientific achievements, I just made two options for automatically viewing ads and my friends liked it, so I decided to write this article.


    Because robots should work, not like that.

    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 he pretty soon realized why it was free - in-game purchases were pulled by several average monthly salaries in the regions or one or two Moscow salaries, they literally stand like AAA-class games of recent times. Without 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 bothers. 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 arduins and I need to entrust the mechanism with such truly mechanical work.

    The scheme is quite simple:


    The yellow (or red, someone like) wire of the servos is to 10 and 11 pins of the arduinka,
    from it + 5V and ground, but the levers of the servos must be brought to the ground (capacitive screen).

    But the code didn’t work right away:

    Servo servo1;
    Servo servo2;
    void setup() {
      pinMode(LED_BUILTIN, OUTPUT);
    void blynk(int cnt) {
      for (int i = 1; i <= cnt; i++) {
        digitalWrite(LED_BUILTIN, HIGH);
        digitalWrite(LED_BUILTIN, LOW); 
    void hitit(Servo servo, int wait) {
      for (int i = 1; i <= wait; i++) {
    void loop() {
      hitit(servo1, 35); // click get stuff and wait for adverts
      hitit(servo2, 15); // close advert
      hitit(servo1, 10); // click collect reward

    Later, I remembered / found out that here the type INT is extremely small and the delay (35 * 1000) does not work.
    Well, okay, I made it blink every second, this is a forfun project, I really did not want to dig at that moment. And I still absolutely avoid everything related to C ++ and strict types, well, not mine.

    Using a bunch of business cards, he adjusted the servos in height to the telephone.

    Also, I can finally say that I use that sport equipment that they give me, at least the box from him came in handy.


    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’s easier to find (or get) a real human finger than all my experiences. I tried an antistatic film (the one in which video cards and hard drives are packed), several types of foil.

    In the end, he made these levers and printed them on the correct rod:

    Under the platform, the lever pasted a little plasticine and wrapped it with the foil that worked, also brought both foil tips to the circuit ground, more or less worked.

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

    The meaning of all this 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 middle of the game, this is quite serious, absolutely free resource increase.
    Even in the later stages - it is still a nice bonus, every day of use = a lot per week and a lot per month.

    There were a few drawbacks to this:

    • the phone had to be put in place every time, ± a couple of millimeters - does not work
    • sometimes you need to connect the charging and the arduino - always
    • after a while, the screen still stopped responding to the touch of the foil, even if someone knows why - write, I'm still interested (and the antistatic film stopped working much faster).

    Although I am still interested in the last point, I found the second method and did not return to the first for a long time.

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

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

    Run in full screen.

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

    Then we got something like this:

    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
    nircmd setcursor 1212 60
    nircmd sendmouse left click
    nircmd setcursor 170 100
    nircmd sendmouse left click
    TIMEOUT 40
    rem hit reconnect just in case
    nircmd setcursor 1000 866
    nircmd sendmouse left click
    rem hit collect reward
    nircmd setcursor 1600 950
    nircmd sendmouse left click
    rem wait all windows to close and start all over
    goto loop

    We save this code in a .bat file, for example, like mine - gimmemoney.bat, and next to that is the nircmd program (you can put it in C: \ Users \% USERNAME% and run right away from the console, in cases of special game addiction 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 up to this, but in this script this has already been taken into account, for the last several months the script has not been stuck even once.

    Also, clicking on the “repeat” button is added here if the connection is lost, this happens quite often.

    There is 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 the emulator without even deploying it to the front and not sending it focus - let me know, it would be just perfect, hanging yourself minimized while reading the morning clock.

    Why is this all.

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

    This will advance somewhat, but will not give any fantastic advantages, and this can be merged for the day of the game (if it’s not a car, but you can buy 4-5 more of these sets until the end of the game, there are only ten cars for this).

    These two methods amused me on the one hand, and on the other, it is a pleasant and rarely attainable “passive income”, which many people dream of, even if only in the game.

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

    Also popular now: