Click here to Skip to main content
15,900,258 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C++ Visual studio 19
I have my phone connected to pc using scrcpy and i have written this code for a game i wanted to "hack"(game is called madbou). It checks (using getpixel) if there is an incoming ball and using sendimpt presses when needed.

While this works good, it is slow and i want the program to last longer(near 1400 ball always overshoots)

What I have tried:

I have tried calculating the speed of the ball, but it after a second ball or so it just overshoots
I am currently trying to find something to track the ball, OpenCV maybe, but its for video or camera???(idk really)
Open for suggestions :D
(I am doing this project just to learn and not to hack,maybe:D)
Posted
Updated 1-Jul-19 2:59am
v2

1 solution

What you've created is called a 'bot'. A word of warning: For many games, the EULA (the wall of text you need to accept when installing a game) clearly prohibits the use of such bots. This may not be the case for the game you mentioned, but even if it isn't, if you decide to do something similar for another game, you should watch out for these kind of clauses.

As for your problem, from the little information you provided it's hard to tell, but it seems you're suffering either from lack of performance, or the signal transmission isn't fast enough. You should therefore start by analysing the transmission rates in both directions, and the performance of your bot in analysing the data.

Fokus your efforts on whatever is taking the most time and try to pinpoint the exact function or whatever is the culprit. Then you can try refactoring that code. If you don't know how to improve it, show the code and ask for help.

OpenCV may help, I don't know it. But chances are that your problem lies in areas that OpenCV doesn't touch.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900