|
Post by vampiredbr9 on Jan 27, 2017 16:35:04 GMT
I have created a very short piece of code, which if I may say so myself is pretty awesome. First you run it, select the compare dimension you have inside the app you are scripting, then tap the two opposite corners of the area you want a region. What is unique about this, is that the script scales the region to the compare dimension of your other script, meaning you don't have to do any complicated calculations, or guesswork Source Code: (if you want to know how it works) dialogInit() addTextView("Compare Dimension of your other script:") addEditNumber("compare", 600) newRow() dialogShow("Region Finder V1.0") Settings:setCompareDimension(true, compare) toast("Touch First Location") local action, one, touchTable = getTouchEvent() wait(1) toast("Touch Second Location") local action, two, touchTable = getTouchEvent() onex = one:getX() oney = one:getY() twox = two:getX() twoy = two:getY() width = twox - onex height = twoy - oney myRegion = Region(onex, oney, width, height) myRegion:highlight() wait(2) print("[MyRegionName] = Region("..onex..", "..oney..", "..width..", "..height..")") dialogInit() addEditText("RegionName", "[MyRegionName] = Region("..onex..", "..oney..", "..width..", "..height..")") dialogShow("Copy and paste region")
Here's the link to download: www.mediafire.com/download/cjvv3ca4k0vv9k4
|
|