AiBote 2022 新研发的自动化框架,支持 Android 和 Windows 系统。速度非常快

Ai-Bot 基于流行的 Node.js 和 JavaScript 语言 的一款新自动化框架,支持 Windows 和 Android 自动化。

1、Windows xpath 元素定位算法支持 支持 Windows 应用、.NET、WPF、Qt、Java 和 Electron 客户端程序 和 ie、edge chrome 浏览器

2、Android 支持原生 APP 和 H5 界面,元素定位 速度是 appium 十倍,无线远程自动化操作多台安卓设备

3、基于 opencv 图色算法,支持找图和多点找色,1080*2340 全分辨率找图 50MS 以内

4、内置免费 OCR 人工智能技术,无限制获取图片文字和找字功能。

5、框架协议开源,除官方 node.js SDK 外,用户可自行封装其他语言。目前有 Android 端 第三方用户使用 python 封装的 AiBot.py 模块

6、界面开发基于 chromium 内核,可使用 html、ccs 等 web 前端语言开发界面。

7、框架免费开源、支持打包 exe 和界面开发

基础视频教程:https://www.bilibili.com/video/BV1vt4y137TH?spm_id_from=333.999.0.0
界面开发教程:https://www.bilibili.com/video/BV1fP411G734?spm_id_from=333.999.0.0

Aibote RPA 官方网址:http://www.ai-bot.net/
交流 QQ 群:818820872

下面是开发文档和通信协议:

主函数示例

const AndroidBot = require('AndroidBot');

AndroidBot.registerMain(main, 16678);

async function main(androidBot){
    await androidBot.setImplicitTimeout(3000);
    let point = await androidBot.findColor("#0e76b1");
    console.log(point);
}

等待超时

await androidBot.sleep(3000);

await androidBot.setImplicitTimeout(waitMs, intervalMs = 5);

图片与颜色

await androidBot.saveScreenshot(savePath, options = {});

await androidBot.getColor(x, y);

await androidBot.findImage(imagePath, options = {});

await androidBot.matchTemplate(imagePath, options = {});

await androidBot.findAnimation(frameRate, options = {});

await androidBot.findColor(mainColor, options = {});

await androidBot.compareColor(mainX, mainY, mainColor, options = {});

OCR系统

await androidBot.findWords(ocrServer, words, options = {})

await androidBot.getWords(ocrServer, options = {})

点击手势

await androidBot.click(x, y);

await androidBot.doubleClick(x, y);

await androidBot.longClick(x, y, duration);

await androidBot.swipe(startX, startY, endX, endY, duration);

await androidBot.dispatchGesture(gesturePath, duration);

发送文本

await androidBot.sendKeys(text);

发送按键

await androidBot.back();

await androidBot.home();

await androidBot.recents();

await androidBot.sendVk(keyCode);

启动APP

await androidBot.startApp(name);

屏幕大小

await androidBot.getWindowSize();

图片大小

await androidBot.getImageSize(imagePath);

获取安卓ID

await androidBot.getAndroidId();

URL请求

await androidBot.urlRequest(url, requestType, contentType = "null", postData = "null")

Toast消息提示

await androidBot.showToast(text)

验证码系统

await androidBot.getCaptcha(filePath, username, password, softId, codeType, lenMin = 0);

await androidBot.errorCaptcha(username, password, softId, picId);

await androidBot.scoreCaptcha(username, password);

元素操作

await androidBot.getElementRect(xpath);

await androidBot.getElementDescription(xpath);

await androidBot.getElementText(xpath);

await androidBot.setElementText(xpath, text);

await androidBot.clickElement(xpath);

await androidBot.scrollElement(xpath, direction);

await androidBot.existsElement(xpath);

await androidBot.isSelectedElement(xpath);

文件传输

await androidBot.pushFile("d:\\1.png", "/storage/emulated/0/1.png");

await androidBot.pullFile("/storage/emulated/0/1.png", "d:\\1.png");

Intent跳转

await androidBot.openUri("alipayqr://platformapi/startapp?saId=10000007");

await androidBot.callPhone("10086");

await androidBot.sendMsg("10086", "123")

获取包名/窗口

await androidBot.getActivity();

await androidBot.getPackage();

安卓剪切板

await androidBot.setClipboardText(text);

await androidBot.getClipboardText();

python 使用方法说明

pip install AiBot.py

from AiBot import AiBotMain

class CustomScript(AiBotMain):

    wait_timeout = 3

    interval_timeout = 0.1

    def script_main(self):

        self.save_screenshot("xxx.png")

        self.get_color((100, 100))

        self.find_image("xxx.png")

        self.click((100, 100))

        self.swipe((100, 100), (200, 200), 3)

教程中仅演示部分 api,更多 api 请自行查阅 Nodejs文档。

from AiBot import AiBotMain

class CustomScript(AiBotMain):

    def script_main(self):
        self.show_toast("启动成功")

if __name__ == '__main__':

    CustomScript.execute(16678)

AndoridBot开源协议

