Skip to content

Purpose and Definition of Functions including argument s usage

slyautomation edited this page Apr 30, 2021 · 11 revisions

Image_Rec_single(image, event, iheight, iwidth, threshold, clicker, ispace=20, cropx=0, cropy=0, playarea=True)

image = A string value that is the name of the image file in single quotations (include the file type extension) e.g 'prawn_fish.png'.

event = A string value that is a short description of what the function is doing for a particular purpose e.g 'picking a fishing spot'.

iheight = An integer that is the amount of pixels to pad from the y plane starting at the centre e.g 20

iwidth = An integer that is the amount of pixels to pad from the x plane to the centre e.g 20

Threshold = a float number representing a percentage of how much the image should match within the screenshot. Usually 0.7 is a relative good match while accounting for changes in contrast and noise.

Clicker = string indicator for determine which button from the mouse should be clicked 'left' , 'middle' or 'right'.

Cropx = if the image is cropped how much was cropped from the left X plane of the screenshot in pixel length.

Playarea = Boolean value to determine if by default the play area is the area to take the screenshot for or False if a custom cropped screenshot is used (use Cropx and Cropy)

Cropx = if the image is cropped how much was cropped from the top Y plane of the screenshot in pixel length.

Invent_crop()

Returns a screenshot cropped to only display the inventory space. Uses screen_Image(620, 480, 820, 750, 'inventshot.png') 620 pixels from the left, 480 pixels from the top, 200 pixels wide and 270 pixels in height. Saves the cropped screenshot as 'inventshot.png' and saves to the main project.