KevinTyrrell / FishingBot

World of Warcraft automatic fishing program. Fishes by using the mouse and searching pixel colors around the cursor to detect 'splashes' in-game.
34 stars 22 forks source link

Out of Bounds Exception #11

Closed wheezy1749 closed 6 years ago

wheezy1749 commented 6 years ago

Exception in thread "Thread-5" java.lang.ArrayIndexOutOfBoundsException: Coordinate out of bounds! at sun.awt.image.IntegerInterleavedRaster.getDataElements(Unknown Source) at java.awt.image.BufferedImage.getRGB(Unknown Source) at model.Angler.calibrate(Angler.java:229) at controller.Controller.lambda$calibrate$0(Controller.java:80) at java.lang.Thread.run(Unknown Source)

Running 2.0.1

I start calibration and then no cast happens. Timer counts down from 5 and then the crash occurs. I tried changing my resolution and disabled the hardware cursor as suggested in another thread but still didn't get the cast.

Noticed you're overhauling the whole program right now so maybe I'll just wait. I started my own version of a fishing bot awhile ago. It wasn't as far along as this one but followed the same basic concept, apart from using system sound to detect the 'splash', although your method is much more portable.

KevinTyrrell commented 6 years ago

Hey thanks for the report.

Can you verify that wow in on your system's primary monitor? Also it helps to have wow in windowed maximized. Secondly, if you have multiple monitors, try staying inside of the primary at all times. I'm looking through the old code I wrote for screenshots and it may be possible that monitors of different sizes can mess it up. I'd have to test to be sure though.

So you'd do the following:

Thank you for providing the stack trace. Let me know how that goes. In the overhauled version of the program I removed the need to calibrate, it automatically does it. I'll need to get some more free time to finish it though.

Quick question about your sound thing -- I was able to find the fishing splash sound in the game files, extracted it as a wav I believe. How then do you listen to the computers sound and fire an event when that one plays? I looked online and it seemed extremely complicated.

KevinTyrrell commented 6 years ago

Oh one more thing, if you right click on the calibrate button, a prismatic square should appear. The location of that square is the monitor FishingBot expects wow to be on.