Aibote安卓云端自动化框架,采用云端服务模式构建。由安卓手机客户端主动连接服务器/电脑服务端程序,
服务端应采用多线程TCP协议和多个安卓设备通信。构架模式决定了自动化代码部署在云端,能有效防止脚本被第三方恶意破解。
结合Aibote远程投屏技术,可直接连接远程用户设备做自动化机器人编写,完美解决远程自动化测试需求。独家图色定位算法,
50毫秒以内的速度遍历查找2340*1080分辨率的设备。为了让更多人体验到我们产品,我们决议在此公布框架协议,
希望有更多开发者能完善并封装成各种计算机语言。

发送命令协议格式:len/len/len...\ndata

接收命令协议格式:len/data

协议示例:

sendData("saveScreenshot", "/storage/emulated/0/Android/data/com.aibot.client/files/1.png", 80, 150, 30, 30, 0, 127, 255);

发送数据包:14/61/2/3/2/2/1/3/3\nsaveScreenshot/storage/emulated/0/Android/data/com.aibot.client/files/1.png8015030300127255
返回数据包:"false"或者 "true"

sendData("getColor", 100, 200);

数据包:8/3/3\ngetColor100200
返回数据包:"false"或者 "true"

sendData("findImage", "/storage/emulated/0/Android/data/com.aibot.client/files/1.png", 0, 0, 0, 0, 0.95, 0, 0, 0);

数据包:9/61/1/1/1/1/4/1/1/1\nfindImage/storage/emulated/0/Android/data/com.aibot.client/files/1.png00000.95000
返回数据包:成功"x|y" 失败"-1.0|-1.0"

sendData("matchTemplate", "/storage/emulated/0/Android/data/com.aibot.client/files/1.png", 0, 0, 0, 0, 0.95, 0, 0, 1);

数据包:13/61/1/1/1/1/4/1/1/1\nmatchTemplate/storage/emulated/0/Android/data/com.aibot.client/files/1.png00000.95001
返回数据包:单坐标点成功"x|y"  多坐标点成功 "x1|y1/x2|y2..."  失败"-1.0|-1.0"

sendData("findAnimation", 100, 0, 0, 0, 0);

数据包:13/3/0/0/0/0\nfindAnimation1000000
返回数据包:单坐标点成功"x|y"  多坐标点成功 "x1|y1/x2|y2..."  失败"-1.0|-1.0"

sendData("findColor", "#e8f2f8", "1020#e7f0f7", 0, 0, 0, 0, 1);

数据包:9/7/11/1/1/1/1/1\nfindColor#e8f2f81020#e7f0f700001
返回数据包:成功"x|y" 失败"-1.0|-1.0"

sendData("compareColor", 100, 200, "#e8f2f8", "1020#e7f0f7", 0, 0, 0, 0, 1);

数据包:12/3/3/7/11/1/1/1/1/1\ncompareColor100200#e8f2f81020#e7f0f700001
返回数据包:"false"或者 "true"

sendData("click", 200, 500);

数据包:5/3/3\nclick200500
返回数据包:"false"或者 "true"

sendData("doubleClick", 200, 500);

数据包:11/3/3\ndoubleClick200500
返回数据包:"false"或者 "true"

sendData("longClick", 10, 20, 3000);

数据包:9/2/2/4\nlongClick10203000
返回数据包:"false"或者 "true"

sendData("swipe", 10, 10, 200, 200, 1000);

数据包:5/2/2/3/3/4\nswipe10102002001000
返回数据包:"false"或者 "true"

sendData("dispatchGesture", "1000/1558\n100/100\n799/800\n234/89", 3000);

数据包:15/35/4\ndispatchGesture1000/1558\n100/100\n799/800\n234/893000
返回数据包:"false"或者 "true"

sendData("sendKeys", "aibot");

数据包:8/5\nsendKeysaibot
返回数据包:"false"或者 "true"

sendData("back");

数据包:4\nback
返回数据包:"false"或者 "true"

sendData("home");

数据包:4\nhome
返回数据包:"false"或者 "true"

sendData("recents");

数据包:7\nrecents
返回数据包:"false"或者 "true"

sendData("sendVk", 187);

数据包:6/3\nsendVk187
返回数据包:"false"或者 "true"

sendData("startApp", "QQ");

数据包:8/2\nstartAppQQ
返回数据包:"false"或者 "true"

sendData("getWindowSize");
数据包:13\ngetWindowSize
返回数据包:"width|height"

sendData("getImageSize", "/storage/emulated/0/Android/data/com.aibot.client/files/1.png");
数据包:12/61\nsaveScreenshot/storage/emulated/0/Android/data/com.aibot.client/files/1.png
返回数据包:"width|height"

sendData("getAndroidId");
数据包:12\ngetAndroidId
返回数据包:"1f73c8f2f3b2f108"

