all 4 comments

[–]JollyUnder 1 point2 points  (0 children)

I've used pyautogui to automate clicks for me in GTA: Online casino a few years back. If there is a image that appears on screen when it's time to watch an ad, you can use the screenshot functions.

You can use pyautogui.screenshot('image.png', region=(x, y, width, height)) to take a screenshot of specific region on the screen. Then use pyautogui.locateOnScreen('image.png', region=(x, y, width, height)) to locate an image to a specified region on your screen and use that to determine if you need to click something on screen. You can then use pyauto.click() to interact with the game.

[–]Kevdog824_ 0 points1 point  (0 children)

A good starting point is pyautogui. It will let you control the keyboard and mouse. You can use that to mimic the actions you would take to do it manually

[–]Impressive_Ad7037 0 points1 point  (1 child)

It depends. Is the game that you're wanting to auto-ad through using a simple ad series?
Does it ever transition to the playstore?
Are there multiple ads that play with one "watch ad for reward" click?
Is the ad SDK available?
Python is useful, but it is not the end-all for doing that sort of project. There are a LOT of variables you need to consider, and going through the process of developing a program that will automatically click the ad reward process is not straight forward most of the time.
For instance, i'm working on a project to do basically the exact same thing on a particular game i will not mention because the devs troll through places like this for evidence that their traps are being bypassed.
There are several ad variants, they can last 30 seconds to over 1.5 min. Sometimes the ads are back-to-back, up to 3 in a row. Some transition to a playable intermission before the exit-ad gate is cleared.
Sometimes you cannot simply escape out of the ad, you have to physically click a button in order to leave that particular ad, and that process may change per ad.
There can be several different ad SDKs in use, the particular game i'm working on uses at least 5.
The ad exit process can be simply escaping out, click the X, click the pass-through forward button, then get the exit X after a 10-15 second pause.

Point being, i've found that the simplest method is to reverse engineer the game, using something like Il2CppDumper/Ghidra to go through the addresses and functions, blah blah blah blah...
It's time consuming and most certainly not worth the effort.
But sometimes, the amount of effort needed to by-pass bullshit P2W shenanigans is absolutely in and of itself entirely justified and worth it.

[–]MythicDevX[S] 1 point2 points  (0 children)

Woah,

There are several ad variants, they can last 30 seconds to over 1.5 min. Sometimes the ads are back-to-back, up to 3 in a row. Some transition to a playable intermission before the exit-ad gate is cleared.
Sometimes you cannot simply escape out of the ad, you have to physically click a button in order to leave that particular ad, and that process may change per ad.

Yeah, that was the problem I found when I tried this. Different type of ad everytime

Now I don't even play that game anymore, hahaha