Post by xxdxmhippiexx on Apr 19, 2017 22:52:56 GMT
RegionHelper
How dose it work?
Region helper will first split the device screen up into 12 squares/rectangles (4x3 if the script dimensions are horizontal or 3x4 if vertical)
It will then split those 12 regions into 4x4 subRegions. When a function is called it will use a "dummy region" to calculate and set the new dimensions based off of the chosen
region/subRegion combination. The api may be a bit tricky to get the hang of, but making precise searches using a minimum portion of the screen without fiddling with coords will be
worth the hassle.
Simple usage:
Download: spikanting-technologies.net/scripts/regionhelper
--download link will be working very soon..sorry
More info and screen shots coming soon!
How dose it work?
Region helper will first split the device screen up into 12 squares/rectangles (4x3 if the script dimensions are horizontal or 3x4 if vertical)
It will then split those 12 regions into 4x4 subRegions. When a function is called it will use a "dummy region" to calculate and set the new dimensions based off of the chosen
region/subRegion combination. The api may be a bit tricky to get the hang of, but making precise searches using a minimum portion of the screen without fiddling with coords will be
worth the hassle.
Simple usage:
local RegionHelper = dofile(localPath.."lib/RegionHelper.luac")
Reg = RegionHelper.new(scriptDimension_width_px, scriptDimension_hight_px)--the dimensions of the device the script was written on
Reg.imgSimilarity = 0.7 --default: 0.8
Reg.debug = true --default: false || Setting to true will show all regions used during script play RECOMMENDED! good way to get a hang of the api
--most functions are as followed: function(PSMRL, region, subregion, region2, subregion2) all "region perimeters" are int 1-12
--most if not all ankulua functions are available (find, click, getLastMatch, getLastMatches, waitFind, waitCLick, so on, and so on)
local top_left = 1
if(Reg:click(PSMRL, top_left))then
--found and clicked PSMRL in top left corner of screen (region 1)
end
local bottom_right = 12
if(Reg:click(PSMRL, bottom_right)then
--found and clicked PSMRL in bottom right corner of screen (region 12)
end
if(Reg:click(PSMRL, top_left, bottom_right)then
--found and clicked PSMRL, searched using the whole screen
end
--using subRegions
local bottom_right = 1 --using 1 main region only (top left)
local top_left = 1
local top_left_sub = 1
local bottom_right_sub = 1
if(Reg:click(PSMRL, top_left, top_left_sub, bottom_right, bottom_right_sub))then
--found and clicked PSMRL in a small portion of the top left corner of the screen (region 1, sub region 1)
end
local bottom_right = 1 --using 1 main region only (top left)
local top_left = 1
local top_left_sub = 12
local bottom_right_sub = 1
2
if(Reg:click(PSMRL, top_left, top_left_sub, bottom_right, bottom_right_sub))then
--found and clicked PSMRL in a small portion of the bottom right corner of the top left portion of the screen (region 1, sub region 12) (confusing..ik)
end
--all options
Download: spikanting-technologies.net/scripts/regionhelper
--download link will be working very soon..sorry
More info and screen shots coming soon!