sendData("ocr", "127.0.0.1", 0, 0, 0, 0, 1.0);
数据包:3/9/1/1/1/1\3\nocr127.0.0.100001.0
返回数据包:[[[7.0, 18.0], [61.0, 18.0], [61.0, 38.0], [7.0, 38.0]], ('办公自动化', 0.8806074261665344)][[[4.0, 94.0], [49.0, 94.0], [49.0, 118.0], [4.0, 118.0]], ('rpa', 0.978314220905304)]

sendData("urlRequest", "http://www.baidu.com", "GET", "null", "null");
数据包:10/20/3/4/4\nurlRequesthttp://www.baidu.comGETnullnull
返回数据包:返回请求数据内容

sendData("showToast", "rpa");
数据包:9/2\nshowToastrpa
返回数据包:"false"或者 "true"

sendData("getCaptcha", "/storage/emulated/0/Android/data/com.aibot.client/files/1.png", "username", "password", "123456", "1004", "0");
数据包:10/61/8/8/6/4/1\n/storage/emulated/0/Android/data/com.aibot.client/files/1.pngusernamepassword12345610040
返回数据包:"{"err_no":0,"err_str":"OK","pic_id":"9160109360600112681","pic_str":"8vka","md5":"35d5c7f6f53223fbdc5b72783db0c2c0"}"

sendData("errorCaptcha", "username", "password", "123456", "9160109360600112681");
数据包:12/8/8/6/19\nerrorCaptchausernamepassword1234569160109360600112681
返回数据包:"{"err_no":0,"err_str":"OK"}"

sendData("scoreCaptcha", "username", "password");
数据包:12/8/8\nscoreCaptchausernamepassword
返回数据包:"{"err_no":0,"err_str":"OK","tifen":821690,"tifen_lock":0}"

sendData("getElementRect", "com.aibot.client/com.aibot.client:id=inputServer");
数据包:14/48\ngetElementRectcom.aibot.client/com.aibot.client:id=inputServer
返回数据包:"239|628|989|764"

sendData("getElementDescription", "com.aibot.client/com.aibot.client:id=inputServer");
数据包:21/48\ngetElementDescriptioncom.aibot.client/com.aibot.client:id=inputServer
返回数据包:"192.168.2.7"

sendData("getElementText", "com.aibot.client/com.aibot.client:id=inputServer");
数据包:14/48\ngetElementTextcom.aibot.client/com.aibot.client:id=inputServer
返回数据包:"192.168.2.7"

sendData("setElementText", "com.aibot.client/com.aibot.client:id=inputServer", "rpa");
数据包:14/48/3\nsetElementTextcom.aibot.client/com.aibot.client:id=inputServerrpa
返回数据包:"false"或者 "true"

sendData("clickElement", "com.aibot.client/com.aibot.client:id=inputServer");
数据包:12/48\nclickElementcom.aibot.client/com.aibot.client:id=inputServer
返回数据包:"false"或者 "true"

sendData("scrollElement", "com.aibot.client/com.aibot.client:id=inputServer", 0);
数据包:13/48/1\nclickElementcom.aibot.client/com.aibot.client:id=inputServer0
返回数据包:"false"或者 "true"

sendData("existsElement", "com.aibot.client/com.aibot.client:id=inputServer");
数据包:13/48\nexistsElementcom.aibot.client/com.aibot.client:id=inputServer
返回数据包:"false"或者 "true"

sendData("isSelectedElement", "com.aibot.client/com.aibot.client:id=inputServer");
数据包:17/48\nisSelectedElementcom.aibot.client/com.aibot.client:id=inputServer
返回数据包:"false"或者 "true"

sendData("pushFile", "/storage/emulated/0/1.png", fileData);

数据包:8/25/655423\npushFile/storage/emulated/0/1.pngfileData
返回数据包:"false"或者 "true"

sendData("pullFile", "/storage/emulated/0/1.png");
数据包:8/25\npullFile/storage/emulated/0/1.png
返回数据包:文件字节数据

sendData("openUri", "alipayqr://platformapi/startapp?saId=10000007");
数据包:7/45\nopenUrialipayqr://platformapi/startapp?saId=10000007
返回数据包:"false"或者 "true"

sendData("callPhone", "10086");
数据包:9/5\ncallPhone10086
返回数据包:"false"或者 "true"

sendData("sendMsg", "10086", "123");
数据包:7/5/3\nsendMsg10086123
返回数据包:"false"或者 "true"

sendData("getActivity");
数据包:11\ngetActivity
返回数据包:".MainActivity"

sendData("getPackage");
数据包:10\ngetPackage
返回数据包:"com.aibot.client"

sendData("setClipboardText", "aibote");
数据包:16/6\nsetClipboardTextaibote
返回数据包:"false"或者 "true"

sendData("getClipboardText");
数据包:16\ngetClipboardText
返回数据包:"aibote"

主函数示例

const {BrowserBot, By, Key} = require('BrowserBot');

