{"id":18982523,"url":"https://github.com/kid-1912/autojs6-douyin-sendmessage","last_synced_at":"2025-09-06T01:32:11.930Z","repository":{"id":227636864,"uuid":"771316448","full_name":"KID-1912/autojs6-douyin-sendMessage","owner":"KID-1912","description":"基于autojs6实现抖音定时发送消息、表情到指定好友以实现单方面续火花；无需Root、支持解锁、自动关闭部分弹窗","archived":false,"fork":false,"pushed_at":"2024-03-15T16:18:36.000Z","size":9,"stargazers_count":31,"open_issues_count":2,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-06T17:51:40.653Z","etag":null,"topics":["autojs","autojs6","douyin","javascript","tictok"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KID-1912.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-13T04:26:52.000Z","updated_at":"2025-03-20T07:47:54.000Z","dependencies_parsed_at":"2024-03-14T11:59:08.219Z","dependency_job_id":"a004ed3c-ba1c-4130-9768-d663a46e1237","html_url":"https://github.com/KID-1912/autojs6-douyin-sendMessage","commit_stats":null,"previous_names":["kid-1912/autojs6-douyin-sendmessage"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/KID-1912/autojs6-douyin-sendMessage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KID-1912%2Fautojs6-douyin-sendMessage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KID-1912%2Fautojs6-douyin-sendMessage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KID-1912%2Fautojs6-douyin-sendMessage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KID-1912%2Fautojs6-douyin-sendMessage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KID-1912","download_url":"https://codeload.github.com/KID-1912/autojs6-douyin-sendMessage/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KID-1912%2Fautojs6-douyin-sendMessage/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273846956,"owners_count":25178629,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-05T02:00:09.113Z","response_time":402,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autojs","autojs6","douyin","javascript","tictok"],"created_at":"2024-11-08T16:13:50.729Z","updated_at":"2025-09-06T01:32:11.664Z","avatar_url":"https://github.com/KID-1912.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# autojs6-douyin-sendMessage\r\n\r\n![](https://raw.githubusercontent.com/KID-1912/Github-PicGo-Images/master/202403132250853.png)\r\n\r\n基于 [AutoJs6 ](https://docs.autojs6.com/#/) 开发的抖音脚本，自动化发送消息、交互表情\r\n\r\n## 功能预览\r\n\r\n- 定时执行\r\n\r\n- 支持解锁手机(仅支持数字密码)\r\n\r\n- 动态文字消息\r\n\r\n- 发送抖音交互表情\r\n\r\n- 完成后台退出 app \r\n\r\n**注：** 本脚仅供学习，纯属个人娱乐，请勿修改用于其它用途\r\n\r\n## 准备工作\r\n\r\n### 安装 AutoJs6 apk\r\n\r\n安装地址 https://github.com/SuperMonster003/AutoJs6/releases\r\n\r\n选择 AutoJs6@6.x.x [下载第1个apk](https://github.com/SuperMonster003/AutoJs6/releases/download/v6.5.0/autojs6-v6.5.0-arm64-v8a-7a07b863.apk)即可\r\n\r\n### 软件设置\r\n\r\n首次安装后启动 AutoJs App，按弹窗引导设置：\r\n\r\n**显示在应用上层**\r\n\r\n\u003cimg src=\"https://raw.githubusercontent.com/KID-1912/Github-PicGo-Images/master/202403132302142.jpg\" title=\"\" alt=\"\" width=\"246\"\u003e\u003cimg title=\"\" src=\"https://raw.githubusercontent.com/KID-1912/Github-PicGo-Images/master/202403132303619.jpg\" alt=\"\" width=\"246\"\u003e\r\n\r\n**注：** 不同设备可能有所差异\r\n\r\n**读取文件权限**\r\n\r\n由于需要读取js脚本运行，支持读取文件\r\n\r\n\u003cimg title=\"\" src=\"https://raw.githubusercontent.com/KID-1912/Github-PicGo-Images/master/202403132307164.jpg\" alt=\"\" width=\"195\"\u003e\r\n\r\n### 无障碍服务\r\n\r\n无障碍服务是脚本运行必备条件，请在AutoJs左侧菜单开启\r\n\r\n\u003cimg title=\"\" src=\"https://raw.githubusercontent.com/KID-1912/Github-PicGo-Images/master/202403132309826.jpg\" alt=\"\" width=\"201\"\u003e\r\n\r\n如上图，还需勾选 **前台展示** 以及 **修改系统设置**(将用于脚本设置音量)\r\n\r\n**注：** 由于手机安全性设置，少数情况AutoJS无障碍服务被关闭，需重新打开后运行\r\n\r\n### 开机自启动\r\n\r\n为实现手机关机下次开机脚本定时执行，在手机设置中允许AutoJs App自启动(自行设置)\r\n\r\n\u003cimg src=\"https://raw.githubusercontent.com/KID-1912/Github-PicGo-Images/master/202403132317371.jpg\" title=\"\" alt=\"\" width=\"195\"\u003e\r\n\r\n## 使用说明\r\n\r\n### 脚本准备\r\n\r\n**下载脚本**\r\n\r\n首先将项目 douyin.js 脚本文件下载后发送到手机，并在AutoJs App 导入\r\n\r\n\u003cimg src=\"https://raw.githubusercontent.com/KID-1912/Github-PicGo-Images/master/202403132321893.jpg\" title=\"\" alt=\"\" width=\"240\"\u003e\r\n\r\n**配置变量**\r\n\r\n点击 铅笔编辑 图标，修改脚本前两行变量\r\n\r\n\u003cimg src=\"https://raw.githubusercontent.com/KID-1912/Github-PicGo-Images/master/202403132326850.jpg\" title=\"\" alt=\"\" width=\"343\"\u003e\r\n\r\n注意好友抖音昵称不要填错，需要全称\r\n\r\n### 单次运行\r\n\r\n点击三角形启动按钮，尝试单次运行（运行前请后台退出抖音app）\r\n成功单次运行脚本即流程走通，则下一步设置定时运行，否则参考 **常见问题** 部分解决后继续\r\n\r\n### 定时运行\r\n\r\n在脚本拓展菜单设置定时任务，脚本将每天定时运行并成功完成后终止\r\n\r\n\u003cimg title=\"\" src=\"https://raw.githubusercontent.com/KID-1912/Github-PicGo-Images/master/202403132356367.jpg\" alt=\"\" width=\"237\"\u003e\r\n\r\n**注：**\r\n\r\n好友置顶：为提高成功进入好友聊天框概率，可在抖音 “好友详情” “更多” 开启 “置顶聊天”\r\n\r\n建议使用闲置备用机，平时息屏，保证电量及时充电\r\n\r\n## 常见问题\r\n\r\n### 错误时中止脚本\r\n\r\n每次运行脚本失败/卡住/手动停止后，必须在任务栏查看 “运行中任务”，及时清除正在运行的任务后重新运行脚本，否则脚本叠加无法正常运行\r\n\r\n\u003cimg src=\"https://raw.githubusercontent.com/KID-1912/Github-PicGo-Images/master/202403142243682.png\" title=\"\" alt=\"\" width=\"280\"\u003e\r\n\r\n### 退出抖音后台\r\n\r\n在完成消息发送后，脚本会打开应用管理设置，自动点击“结束运行”实现后台退出抖音\r\n\r\n如果你的脚本卡在了这一步，可能是未查找到 强行关闭按钮（不同设备按钮文字不同），根据需要修改代码下方代码\r\n\r\n```js\r\n// 退出app\r\nfunction kill_app(packageName) {\r\n  var name = app.getPackageName(packageName);\r\n  app.openAppSetting(name);\r\n  sleep(3000);\r\n  clickWidgetByPosition(textMatches(/(结束运行|强行停止)/).untilFindOne());\r\n  sleep(1000);\r\n  clickWidgetByPosition(textMatches(/(.*确.*|.*定.*)/).untilFindOne());\r\n  sleep(1000);\r\n  home();\r\n}\r\n```\r\n\r\n## 自定义\r\n\r\n### 自定义文字内容\r\n\r\n默认脚本调用接口，随机获取文字内容输入\r\n\r\n你可以选择其它接口，可参考 https://github.com/vv314/quotes\r\n\r\n或自定义 `content` 数据源逻辑\r\n\r\n```js\r\n  // 输入内容\r\n  clickWidgetByPosition(className(\"android.widget.EditText\").untilFindOne());\r\n  sleep(3000, 100);\r\n  // 数据源\r\n  var content = \"\";\r\n  var res = http.get(\"https://v1.hitokoto.cn/\");\r\n  if (res.statusCode == 200) {\r\n    var data = res.body.json();\r\n    content = data.hitokoto;\r\n  } else {\r\n    content = \"今天网络不佳，没词了\";\r\n  }\r\n  input(content);\r\n```\r\n\r\n### 自定义互动表情\r\n\r\n默认发送 “比心\" 互动表情，你可以自定义其他表情，但限于首屏可见表情，否则自行添加逻辑\r\n\r\n```js\r\n  // 发送表情\r\n  clickWidgetByPosition(\r\n    className(\"android.widget.ImageView\").desc(\"表情\").untilFindOne()\r\n  );\r\n  var btnEmoji = className(\"android.widget.Button\").desc(\"互动表情\").findOnce();\r\n  if (btnEmoji) clickWidgetByPosition(btnEmoji);\r\n  clickWidgetByPosition(\r\n    className(\"android.widget.TextView\").text(\"比心\").untilFindOne()\r\n  );\r\n```\r\n\r\n### 互相发送\r\n\r\n目前脚本仅为单账号定时发送消息，若实现 “续火花” 的功能，可以在2台手机分别部署（离大谱）；\r\n\r\n另一个思路是 在手机设备使用“双开应用”，2个抖音app分别登录不同账号，修改脚本支持完成主抖音app发送消息后启用副抖音app回复消息，感兴趣可以探究AutoJs6如何区分双开app\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkid-1912%2Fautojs6-douyin-sendmessage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkid-1912%2Fautojs6-douyin-sendmessage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkid-1912%2Fautojs6-douyin-sendmessage/lists"}