管理员
//打开QQ聊天界面就能自动聊天了
"auto"
t = 0; //延迟
toast("打开QQ消息界面自动聊天");
//threads.start(notificationmsg);
while (true) {
  other = "";
  findMessage();
  othersay = getMessage();
  if (othersay != null) {
    var info = othersay;
    log("\n\nTa:\n" + ":" + othersay);
    i = "";
    i += Me();
    i += "";
    sendMessage(i);
    log("\n\n我:\n" + i);
    sleep(t)
  }
  findboxmsg();
}

function Me() {
  var url = "http://www.tuling123.com/openapi/api";
  id1 = "llmjk";
  var res = http.post(url, {
    key: "65458a5df537443b89b31f1c03202a80", //图灵
    //key: "e0fcda33be9847c8b8534abe51b4b095", //唐嫣
    // key: "b4438ca194064134afa28f686fbd04a5", //my图灵
    info: info,
    userid: "1",
  });
  var html = res.body.string();
  eval("b=" + html);
  return b.text;
}

function getMessage() {
  var information = null;
  if (id("listView1").exists()&&id("chat_item_head_icon").exists() && id("chat_item_content_layout").exists()) {
    num = msgnum();
    icon = id("chat_item_head_icon").findOnce(num - 1);
    toastt = id("chat_item_content_layout").findOnce(num - 1);
    if (toastt != null && icon != null) {
      x = icon.bounds().centerX();
      y = icon.bounds().centerY();
      if (x < 500) {
        information = toastt.text();
        other = icon.text();
      }
    }
  }
  return information;
}

function sendMessage(i) {
  if (id("input").exists()) {
    id("input").setText(i);
    className("android.widget.Button").text("发送").click();
  }
}

function findMessage() {
  if (id("unreadmsg").exists()) {
    unreadmsg = id("unreadmsg").findOnce(0);
    x1 = unreadmsg.bounds().centerX();
    y1 = unreadmsg.bounds().centerY();
    //click(x1 - 200, y1 - 50);
       press(x1 - 200, y1 - 50,50);
    if (id("input").findOne(2000) == null) {
      back();
      if (currentActivity() != "com.tencent.mobileqq.activity.SplashActivity") {
        app.launch("com.tencent.mobileqq");
      }
    }
  } else {
    ismsg = className("android.widget.RelativeLayout").depth("4").drawingOrder("2").clickable(true).selected(true).findOne(100);
    if (ismsg != null && ismsg.childCount() == 3) {
      ismsg.click();
    }
  }
}

function findboxmsg() {
  if (id("msgbox").exists()) {
    id("msgbox").findOne(500).click();
  }
}

function notificationmsg() {
  var notifi;
  events.observeNotification();
  events.on("notification", function(n) {
    if ("com.tencent.mobileqq" == n.getPackageName()) {
      app.launch("com.tencent.mobileqq");
    }
  });
}


function msgnum(){
i = 0;
id("listView1").findOne().children()
    .forEach(function(child){
        if(child.className()=="android.widget.RelativeLayout")
            i++;
    });
    return i;
}
最后由 O了吗 编辑
管理员

打开聊天界面,别人发来的信息机器人自动回复,很简单

@o了吗QQ机器人 中说:

//可以给同时多个人聊天了,不像之前只能停在一个界面上
//运行后打开QQ消息列表
"auto"
t = 0;//延迟
toast("打开QQ消息界面自动聊天");
threads.start(notificationmsg);
while (true) {
other = "";
findMessage();
othersay = getMessage();
if (othersay != null) {
var info = othersay;
log("\n\nTa:\n" + ":" + othersay);
i = "";
i += Me();
i += "";
sendMessage(i);
log("我:\n" + i);
sleep(t);
back();
}
findboxmsg();
}
function Me() {
var url = "http://www.tuling123.com/openapi/api";
id1 = "llmjk";
var res = http.post(url, {
key: "65458a5df537443b89b31f1c03202a80", //图灵
//key: "e0fcda33be9847c8b8534abe51b4b095", //唐嫣
// key: "b4438ca194064134afa28f686fbd04a5", //my图灵
info: info,
userid: "1",
});
var html = res.body.string();
eval("b=" + html);
return b.text;
}
function getMessage() {
var information = null;
if (id("chat_item_head_icon").exists()&&id("chat_item_content_layout").exists()) {

var list = id("listView1").findOne();
num = list.childCount();
icon = id("chat_item_head_icon").findOnce(num - 1);
toastt = id("chat_item_content_layout").findOnce(num - 1);
if (toastt != null && icon != null) {
  x = icon.bounds().centerX();
  y = icon.bounds().centerY();
  if (x < 500) {
    information = toastt.text();
    other = icon.text();
  }
}

}
return information;
}
function sendMessage(i) {
if (id("input").depth("2").exists()) {
id("input").depth("2").findOne().setText(i);
className("android.widget.Button").text("发送").findOne().click();
}
}