async function main(){

    let browserBot = await BrowserBot.build("chrome", "103.0.5060.134");

    await browserBot.setImplicitTimeout(5000);

    await browserBot.openUrl("https://www.baidu.com");
    await browserBot.sendKeys('//*[@id="kw"]', "aibote", Key.ENTER);
    await browserBot.sleep(5000);

    await browserBot.quit();
}

main();

构建BrowserBot

await BrowserBot.build(browserName, version, browserPath = null, startArgs = [], switchArgs =[]);

退出浏览器

await browserBot.quit();

等待超时

await browserBot.sleep(3000);

await browserBot.setImplicitTimeout(5000);

await browserBot.wait(condition, timeout = null, message = null, pollTimeout = null);

页面和导航

await browserBot.openUrl('http://www.ai-bot.net');

await browserBot.to('https://www.baidu.com');

await browserBot.back();

await browserBot.forward();

await browserBot.refresh();

await browserBot.getCurrentUrl();

await browserBot.getCurrenTitle();

await browserBot.getPageSource();

元素操作

await browserBot.clickElement(xpath);

await browserBot.sendKeys(xpath, text, key);

await browserBot.clearElement(xpath);

await browserBot.submitElement(xpath);

await browserBot.getElementText(xpath);

await browserBot.getElementAttribute(xpath, attributeName);

await browserBot.getElementRect(xpath);

await browserBot.isDisplayed(xpath);

await browserBot.isEnabled(xpath);

await browserBot.isSelected(xpath);

IFrame

await browserBot.switchIframeByElement(xpath);

await browserBot.switchIframeByIndex(index);

await browserBot.switchParentFrame();

await browserBot.switchDefaultFrame();

窗口操作

await browserBot.getWindowHandle();

await browserBot.getAllWindowHandles();

await browserBot.switchWindow(nameOrHandle);

await browserBot.switchNewWindow(typeHint = 'tab');

await browserBot.closeWindow();

await browserBot.getWindowRect();

await browserBot.setWindowRect(rect);

await browserBot.getWindowSize();

await browserBot.setWindowSize(size);

await browserBot.getWindowPos();

await browserBot.setWindowPos(point);

await browserBot.maximize();

await browserBot.minimize();

鼠标键盘动作

await browserBot.sendKeysByAction(varArgs);

await browserBot.leftClick(xpath);

await browserBot.rightClick(xpath);

await browserBot.doubleClick(xpath);

await browserBot.dragAndDrop(fromXpath, toLocation);

await browserBot.keyDown(key);

await browserBot.keyUp(key);

await browserBot.move(toLocation);

await browserBot.pause(duration);

await browserBot.press(action);

await browserBot.release(action);

await browserBot.clear();

await browserBot.getActionObject();

await browserBot.takeScreenshot(xpath = null, scroll = false);

alert/prompt弹窗

await browserBot.getAlertObject();

await browserBot.acceptAlert(alertObject);

await browserBot.dismissAlert(alertObject);

await browserBot.sendKeysAlert(alertObject, text);

await browserBot.getTextAlert(alertObject);

注入JavaScript

await browserBot.executeScript(script);

await browserBot.executeAsyncScript(script);

cookie操作

await browserBot.getCookie(name);

await browserBot.getCookies();

await browserBot.addCookie(spec);

await browserBot.deleteCookie(name);

await browserBot.deleteCookies();

浏览器驱动

let bDriver = await browserBot.getBrowserDriver();

await bDriver.quit();

await bDriver.manage().setTimeouts({implicit: 5000});

await bDriver.findElement(locator: Locator);

    let element = await bDriver.findElement(By.id("kw"));

await bDriver.findElements(locator: Locator);

await element.click();

await element.sendKeys("Aibote");

    await element.sendKeys("Aibote", Key.ENTER);

await element.clear();

await element.submit();

await element.getText();

await element.getAttribute("attributeName");

await element.getRect();

await element.isDisplayed();

await element.isEnabled();

await element.isSelected();

await element.findElement(locator);

await element.findElements(locator);

await bDriver.switchTo().frame(iframe);

await bDriver.switchTo().frame(1);

await bDriver.switchTo().parentFrame();

await bDriver.switchTo().defaultContent();

await bDriver.actions().sendKeys("Aibote").perform();

await bDriver.actions().click(element).perform();

await bDriver.actions().contextClick(element).perform();

await bDriver.actions().doubleClick(element).perform();

await bDriver.actions().dragAndDrop(element, destLocation).perform();

await bDriver.actions().keyDown(Key.ENTER).perform();

await bDriver.actions().keyUp(Key.ENTER).perform();

await bDriver.actions().move(options).perform();

await bDriver.actions().pause(3000).perform();

await bDriver.actions().press(0).perform();

await bDriver.actions().release(0).perform();

await bDriver.actions().clear().perform();

await bDriver.get('http://www.ai-bot.net/');

await bDriver.navigate().back();

await bDriver.navigate().forward();

await bDriver.navigate().refresh();

await bDriver.navigate().to(url);

await bDriver.getCurrentUrl();

await bDriver.getTitle();

await bDriver.getPageSource();

await bDriver.getWindowHandle();

