0

I'm trying to make bot which will play facebook messenger basketball or football for me (cause I'm really bad at it). I even made something few years ago, but there was problems in both games. In basketball when basket started to move so fast that my program was making mistakes in calculations and in soccer when ball was moving to fast. I was using Robot.createScreenCapture() of the fragment of screen and then saved it in BufferedImage and I was checking every pixel in image, but it's not fast enought (I tried with Piano Tiles 2 too). I need something which is way more fast.

Erwin Bolwidt
  • 30,799
  • 15
  • 56
  • 79
Konik
  • 11
  • **What** is not fast enough? The screen capture itself? That's known: http://stackoverflow.com/q/646089/3182664 , http://stackoverflow.com/q/17665529/3182664 , http://stackoverflow.com/q/19843050/3182664 and others. Or is your analysis too slow? Then show us how you did this "pixel checking". Otherwise, we can only make guesses. – Marco13 Dec 31 '16 at 17:18
  • I don't know what is not fast enough, my program just missclick, so it's either seraching process or screen capture itself. I'm just using for loop in for loop, it's primitive way, but is should be faster then it is. – Konik Dec 31 '16 at 23:52

1 Answers1

0

You do not provide details about how you locate the ball in BufferedImage object.

You could:

  • Improve the location process effectiveness by so called logarithmic search.
  • Reduce the search area by using motion prediction techniques.

If you have not tried any of these two (you mentioned '...every pixel...'), I would start with the first one: Find approximate location of the ball by scanning pixels in a rough grid and then refine the location in the reduced search area around the approximate location.

To use rough grid I mean to scan every n-th row and column, where n will be the ball radius or more precisely sqrt(2*r*r)

Tomas F.
  • 610
  • 1
  • 6
  • 13
  • When I was making basketball bot I was checking only one row of pixels, and it wasn't fast enough so maybe making screen capture is not fast enough.Maybe I have to have acces to graphic card but I don't know how make things like that. – Konik Dec 31 '16 at 23:58