function 判断是否是转账信息(is_tran_acc) {
pat = /[转账]请你确认收钱/
return Boolean(is_tran_acc.match(pat))
}

auto.waitFor();
events.observeNotification()
window = floaty.window(
<frame>
<linear>
<button id="button" text="CA" w="40" h="40" color="#ffffff" bg="#77000000"/>
</linear> </frame>
);
var x = 0,
y = 0;
var windowX = 20
var windowY = 0
window.button.setOnTouchListener(function(view, event) {
switch (event.getAction()) {
case event.ACTION_DOWN:
x = event.getRawX();
y = event.getRawY();
windowX = window.getX();
windowY = window.getY();
downTime = new Date().getTime();
return true;
case event.ACTION_MOVE:
window.setPosition(windowX + (event.getRawX() - x),
windowY + (event.getRawY() - y));
return true;
case event.ACTION_UP:
if (Math.abs(event.getRawY() - y) < 5 && Math.abs(event.getRawX() - x) < 5) {
onClick();
}
return true;
}
return true;
});

function onClick() {
if (info_tem.length==1) {
dialogs.select("收款提醒", info_tem)
} else {
dialogs.select("暂时没人转账给你");
}

}
//监听消息
var info_tem = new Array()
events.on("notification", function(n) {
if (n.getPackageName() == "com.tencent.mm") {
obser_text = n.getText();
if (判断是否是转账信息(obser_text)) {
alert("注意,有转账请注意查收");
var current_time = new Date();
info_tem.push(current_time + ":微信收到一笔账单,请注意查收");
log(current_time + ":微信收到一笔账单,请注意查收");
n.click();
}
}
});
0_1546700397491_微信收款提醒.js

正则表达式其实多余 只是我个人在学正则

最后想问下如何正确复制代码过来😂😂就是带有背景的复制过来

'''
+++
'''
貌似是前后加三个'这个符号

  • 4
    帖子
  • 1499
    浏览

与 Auto.js 的连接断开,我们正在尝试重连,请耐心等待