await bDriver.getAllWindowHandles();

await bDriver.switchTo().window(handle);

await bDriver.switchTo().newWindow('tab');

await bDriver.switchTo().newWindow('window');

await bDriver.close();

await bDriver.manage().window().getRect();

await bDriver.manage().window().setRect({x: 0, y: 0, width:100, height:100});

await bDriver.manage().window().maximize();

await bDriver.manage().window().minimize();

await element.takeScreenshot(scroll = false);

await bDriver.takeScreenshot();

await bDriver.wait(until.alertIsPresent());

let alert = await bDriver.switchTo().alert();

await alert.accept();

await alert.dismiss();

await alert.sendKeys("Aibote是一款优秀的RPA框架");

await alert.getText();

await bDriver.executeScript(script);

await bDriver.executeScript(function(){return 'Aibote'});
await bDriver.executeScript("alert('Aibote是一款非常优秀的RPA')");

await bDriver.executeAsyncScript(script);

await bDriver.manage().getCookie("name")

await bDriver.manage().getCookies()

await bDriver.manage().addCookie(spec);

        await bDriver.manage().addCookie({name: 'foo', value: 'bar'});

await bDriver.manage().deleteCookie("name");

await bDriver.manage().deleteAllCookies()

主函数示例

const {WindowsBot} = require('WindowsBot');

async function mian(){

    let windowsBot = await WindowsBot.build(19999);
    let hwnd = await windowsBot.findWindow(null, "运行");
    let words = await windowsBot.getWords(hwnd, "ocr.ai-bot.net");
    console.log(words);
}

mian();

构建WindowsBot

await WindowsBot.build(port = 19999);

等待超时

await windowsBot.sleep(3000);

await windowsBot.setImplicitTimeout(waitMs, intervalMs = 5);

查找句柄

await windowsBot.findWindow(className, windowNmae);

await windowsBot.findWindows(className, windowNmae);

await windowsBot.findSubWindow(curHwnd, className, windowNmae);

await windowsBot.findParentWindow(curHwnd);

显示/隐藏窗口

await windowsBot.showWindow(hwnd, isShow);

鼠标键盘

await windowsBot.moveMouse(hwnd, x, y, mode = false);

await windowsBot.rollMouse(hwnd, x, y, dwData, mode = false);

await windowsBot.clickMouse(hwnd, x, y, msg, mode = false);

await windowsBot.sendKeys(text);

await windowsBot.sendVk(bVk, msg);

图色操作

await windowsBot.saveScreenshot(hwnd, savePath, options = {});

await windowsBot.getColor(hwnd, x, y);

await windowsBot.findImage(hwnd, imagePath, options = {});

await windowsBot.findAnimation(hwnd, frameRate, options = {});

await windowsBot.findColor(hwnd, mainColor, options = {});

await windowsBot.compareColor(hwnd, mainX, mainY, mainColor, options = {});

OCR系统

await windowsBot.findWords(hwnd, ocrServer, words, options = {})

await windowsBot.getWords(hwnd, ocrServer, options = {})

元素操作

await windowsBot.getElementName(hwnd, xpath);

await windowsBot.getElementValue(hwnd, xpath);

await windowsBot.getElementRect(hwnd, xpath);

await windowsBot.getElementWindow(hwnd, xpath);

await windowsBot.clickElement(hwnd, xpath, msg);

await windowsBot.setElementFocus(hwnd, xpath);

await windowsBot.setElementValue(hwnd, xpath, value);

await windowsBot.setElementScroll(hwnd, xpath, horizontalPercent, verticalPercent);

await windowsBot.closeWindow(hwnd, xpath);

await windowsBot.setWindowState(hwnd, xpath, state);

系统剪切板

await windowsBot.setClipboardText(text);

await windowsBot.getClipboardText();

启动进程

await windowsBot.startProcess(commandLine, showWindow = true, isWait = false);

指定url下载文件

await windowsBot.downloadFile(url, filePath, isWait);

Excel文档

await windowsBot.openExcel(excelPath);

await windowsBot.openExcelSheet(excelObject, sheetName);

await windowsBot.saveExcel(excelObject);

await windowsBot.writeExcelNum(sheetObject, row, col, value);

await windowsBot.writeExcelStr(sheetObject, row, col, strValue);

await windowsBot.readExcelNum(sheetObject, row, col);

await windowsBot.readExcelStr(sheetObject, row, col);

验证码系统

await windowsBot.getCaptcha(filePath, username, password, softId, codeType, lenMin = 0);

await windowsBot.errorCaptcha(username, password, softId, picId);

await windowsBot.scoreCaptcha(username, password);

WindowsBot开源协议

Aibote Windows自动化框架,由node.js客户端连接 WindowsDriver.exe服务端程序,采用TCP协议传输命令。
全国领先xpath元素定位算法,一键拾取控件元素、图色 坐标等属性。与安卓端代码统一书写格式,降低用户学习成本。
独家图色定位算法,50毫秒以内的速度遍历查找1920*1080分辨率的设备。为了让更多人体验到我们产品,
我们决议在此公布框架协议,希望有更多开发者能完善并封装成各种计算机语言。

