├── README.md ├── emoji ├── h5_ua.aardio ├── stringex.aardio ├── style.aardio ├── zero_width.aardio └── 代码统计.aardio /README.md: -------------------------------------------------------------------------------- 1 | # awesome-aardio 2 | 3 | ## tools 4 | 5 | [统计工程文件和代码行数](https://github.com/theseazhang/awesome-aardio/blob/main/%E4%BB%A3%E7%A0%81%E7%BB%9F%E8%AE%A1.aardio) 作者:[theseazhang](https://github.com/theseazhang) 6 | 7 | ## lib 8 | 9 | ### 字符串/文本 10 | 11 | [stringex - 常用文本扩展库](https://github.com/theseazhang/awesome-aardio/blob/main/stringex.aardio) 作者:[theseazhang](https://github.com/theseazhang) 12 | 13 | [emoji - 表情字符识别、删除](https://github.com/theseazhang/awesome-aardio/blob/main/emoji) 作者:[theseazhang](https://github.com/theseazhang) 14 | 15 | [zero_width - 零宽字符加解密的aardio实现](https://github.com/theseazhang/awesome-aardio/blob/main/zero_width.aardio) 作者:[theseazhang](https://github.com/theseazhang) 16 | 17 | 18 | 19 | ### 图形图像 20 | 21 | [opencv_aardio - aardio的opencv库 ](https://github.com/xuncv/opencv_aardio#opencv_aardio) 作者:[xuncv](https://github.com/xuncv) 22 | 23 | ### 文档文件 24 | 25 | [PDFium_aardio - 使用aardio封装的PDFium库 ](https://github.com/xuncv/PDFium-aardio) 作者:[xuncv](https://github.com/xuncv) 26 | 27 | ## ui 28 | 29 | [腾讯tdesign风格plus按钮样式](https://github.com/theseazhang/awesome-aardio/blob/main/style.aardio) 作者:[theseazhang](https://github.com/theseazhang) 30 | 31 | ## code 32 | 33 | [wev.view远程调试切换UA示例](https://github.com/theseazhang/awesome-aardio/commit/3d7c6af8f9890c0553ac9c43b5701055a8735314) 作者:[theseazhang](https://github.com/theseazhang) 34 | 35 | ## exe 36 | 37 | [edge-TTS-record - 一个可以录制 Microsoft Edge 浏览器的语音合成(TTS)语音并输出为 .wav 音频的(windows平台)工具。 ](https://github.com/theseazhang/awesome-aardio/commit/3d7c6af8f9890c0553ac9c43b5701055a8735314) 作者:[LuckyHookin](https://github.com/LuckyHookin) 38 | 39 | [Gif123 - 极简 GIF 录屏工具,可快速复制 GIF 图像并粘贴到其他程序。](https://github.com/aardio/Gif123) 作者:[aardio](https://github.com/aardio) 40 | 41 | [keyclone - 一个aardio语言写的键盘同步器,用于wow多开同步。](https://github.com/theseazhang/keyclone) 作者:[theseazhang](https://github.com/theseazhang) 42 | 43 | -------------------------------------------------------------------------------- /emoji: -------------------------------------------------------------------------------- 1 | //emoji表情字符识别 2 | namespace emoji 3 | 4 | var emojiSet = { 5 | 0x23; 6 | 0x2a; 7 | {0x30, 0x39}; 8 | 0xa9; 9 | 0xae; 10 | 0x200d; 11 | 0x203c; 12 | 0x2049; 13 | 0x20e3; 14 | 0x2122; 15 | 0x2139; 16 | {0x2194, 0x2199}; 17 | {0x21a9, 0x21aa}; 18 | {0x231a, 0x231b}; 19 | 0x2328; 20 | 0x2388; 21 | 0x23cf; 22 | {0x23e9, 0x23f3}; 23 | {0x23f8, 0x23fa}; 24 | 0x24c2; 25 | {0x25aa, 0x25ab}; 26 | 0x25b6; 27 | 0x25c0; 28 | {0x25fb, 0x25fe}; 29 | {0x2600, 0x2605}; 30 | {0x2607, 0x2612}; 31 | {0x2614, 0x2685}; 32 | {0x2690, 0x2705}; 33 | {0x2708, 0x2712}; 34 | 0x2714; 35 | 0x2716; 36 | 0x271d; 37 | 0x2721; 38 | 0x2728; 39 | {0x2733, 0x2734}; 40 | 0x2744; 41 | 0x2747; 42 | 0x274c; 43 | 0x274e; 44 | {0x2753, 0x2755}; 45 | 0x2757; 46 | {0x2763, 0x2767}; 47 | {0x2795, 0x2797}; 48 | 0x27a1; 49 | 0x27b0; 50 | 0x27bf; 51 | {0x2934, 0x2935}; 52 | {0x2b05, 0x2b07}; 53 | {0x2b1b, 0x2b1c}; 54 | 0x2b50; 55 | 0x2b55; 56 | 0x3030; 57 | 0x303d; 58 | 0x3297; 59 | 0x3299; 60 | 0xfe0f; 61 | {0x1f000, 0x1f0ff}; 62 | {0x1f10d, 0x1f10f}; 63 | 0x1f12f; 64 | {0x1f16c, 0x1f171}; 65 | {0x1f17e, 0x1f17f}; 66 | 0x1f18e; 67 | {0x1f191, 0x1f19a}; 68 | {0x1f1ad, 0x1f1ff}; 69 | {0x1f201, 0x1f20f}; 70 | 0x1f21a; 71 | 0x1f22f; 72 | {0x1f232, 0x1f23a}; 73 | {0x1f23c, 0x1f23f}; 74 | {0x1f249, 0x1f53d}; 75 | {0x1f546, 0x1f64f}; 76 | {0x1f680, 0x1f6ff}; 77 | {0x1f774, 0x1f77f}; 78 | {0x1f7d5, 0x1f7ff}; 79 | {0x1f80c, 0x1f80f}; 80 | {0x1f848, 0x1f84f}; 81 | {0x1f85a, 0x1f85f}; 82 | {0x1f888, 0x1f88f}; 83 | {0x1f8ae, 0x1f8ff}; 84 | {0x1f90c, 0x1f93a}; 85 | {0x1f93c, 0x1f945}; 86 | {0x1f947, 0x1fffd}; 87 | {0xe0020, 0xe007f}; 88 | } 89 | 90 | emojiCheck = function(real){ 91 | for(i=1;#emojiSet;1){ 92 | if(type(emojiSet[i]) == type.number){ 93 | if(emojiSet[i] == real) return true; 94 | } 95 | else { 96 | var a, b = emojiSet[i][1], emojiSet[i][2] 97 | for(i=a;b;1){ 98 | if(real == i) return true; 99 | } 100 | } 101 | } 102 | } 103 | 104 | isContainEmoji = function(str){ 105 | var p = //\\u(\w{4,4}) 106 | var tab = {} 107 | var estr = ..string.escape(str) 108 | if(!estr) return; 109 | for m in ..string.gmatch(estr, p) { 110 | ..table.push(tab, "0x"+m) 111 | } 112 | if(!#tab) return; 113 | for(i=1;#tab;1){ 114 | var current = tonumber(tab[i]) 115 | var real = current 116 | if(current >= 0xD800 and current <= 0xDBFF and tab[[i+1]]){ 117 | var next = tonumber(tab[[i+1]]) 118 | real = 0x10000+(current - 0xD800)*0x400 + (next - 0xDC00) 119 | } 120 | if(emojiCheck(real)) return ..string.fromCharCode(tostring(real, 16)); 121 | 122 | } 123 | } 124 | 125 | replaceEmoji = function(str){ 126 | while(true){ 127 | var x = isContainEmoji(str) 128 | if(!x) return str; 129 | str = ..string.replace(str, x, "") 130 | } 131 | } 132 | 133 | /* 134 | import console 135 | var str = "💝💕💖💔💯👩🏽‍🤝‍👨🏾👩‍👩‍👧📱‍👧🐾🦉🦋⛵❄️🌈🏆🥇♦️" 136 | console.dumpJson(replaceEmoji(str)) 137 | 138 | console.askYesNo("按Y键继续,按N键取消") 139 | */ 140 | -------------------------------------------------------------------------------- /h5_ua.aardio: -------------------------------------------------------------------------------- 1 | import win.ui; 2 | /*DSG{{*/ 3 | var winform = win.form(text="自由切换UA访问";right=959;bottom=747) 4 | winform.add( 5 | button={cls="button";text="电脑浏览";left=28;top=7;right=123;bottom=32;z=2}; 6 | button2={cls="button";text="手机浏览";left=136;top=7;right=231;bottom=32;z=3}; 7 | custom={cls="custom";text="自定义控件";left=1;top=48;right=959;bottom=747;bgcolor=12639424;db=1;dl=1;dr=1;dt=1;z=1} 8 | ) 9 | /*}}*/ 10 | 11 | import console 12 | console.open() 13 | import web.view 14 | 15 | var wb = web.view(winform.custom,,0) 16 | 17 | wb.external = {} 18 | wb.go("https://www.baidu.com/") 19 | 20 | import web.socket.chrome 21 | var ws = wb.openRemoteDebugging() 22 | ws.Runtime.enable() 23 | ws.Network.enable() 24 | 25 | var pcua = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.82 Safari/537.36" 26 | var h5ua = "Mozilla/5.0 (iPhone; CPU iPhone OS 9_3 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13E233 Safari/601.1" 27 | 28 | 29 | winform.button.oncommand = function(id,event){ 30 | ws.Network.setUserAgentOverride(userAgent = pcua).end = function(res){ 31 | console.log(wb.eval("navigator.userAgent")) 32 | wb.go("https://www.baidu.com/") 33 | } 34 | } 35 | 36 | winform.button2.oncommand = function(id,event){ 37 | ws.Network.setUserAgentOverride(userAgent = h5ua).end = function(res){ 38 | console.log(wb.eval("navigator.userAgent")) 39 | wb.go("https://www.baidu.com/") 40 | } 41 | } 42 | 43 | winform.show(); 44 | win.loopMessage(); 45 | return winform; 46 | -------------------------------------------------------------------------------- /stringex.aardio: -------------------------------------------------------------------------------- 1 | //stringex 常用文本库 2 | namespace stringex 3 | 4 | token = function(len){ 5 | var a ="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" 6 | return ..string.random(len, a) 7 | } 8 | 9 | lenb = function(str){ 10 | str = ..string.toUnicode(str); 11 | var l = #str/2; 12 | for(i=1;l;1){ 13 | if(str[i] > 0x7F) l++; 14 | } 15 | return l; 16 | } 17 | 18 | left = function(str, n){ 19 | str = ..string.trim(str) 20 | var len = ..string.len(str) 21 | while(len > 0){ 22 | var x = ..string.left(str, len, true) 23 | if(lenb(x) <= n) return ..string.trim(x); 24 | len -- 25 | } 26 | } 27 | 28 | saveCsv = function(fileName, tab, cols){ 29 | ..string.save(fileName, '\xEF\xBB\xBF') 30 | if(cols) string.save(fileName, ..string.join(cols, ",")+'\r\n', true) 31 | for(i=1;#tab;1){ 32 | ..string.save(fileName, ..string.join(tab[i], ",")+'\r\n', true) 33 | } 34 | return fileName; 35 | } 36 | 37 | //最长公共子串 38 | lcs = function(s1, s2){ 39 | var n1, n2 = ..string.len(s1), ..string.len(s2) 40 | var m = {} //建立矩阵 41 | for(i=1;n1+1;1){ 42 | var t = {} 43 | for(j=1;n2+1;1){ 44 | ..table.push(t, 0) 45 | } 46 | ..table.push(m, t) 47 | } 48 | 49 | var mmax, p = 0, 0 50 | for(i=1;n1;1){ 51 | for(j=1;n2;1){ 52 | var a, b = ..string.charAt(s1, i), ..string.charAt(s2, j) 53 | if(a == b){ 54 | m[i+1][j+1] = m[i][j] + 1 55 | if(m[i+1][j+1] > mmax){ 56 | mmax = m[i+1][j+1] 57 | p = i 58 | } 59 | } 60 | } 61 | } 62 | return ..string.slice(s1, p-mmax+1, p, true); 63 | } 64 | 65 | 66 | /**intellisense(stringex) 67 | token() = 生成指定长度的随机字符串(0-9、大小写英文字母) 68 | lenb(.(str) = 返回字符串的字节计数,每个中文占2个字节 69 | left(.(str, n) = 自左向右截取字符串,以lenb字节长度计算 70 | saveCsv(.(fileName, cols, tab) = 快速保存CSV文件到指定路径,文件名必填,表头数组可选指定。表格内容是一个二维数组。 71 | lcs(.(s1, s2) = 输入2个字符串,返回其最长公共子串,未匹配则返回空字符串 72 | 73 | end intellisense**/ 74 | -------------------------------------------------------------------------------- /style.aardio: -------------------------------------------------------------------------------- 1 | namespace style 2 | 3 | btn = { 4 | background = { 5 | default = 0xFF1F4FD7; 6 | hover = 0xFF376DE7; 7 | active = 0xFF376DE7; 8 | disabled = 0xFFBED3FA; 9 | }; 10 | color = { 11 | default = 0xFFFFFFFF; 12 | disabled = 0xFFFFFFFF; 13 | }; 14 | } 15 | 16 | btnDanger = { 17 | background = { 18 | default = 0xFFDB4A56; 19 | hover = 0xFFEB6B76; 20 | active = 0xFFDB4A56; 21 | disabled = 0xFFBED3FA; 22 | }; 23 | color = { 24 | default = 0xFFFFFFFF; 25 | disabled = 0xFFFFFFFF; 26 | }; 27 | } 28 | 29 | btnSuccess = { 30 | background = { 31 | default = 0xFF00A870; 32 | hover = 0xFF5CC89E; 33 | active = 0xFF5CC89E; 34 | disabled = 0xFFBED3FA; 35 | }; 36 | color = { 37 | default = 0xFFFFFFFF; 38 | disabled = 0xFFFFFFFF; 39 | }; 40 | } 41 | -------------------------------------------------------------------------------- /zero_width.aardio: -------------------------------------------------------------------------------- 1 | //零宽加密 2 | import win.ui 3 | /*DSG{{*/ 4 | var winform = win.form(text="零宽加密";right=759;bottom=414) 5 | winform.add( 6 | button={cls="button";text="零宽字符加密";left=115;top=345;right=290;bottom=390;z=2}; 7 | button2={cls="button";text="零宽字符解密";left=430;top=345;right=605;bottom=390;z=3}; 8 | edit={cls="edit";left=5;top=10;right=755;bottom=325;autohscroll=false;bgcolor=16777215;db=1;dl=1;dr=1;dt=1;edge=1;multiline=1;vscroll=1;z=1} 9 | ) 10 | /*}}*/ 11 | 12 | import console 13 | 14 | textToBinary = function(str){ 15 | var bin = {} 16 | for(i=1;#str;1){ 17 | bin[i] = string.format("%08b", str[i]) 18 | } 19 | return string.join(bin, "-"); 20 | } 21 | 22 | textToZeroWidth = function(str){ 23 | if(!#str) return str; 24 | var t = string.split(textToBinary(str)) 25 | var d = {} 26 | var a, b, c = string.unescape('\u200C'), string.unescape('\u200D'), string.unescape('\u200E') 27 | for(i=1;#t;1){ 28 | select(t[i]) { 29 | case "1" d[i] = a 30 | case "0" d[i] = b 31 | case "-" d[i] = c 32 | } 33 | } 34 | return string.join(d, ""); 35 | } 36 | 37 | zeroWidthToText = function(str){ 38 | if(!#str) return; 39 | var s = string.escape(str) 40 | if(!s) return; 41 | 42 | if(string.match(s, "\\u200[CDE]")){ 43 | s = string.replace(s, "@\u200C", "1") 44 | s = string.replace(s, "@\u200D", "0") 45 | s = string.replace(s, "@\u200E", "-") 46 | s = string.match(s, "([01]{8,8}.*[01]{8,8})") 47 | var bin = string.split(s, "-") 48 | var buf = raw.buffer(#bin) 49 | for(i=1;#buf;1){ 50 | buf[i] = tonumber(bin[i], 2) 51 | } 52 | return tostring(buf); 53 | } 54 | } 55 | 56 | winform.edit.limit = -1 57 | 58 | import win.clip 59 | 60 | winform.button.oncommand = function(id,event){ 61 | var text = winform.edit.text 62 | if(#text) { 63 | win.clip.write(textToZeroWidth(text)) 64 | winform.msgbox("加密成功,已复制到剪贴板") 65 | } 66 | else { 67 | winform.msgboxErr("请先复制待加密文本到编辑框") 68 | } 69 | } 70 | 71 | winform.button2.oncommand = function(id,event){ 72 | var text = winform.edit.text 73 | if(#text) { 74 | var x = zeroWidthToText(text) 75 | if(x) winform.msgbox("解密成功:"+x) 76 | else winform.msgboxErr("解密失败,当前文本中未发现加密信息!") 77 | } 78 | else winform.msgboxErr("请先复制待解密文本到编辑框") 79 | } 80 | 81 | winform.show(); 82 | win.loopMessage(); 83 | return winform; 84 | -------------------------------------------------------------------------------- /代码统计.aardio: -------------------------------------------------------------------------------- 1 | //统计工程代码行数和文件 2 | import win.ui; 3 | /*DSG{{*/ 4 | var winform = win.form(text="代码统计";right=759;bottom=659) 5 | winform.add( 6 | edit={cls="edit";left=5;top=5;right=755;bottom=655;autohscroll=false;bgcolor=16777215;db=1;dl=1;dr=1;dt=1;edge=1;multiline=1;readonly=1;vscroll=1;z=1} 7 | ) 8 | /*}}*/ 9 | 10 | import console 11 | import ide 12 | import fsys 13 | 14 | var path = ide.getProjectDir() 15 | if(#path){ 16 | var dirs = {} 17 | var lines = 0 18 | var tm, days = 0, 0 19 | fsys.enum(path, "*.aardio", 20 | function(dirname,filename,fullpath,findData){ 21 | if(filename){ 22 | table.push(dirs, fullpath) 23 | for i in io.lines(fullpath) { 24 | lines += 1 25 | } 26 | if(filename == "main.aardio") { 27 | tm = fsys.fromFileTime(findData.ftCreationTime).addhour(8) 28 | } 29 | } 30 | }, function(dirpath,dirname){ 31 | if(dirname == ".build") return false; 32 | else return true; 33 | } 34 | ); 35 | winform.edit.printf("当前工程:%s", path) 36 | winform.edit.printf("工程创建于:%s,已维护%s天", tostring(tm), time.now().diffday(tm)) 37 | winform.edit.printf("代码文件数:%s", #dirs) 38 | winform.edit.printf("代码总行数:%s", lines) 39 | winform.edit.print("") 40 | winform.edit.print("-----------------------") 41 | winform.edit.print("") 42 | winform.edit.print(string.join(dirs, '\r\n')) 43 | winform.edit.vScroll(6/*_SB_TOP*/) 44 | } 45 | 46 | 47 | winform.show(); 48 | win.loopMessage(); 49 | return winform; 50 | --------------------------------------------------------------------------------