GitHub - Spawnova/ShinsImageScanClass: A library/class for fast AutoHotKey image/pixel searching
Functions
#Image....................Find an image; Returns 1 on success and updates returnX and returnY variables; 0 otherwise
Image(image, variance=0, ByRef returnX=0, ByRef returnY=0, centerResults=0, scanDir:=0)
#ImageRegion..............Find an image in a specified region; Returns 1 on success and updates returnX and returnY variables; 0 otherwise
ImageRegion(image, x1, y1, w, h, variance=0, ByRef returnX=0, ByRef returnY=0, centerResults=0, scanDir:=0)
#ImageCount...............Find the amount of images; Returns count of images
ImageCount(image, variance=0)
#ImageCountRegion.........Find the amount of images in a specified region; Returns the count of images inside the region
ImageCountRegion(image, x1, y1, w, h, variance=0)
#ImageClosestToPoint......Finds the closest image to a given position; Returns 1 on success and updates returnX and returnY variables; 0 otherwise
ImageClosestToPoint(image, pointX, pointY, variance=0, byref returnX=0, byref returnY=0, centerResults=0, maxRadius=9999)
#ImageArray...............Finds all images; Returns 1 on success and updates the array variable to contain all image positions; 0 otherwise
ImageArray(image, byref array, variance=0, centerResults=0)
#ImageArrayRegion.........Finds all images in a specified region; Returns 1 on success and updates the array variable to contain all image positions; 0 otherwise
ImageArrayRegion(image, byref array, x1, y1, w, h, variance=0, centerResults=0)
#Pixel....................Find a pixel; Returns 1 on success and updates returnX and returnY variables; 0 otherwise
Pixel(color, variance=0, ByRef returnX=0, ByRef returnY=0, scanDir:=0)
#PixelRegion..............Find a pixel in a specified region; Returns 1 on success and updates returnX and returnY variables; 0 otherwise
PixelRegion(color, x1, y1, w, h, variance=0, byref returnX=0, byref returnY=0, scanDir:=0)
#PixelCount...............Finds the count of pixels; Returns the count of pixels
PixelCount(color, variance=0)
#PixelCountRegion.........Finds the count of pixels in a specified region; Returns the count of pixels in that region
PixelCountRegion(color, x1, y1, w, h, variance=0)
#PixelCountRadius.........Finds the count of pixels in a specified radius; Returns the count of pixels in that radius
PixelCountRadius(color, pointX, pointY, radius, variance=0)
#PixelArrayRegion.........Finds all matching pixels in a specified region; Returns the count of pixels in that region and updates the array
PixelArrayRegion(color, byref array, x1, y1, w, h, variance=0, maxResults=1000) {
#PixelPosition............Checks a pixel at a specified position; Returns 1 on color match; 0 otherwise
PixelPosition(color, pointX, pointY, variance=0)
#GetPixel.................Gets the pixel at a specified position; Returns pixel color on success; 0 otherwise
GetPixel(x, y)
#SaveImage................Save the current pixel buffer to a png image; Allows for saving specific areas as well.
SaveImage(name, x:=0, y:=0, w:=0, h:=0)
#Click....................Clicks at a position, supports background windows when possible
Click(pointX, pointY, button:="left")
#ClickDrag................Clicks and drags from two positions, supports background windows when possible
ClickDrag(pointX1, pointY1, pointX2, pointY2, button:="left")
#ClickRegion.............Clicks randomly inside a defined region
ClickRegion(pointX, pointY, w, h, button:="left")
#GetImageDimensions......Gets the width and height of an image used for searching
GetImageDimensions(image, byref w, byref h)
# Image() ImageRegion() Pixel() and PixelRegion() support 8 different scan direction:
# LRTB = Left to Right, from the Top to the Bottom (Default)
# LRBT = Left to Right, from the Bottom to the Top
# RLTB = Right to Left, from the Top to the Bottom
# RLBT = Right to Left, from the Bottom to the Top
# TBLR = Top to Bottom, from the Left to the Right
# TBRL = Top to Bottom, from the Right to the Left
# BTRL = Bottom to Top, from the Right to the Left
# BTLR = Bottom to Top, from the Left to the Right