发送命令协议格式:len/len/len...\ndata

接收命令协议格式:len/data

协议示例:

sendData("findWindow", "className", "windowNmae");

发送数据包:10/9/10\nfindWindowclassNamewindowNmae
返回数据包:成功"65862",失败 "null"

sendData("findWindows", "className", "windowNmae");

发送数据包:11/9/10\nfindWindowsclassNamewindowNmae
返回数据包:成功返回多个句柄"65862|65863|65864",失败 "null"

sendData("findSubWindow", 65862, "className", "windowNmae");

发送数据包:13/5/9/10\nfindSubWindow65862classNamewindowNmae
返回数据包:成功"460538",失败 "null"

sendData("findParentWindow", 460538);

发送数据包:16/6/\nfindParentWindow460538
返回数据包:成功"65862",失败 "null"

sendData("showWindow", 65862, true);

发送数据包:10/5/4\nshowWindow65862true
返回数据包:"false"或者 "true"

sendData("moveMouse", 65862, 100, 100, false);

发送数据包:9/5/3/3/5\nmoveMouse65862100100false
返回数据包:"true"

sendData("rollMouse", 65862, 100, 100, 10, false);

发送数据包:9/5/3/3/2/5\nrollMouse658621001002false
返回数据包:"true"

sendData("clickMouse", 65862, 100, 100, 1, false);

发送数据包:9/5/3/3/1/5\nclickMouse658621001001false
返回数据包:"true"

sendData("sendKeys", "rpa");

发送数据包:8/3\nsendKeysrpa
返回数据包:"true"

sendData("sendVk", 13, 1);

发送数据包:6/2/1\nsendVk131
返回数据包:"true"

sendData("saveScreenshot", 65862, "d:/1.png", 80, 150, 30, 30, 0, 127, 255);

发送数据包:14/5/8/2/3/2/2/1/3/3\nsaveScreenshot65862d:/1.png8015030300127255
返回数据包:"false"或者 "true"

sendData("getColor", 65862, 100, 200);

数据包:8/5/3/3\ngetColor65862100200
返回数据包:"false"或者 "true"

sendData("findImage", 65862, "d:/1.png", 0, 0, 0, 0, 0.95, 0, 0, 1);

数据包:9/5/8/1/1/1/1/4/1/1/1\nfindImage65862d:/1.png00000.95001
返回数据包:单坐标点成功"x|y"  多坐标点成功 "x1|y1/x2|y2..."  失败"-1.0|-1.0"

sendData("findAnimation", 65862, 100, 0, 0, 0, 0);

数据包:13/5/3/0/0/0/0\nfindAnimation658621000000
返回数据包:单坐标点成功"x|y"  多坐标点成功 "x1|y1/x2|y2..."  失败"-1.0|-1.0"

sendData("findColor", 65862, "#e8f2f8", "1020#e7f0f7", 0, 0, 0, 0, 1);

数据包:9/5/7/11/1/1/1/1/1\nfindColor65862#e8f2f81020#e7f0f700001
返回数据包:成功"x|y" 失败"-1.0|-1.0"

sendData("compareColor", 65862, 100, 200, "#e8f2f8", "1020#e7f0f7", 0, 0, 0, 0, 1);

数据包:12/5/3/3/7/11/1/1/1/1/1\ncompareColor65862100200#e8f2f81020#e7f0f700001
返回数据包:"false"或者 "true"

sendData("ocr", 65862, "127.0.0.1", 0, 0, 0, 0, 1.0);
数据包:3/5/9/1/1/1/1\3\nocr65862127.0.0.100001.0
返回数据包:[[[7.0, 18.0], [61.0, 18.0], [61.0, 38.0], [7.0, 38.0]], ('办公自动化', 0.8806074261665344)][[[4.0, 94.0], [49.0, 94.0], [49.0, 118.0], [4.0, 118.0]], ('rpa', 0.978314220905304)]

sendData("getElementName", 65862, "Window/Text");
数据包:14/5/11\ngetElementName65862Window/Text
返回数据包:"aibote is pure code RPA"

sendData("getElementValue", 65862, "Window/Edit");
数据包:15/5/11\ngetElementValue65862Window/Edit
返回数据包:"aibote RPA"

sendData("getElementRect", 65862, "Window/Button");
数据包:14/5/13\ngetElementRect65862Window/Button
返回数据包:"239|628|989|764"

sendData("getElementWindow", 65862, "Window/Button");
数据包:16/5/13\ngetElementWindow65862Window/Button
返回数据包:"460538"

sendData("clickElement", 65862, "Window/Button", 1);
数据包:12/5/13/1\nclickElement65862Window/Button1
返回数据包:"false"或者 "true"

sendData("setElementFocus", 65862, "Window/Button");
数据包:15/5/13\nsetElementFocus65862Window/Button
返回数据包:"false"或者 "true"

