How would i begin to make a script like this?
https://www.youtube.com/watch?v=n3TytnZNL08&t=6s
Thanks
Need help.
Re: Need help.
One option is to use Pixelsearch to match the yellow edge of the inner backboard, take an image of the window and find the width/height of the yellow outline and you now have the x,y,w,h of the backboard, the rest is just some math and clicks
Here's some example code, keep in mind this script is basically pseudocode, use it as a guideline.
Here's some example code, keep in mind this script is basically pseudocode, use it as a guideline.
Code: Select all
;80,80 is an example, use the found width/height of the yellow outline
backboardWidth := 80
backboardHeight := 80
;Define a rectangle to search the pixel in, basically
searchX := 10 ;top left pixel to start search, change these values to fit the screen
searchY := 10
searchX2 := searchX + 400 ;search from top left pixel outwards 400 pixels width and 1000 pixels height
searchY2 := searchY + 1000
return
f1::
;fast parameter is important here because it searches from the top to the bottom, left to right so the pixel if found will always be the top left pixel
pixelsearch,outputX,outputY,%searchX%,%searchY%,%searchX2%,%searchY2%,0xFFFF00,10,fast rbg ;0xFFFF00 = yellow color, 10 = variation
if (errorlevel == 0) { ;outputs 0 if color is found
middleX := outputX + (backboardWidth / 2) ;click in the middle of the backboard
middleY := outputY + (backboardHeight / 2)
click,%middleX%,%middleY%
} else { ;no match
msgbox no yellow pixel found
}
return
Some of my AHK programs: 3D Voxel Game - Platformer Game
GitHub projects : Image/Pixel scanning class - Direct2D overlay class
GitHub projects : Image/Pixel scanning class - Direct2D overlay class
Who is online
Users browsing this forum: No registered users and 50 guests