Advance Mode:
getPixel(imageId,x,y,type)
- return {color string}
eg: for color WHITE, long=16777215, hex=ffffff
eg: getPixel(0, 10,10,"hex");
0 is the screencaptured image id,
get the pixel x=10, y=10 from captured screen, with the result display using hex value
eg: getPixel(getImage("cache",0,50,50,100,100), 10,10,"long");
clip the image from screen capture for the range 50,50, 100, 100
and from that image get the pixel x=10, y=10 from captured screen, with the result display using long value
getJson(httpLink)
- return {JS Object}
{ "X-Cloud-Trace-Context": "64e17d0cf7ab6e9e8c394dc816617c5f/1407216343458726882", "Upgrade-Insecure-Requests": "1", "Accept-Language": "en-US,en;q=0.5", "Host": "headers.jsontest.com", "DNT": "1", "User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:59.0) Gecko/20100101 Firefox/59.0", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" }
eg:var jsonValue= getJson("http://headers.jsontest.com/");
jsonValue.Host
result="headers.jsontest.com"
openApp(packageName,activityName)
- void
swipe(x1,y1,x2,y2,time,hold)
- void
hold can be "true" or "false"
touch(x,y,time,hold)
- void
hold can be "true" or "false"
touch(time)
- void
keyAction(action)
- void
toast(text,location,width,height,lines,time)
- void
Time is in millisecond, if set to -1 then it will stay on top
findImage(mainId, templateId, similarity)
- return JS Array Object{x,y}
return array object with {x,y}
if not found return ""
example usage
var loc=findImage();
loc.points.length
loc.points[0].x
loc.points[0].y
getImage(type=file,filePath)
- return {imageId}
getImage(type=url,httpLink)
- return {imageId}
getImage(type=cache,imageId,x1,y1,x2,y2)
- return {imageId}
getImage(type=reference,pageId,imageDataIndex,x1,y1,x2,y2)
- return {imageId}
openCV(imageId)
- return {imageId}
ocrText(imageId,language)
- return {text}
findColor(imageId,type,colors)
- return {boolean}
colors need to be use quotation if multi color is added eg:"color1, color2, color3"
showImage(imageId,location,width,height,time)
- void
Time is in millisecond, if set to -1 then it will stay on top
saveImage(imageId,filePath,format,compressLevel)
- return {file name}
format can be "png" or "jpg"
compressLevel 1~100 only works on jpg format
beep()
- void
wifi(value)
- void
setClip(text)
- void
getClip()
- return {text}
isImageExit(imageId)
- return {boolean}
copyImageToIndex(cache_imageId, new_imageId_index)
- VOID
removeImage(imageId)
- void
留言
張貼留言