sendData("setElementValue", 65862, "Window/Button", "rpa");
数据包:15/5/13/3\nsetElementValue65862Window/Buttonrpa
返回数据包:"false"或者 "true"

sendData("setElementScroll", 65862, "Window", -1, 0.1);
数据包:16/5/6/2/3\nsetElementScroll65862Window-10.1
返回数据包:"false"或者 "true"

sendData("closeWindow", 65862, "Window");
数据包:11/5/6\ncloseWindow65862Window
返回数据包:"false"或者 "true"

sendData("setWindowState", 65862, "Window", 2);
数据包:14/5/6/1\nsetWindowState65862Window2
返回数据包:"false"或者 "true"

sendData("setClipboardText", "rpa");
数据包:16/3\nsetClipboardTextrpa
返回数据包:"false"或者 "true"

sendData("getClipboardText");
数据包:16\ngetClipboardText
返回数据包:"rpa"

sendData("startProcess", "cmd", true, false);
数据包:12/3/4/5\nstartProcesscmdtruefalse
返回数据包:"false"或者 "true"

sendData("downloadFile", "http://www.gogo.com/rpa.rar", "d:/rpa.rar", true);
数据包:12/27/10/4\ndownloadFilehttp://www.gogo.com/rpa.rard:/rpa.rartrue
返回数据包:"true"

sendData("openExcel", "D:/rpa.xlsx");
数据包:9/11\nopenExcelD:/rpa.xlsx
返回数据包:"null"或者 {"book":"088173SDFU13","path":"D:/rpa.xlsx"}

sendData("openExcelSheet", "088173SDFU13", "D:/rpa.xlsx", "sheet1");
数据包:14/12/11/6\nopenExcelSheet088173SDFU13D:/rpa.xlsxsheet1
返回数据包:"null"或者 "A123HHI123F132"

sendData("saveExcel", "088173SDFU13", "D:/rpa.xlsx");
数据包:9/12/11\nsaveExcel088173SDFU13D:/rpa.xlsx
返回数据包:"false"或者 "true"

sendData("writeExcelNum", "A123HHI123F132", 0, 0, 123);
数据包:13/14/1/1/3\nwriteExcelNumA123HHI123F13200123
返回数据包:"false"或者 "true"

sendData("writeExcelStr", "A123HHI123F132", 0, 0, "rpa");
数据包:13/14/1/1/3\nwriteExcelStrA123HHI123F13200rpa
返回数据包:"false"或者 "true"

sendData("readExcelNum", "A123HHI123F132", 0, 0);
数据包:12/14/1/1\nreadExcelNumA123HHI123F13200
返回数据包:123

sendData("readExcelStr", "A123HHI123F132", 0, 0);
数据包:12/14/1/1\nreadExcelStrA123HHI123F13200
返回数据包:"rpa"
AiboteScriptUI底层基于chromium内核,可使用html、ccs等语言开发界面。另外我们底层添加四个函数用于实现脚本执行和传参。
启动AiboteScriptUI.exe程序会自动附加当前目录下index.html文件,界面开发工作主要在这个文件

界面宽高

SetAiboteSize(width, height);

启动脚本

StartScript("../testAibote.js", true);

停止脚本

StopScript(processId);

输出日志

PrintAiboteLog();

Android 工具位置,Aibote/Aibote.exe->菜单项->脚本工具
Windows 工具位置,Aibote/WindowsTool.exe

Android 元素拾取工具,需要在手机端,勾选连接工具端选项

Windows 元素拾取工具,按下CTRL键,暂停拾取。如拾取菜单项崩溃,可以先拾取窗口最大化最小框再去操作菜单项

使用方法:
1、点击按钮 单击手机投屏/windows 窗口,拾取元素和颜色信息。

2、点击按钮 在手机投屏/windows 窗口滑动矩形大小,拾取元素和图片信息。截图前输入图片名称。Android端,图片保存在手机/storage/emulated/0/Android/data/com.aibot.client/files/
(根目录:/storage/emulated/0/)。Windows端,图片保存在指定路径目录,如果图片名称不包含路径,则默认保存在Aibote/Picture/windows

3、二值化阈值和最大值在0-255之间,阈值和最大值都为255时灰度化处理

4、BINARY算法,当前点值大于阈值thresh时,取最大值maxva,否则设置为0

5、BINARY_INV算法,当前点值大于阈值thresh时,设置为0,否则设置为最大值maxva

6、TOZERO算法,当前点值大于阈值thresh时,不改变,否则设置为0

7、TOZERO_INV算法,当前点值大于阈值thresh时,设置为0,否则不改变

8、TRUNC算法,当前点值大于阈值thresh时,设置为阈值thresh,否则不改变

9、ADAPTIVE_THRESH_MEAN_C算法,自适应阈值

10、ADAPTIVE_THRESH_GAUSSIAN_C算法,自适应阈值