function findMessage() {
if (id("unreadmsg").exists()) {
unreadmsg = id("unreadmsg").findOne();
x1 = unreadmsg.bounds().centerX();
y1 = unreadmsg.bounds().centerY();
click(x1 - 200, y1 -50);
}
}

function findboxmsg() {
if(id("msgbox").exists()){
id("msgbox").findOne().click();
}
}

function notificationmsg() {
var notifi;
events.observeNotification();
events.on("notification", function (n) {
if ("com.tencent.mobileqq" == n.getPackageName()) {
app.launch("com.tencent.mobileqq");
}
});
}

怎么用?从哪开始复制?

管理员
//打开QQ聊天界面就能自动聊天了
"auto"
t = 0; //延迟
toast("打开QQ消息界面自动聊天");
threads.start(notificationmsg);
while (true) {
  other = "";
  findMessage();
  othersay = getMessage();
  if (othersay != null) {
    var info = othersay;
    log("\n\nTa:\n" + ":" + othersay);
    i = "";
    i += Me();
    i += "";
    sendMessage(i);
    log("\n\n我:\n" + i);
    sleep(t)
  }
  findboxmsg();
}

function Me() {
  var url = "http://www.tuling123.com/openapi/api";
  id1 = "llmjk";
  var res = http.post(url, {
    key: "65458a5df537443b89b31f1c03202a80", //图灵
    //key: "e0fcda33be9847c8b8534abe51b4b095", //唐嫣
    // key: "b4438ca194064134afa28f686fbd04a5", //my图灵
    info: info,
    userid: "1",
  });
  var html = res.body.string();
  eval("b=" + html);
  return b.text;
}

function getMessage() {
  var information = null;
  if (id("listView1").exists()&&id("chat_item_head_icon").exists() && id("chat_item_content_layout").exists()) {

    var list = id("listView1").findOne();
    num = list.childCount();
    var n = 1;
    if (id("graybar").exists()) {
      i = 0;
      while (id("graybar").findOnce(i++) != null);
      n = i;
    }
    icon = id("chat_item_head_icon").findOnce(num - n);
    toastt = id("chat_item_content_layout").findOnce(num - n);
    if (toastt != null && icon != null) {
      x = icon.bounds().centerX();
      y = icon.bounds().centerY();
      if (x < 500) {
        information = toastt.text();
        other = icon.text();
      }
    }
  }
  return information;
}

function sendMessage(i) {
  if (id("input").depth("2").exists()) {
    id("input").depth("2").find().setText(i);
    className("android.widget.Button").text("发送").find().click();
  }
}

function findMessage() {
  if (id("unreadmsg").exists()) {
    unreadmsg = id("unreadmsg").findOnce(0);
    x1 = unreadmsg.bounds().centerX();
    y1 = unreadmsg.bounds().centerY();
    click(x1 - 200, y1 - 50);
    if (id("input").depth("2").findOne(2000) == null) {
      back();
      if (currentActivity() != "com.tencent.mobileqq.activity.SplashActivity") {
        app.launch("com.tencent.mobileqq");
      }
    }
  } else {
    ismsg = className("android.widget.RelativeLayout").depth("4").drawingOrder("2").clickable(true).selected(true).findOne(100);
    if (ismsg != null && ismsg.childCount() == 3) {
      ismsg.click();
    }
  }
}

function findboxmsg() {
  if (id("msgbox").exists()) {
    id("msgbox").findOne(500).click();
  }
}

function notificationmsg() {
  var notifi;
  events.observeNotification();
  events.on("notification", function(n) {
    if ("com.tencent.mobileqq" == n.getPackageName()) {
      app.launch("com.tencent.mobileqq");
    }
  });
}
最后由 O了吗 编辑

我感觉不好用了,,原本有个2.3k的文件 那个非常好用

@O了吗 我现在在这里面下载的 这几个脚本,都是点击列表内容进去后不会自动返回。要是点击了那些公众号怎么办?而且在开始运行的时候停留在别的QQ群,没有新的内容,一样会自动回复一句。

管理员

@3465344901 其实要是点进去没有找到输入框的话,他是会自动返回的,聊天界面不返回是为了方便看聊天信息,当有收到其他信息时他会点击聊天界面上面的悬浮窗,也能同时聊天。

  • 40
    帖子
  • 8127
    浏览

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