Closed mindforger closed 1 year ago
also just for good measure ... i measured execution time using autogui and bare pyscreeze and pixelmatch vs locate
on a 4k display, using a screenshot of the games hit area and the actual 720p hit area pattern
pixelcheck is random
PPS: pixelMatchColor alread has a tolerance parameter, so you do not even have to match up exactly, could be very helpfull to pull the trigger more precisely
maybe even guess the speed of the pattern
It is possible, but lag, fps drops and the frequency of screenshots might mess up the timing. I'm not too keen on implementing this, but I'll look into it.
since we prepared the button we will only have to check for any change on the pixel and not check over a number of colors.
Good idea. The only problem I could think of is rain hitting the hit area or npcs walking across it (assuming they aren't in the ideal spot). But I think we can mitigate this by searching for white pixels in the center of the hit area.
Thank you for your tests. With that, I'll use pyautogui.pixelMatchesColor for detecting when to hit. Since it won 2 times out of 3
I'll start working on this tomorrow
is rain hitting the hit area or npcs walking across it
the line for the minigame is intransparent and on top, you could use a pixel right where the line hits the hit area, then add a slight delay before pressing the button (or maybe the execution delay covers that already)
for debugging, you could open a simple tkinter widget and draw the a captured image on hit to it to adjust the pixel position in regards to the detected area (make it bright red or sth in the image) ... and don't use a fixed color value, better scan the pixel color at the begin of the minigame and check for changes
This isn't really relevant anymore with the recent changes
scanning areas takes a bit of time and if the target is alread 90% on the scan region, it might miss and the next scan might miss the target completely when moving too fast
to make the scanning more reliable use a fast pixel scanner along the "line" to trigger the actual scan to have a higher hitrate and maybe even guess the speed of the pattern by calculating the distance between the pixel and the pattern location to perfectly hit the target with a second pixel trigger and timed delay, since we prepared the button we will only have to check for any change on the pixel and not check over a number of colors