Original: https://blog.csdn.net/chengzhenabc/article/details/126880573
Author: chengzhenabc
Title: AiBote 2022 新研发的自动化框架,支持 Android 和 Windows 系统。速度非常快

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/730495/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

  • Java开发学习(三十九)—-SpringBoot整合mybatis

    一、回顾Spring整合Mybatis Spring整合 Mybatis需要定义很多配置类 SpringConfig配置类 导入 JdbcConfig配置类 导入 MybatisC…

    Python 2023年10月16日
    048
  • 【Python爬虫】招聘网站实战合集第一弹:爬取前程无忧

    休想。我这就把代码贴出来。这一过程是明确的。我还标记了这些评论。 [En] Forget it. I’ll just post the code. The proces…

    Python 2023年5月25日
    0140
  • LeetCode题解 贪心(二):122 买卖股票的最佳时机II;55 跳跃游戏;45 跳跃游戏II;1005 K次取反后最大化的数组和

    给你一个整数数组 prices ,其中 prices[i] 表示某支股票第 i 天的价格。在每一天,你可以决定是否购买和/或出售股票。你在任何时候最多只能持有一股股票。你也可以先购…

    Python 2023年11月7日
    052
  • Numpy生成数组

    虽然NumPy提供了数值数据操作的计算基础,但大多都把pandas作为统计、分析的基石,尤其是针对表格数据。pandas提供了更多的针对特定场景的函数功能,例如时间序列操作等Num…

    Python 2023年8月24日
    067
  • 使用 ChatGPT 赚钱的 4 种简单方法

    啊哦~你想找的内容离你而去了哦 内容不存在,可能为如下原因导致: ① 内容还在审核中 ② 内容以前存在,但是由于不符合新 的规定而被删除 ③ 内容地址错误 ④ 作者删除了内容。 可…

    Python 2023年11月4日
    033
  • WinUI(WASDK)项目实践——优雅的开发上位机应用(新)

    摘要 这就是一个记录自己进行WinUI项目实践的博客,项目开源地址如下,觉得有帮助的可以去看看,因为项目都开源了,所以保姆级的讲解肯定不如直接看代码来的实在了。 电子脑壳项目地址 …

    Python 2023年10月23日
    046
  • Pytest(3)fixture的使用

    Pytest的fixture相对于传统的xUnit的setup/teardown函数做了显著的改进: 命名方式灵活,不局限于 setup 和teardown 这几个命名 conft…

    Python 2023年9月14日
    059
  • 第五章 数据聚合与分组运算

    一、分组与聚合的原理 分组是指使用特定的条件将原数据划分为多个组,聚合在这里指的是,对每个分组中的数据执行某些操作,最后将计算的结果进行整合。 二、通过groupby()方法将数据…

    Python 2023年8月21日
    057
  • 豆瓣高分电影爬取

    仅供学习交流研究参考 1. 爬取基本步骤: 发送请求,确定url地址,然后发送请求 获取请求,获取服务器返回的响应数据 解析数据,获取我们想要的数据 保存数据 多页数据爬取 2. …

    Python 2023年6月15日
    060
  • 1┃音视频直播系统之浏览器中通过WebRTC访问摄像头

    一、WebRTC的由来 对于前端开发小伙伴而言,如果用 JavaScript 做音视频处理 在以前是不可想象的,因为首先就要考虑浏览器的性能是否跟得上音视频的采集 但是 Googl…

    Python 2023年6月10日
    076
  • Python——线程

    一、前言 1、概述 线程 在一个进程的内部 要同时干很多件事 就需要同时执行多个子任务 我们把进程内的这些子任务称为 线程 线程通常叫轻型的进程 线程是共享内存空间的并发执行的多任…

    Python 2023年6月10日
    064
  • Python写了个疫情信息快速查看工具

    用Python写一个疫情查看工具 序言 你需要准备 * – PyQt5 PyQtWebEngine 预览 * – 启动 引擎切换 主要代码 最后 序言 自从…

    Python 2023年10月7日
    027
  • 【python】Flask之session使用

    一、session机制 由于http协议是一个无状态的协议,但网站基本上有登录使用的功能,这要求有状态管理,而session机制实现的就是这个功能 session基于cookie实…

    Python 2023年8月9日
    063
  • Python基于PC版微信实现机器人

    闲着没事总想搞点事情,这不是web版的微信有专门的实时收发消息api,可以用Python直接调用,但是现在基本上登录不了web版微信,所以就用不了了。 但这不是还有windows版…

    Python 2023年11月1日
    056
  • 利用Django搭建后端服务

    文章目录 利用Django搭建后端服务 * 一、新建Django新项目 二、书写一个简单的接口 三、接入MySQL数据库 – 3.1 创建对象模块 3.2 填加数据(i…

    Python 2023年8月6日
    055
  • pytest的fixture

    fixture 的作用和 setup / teardown 功能类似,都是在case执行前和执行后自动执行的,但是他更加灵活 1、setup 和 teardown 是拿不到返回值的…

    Python 2023年9月10日
    036
亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球