/*
软件作者:https://xuhss.com/oxox/pro
*/
"ui";
/*
作者QQ:488716757
禁止二次贩卖
广告:租Auto.Js Pro账号一天12元附送Js教程视频
*/
//设置脚本主题颜色
var color = '#FFD700'
ui.layout(
<drawer id="drawer">
<vertical>
<appbar id='appbar' bg='{{this.color}}'>
<toolbar id="toolbar" title="遇见漂流瓶"/>
</appbar>
<viewpager id="viewpager">
<frame>
<vertical>
<horizontal gravity='center_vertical'>
<text text='' margin='5dp' bg='{{this.color}}' w='8dp' h='35dp'></text>
<text text='软件权限' textSize='16sp' textColor='{{this.color}}'></text>
</horizontal>
<vertical bg='#ffffff' margin='5dp'>
<Switch id="autoService" text="无障碍服务" checked="{{auto.service != null}}" padding="8 8 8 8" textSize="15sp"/>
<Switch id="windowService" text="悬浮窗服务" checked="{{floaty.checkPermission()}}" padding="8 8 8 8"textSize="15sp"/>
</vertical>
<horizontal gravity='center_vertical'>
<text text='' margin='5dp' bg='{{this.color}}' w='8dp' h='35dp'></text>
<text text='脚本配置' textSize='16sp' textColor='{{this.color}}'></text>
</horizontal>
<ScrollView>
<vertical margin='5dp' bg='#ffffff'>
<button margin='5dp' id='start' bg='{{this.color}}' textColor='#ffffff' textSize='16sp' text='开始运行'></button>
</vertical>
</ScrollView>
</vertical>
</frame>
<frame>
</frame>
<frame>
</frame>
</viewpager>
</vertical>
</drawer>
);
//设置状态栏的颜色
ui.statusBarColor(color)
//当用户回到本界面时,resume事件会被触发
ui.emitter.on("resume", function () {
// 此时根据无障碍服务的开启情况,同步开关的状态
ui.autoService.checked = auto.service != null;
ui.windowService.checked = floaty.checkPermission()
})
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//用户勾选无障碍服务的选项时,跳转到页面让用户去开启
ui.autoService.on("check", (checked) => {
if (checked && auto.service == null) {
app.startActivity({
action: "android.settings.ACCESSIBILITY_SETTINGS"
});
}
if (!checked && auto.service != null) {
auto.service.disableSelf();
}
})
//悬浮窗按钮单击事件
ui.windowService.on('check', (checked) => {
if (checked && !floaty.checkPermission() && device.sdkInt > 23) {
log('打开悬浮窗权限')
var intent = new Intent();
intent.setAction("android.settings.action.MANAGE_OVERLAY_PERMISSION")
app.startActivity(intent);
toast('选择此软件')
}
})
//引流操作
ui.start.on('click', () => {
//开始获取脚本配置
threads.start(function () {
//脚本全部参数设置完毕!显示开始悬浮窗
var w = floaty.window(
<frame>
<button id='ok' text=''></button>
</frame>
);
//悬浮窗关闭时自动停止脚本
w.exitOnClose();
//悬浮窗常在
setInterval(()=>{}, 1000);
//设置悬浮窗的位置
w.setPosition(20,device.height * 0.7);
//设置悬浮窗属性
w.setAdjustEnabled(true);
//定义安妮判断变量
var state = 0;
ui.run(function(){
w.ok.setText('开始');
});
//定义脚本线程变量
var thread;
//悬浮窗ok按钮单击事件
w.ok.on('click', ()=> {
if (state == 0) {
log('开始运行');
ui.run(function(){
w.ok.setText('停止');
});
state = 1;
//开始执行主线脚本引擎
thread = threads.start(function(){
main(data)
});
} else {
log('停止运行');
ui.run(function(){
w.ok.setText('开始');
});
thread.interrupt();
state = 0;
}
});
})
})
function main (对象) {
话术 = 对象.input_0
延迟 = 对象.input_1
log('话术:%s;延迟:%s', 话术, 延迟)
log('开始运行main函数')
for (let i = 0;i < 5;i++) {
console.info('脚本将在'+(5-i)+'秒后启动!')
sleep(1000)
}
//新建本地储存
var main_st = storages.create('uki_name')
//定义寻找控件的时间
var findViewDelay = 2000
//定义for循环发送消息时间
var forMsgDelay = '500-1000'
//定义输入文本后等待多久发送
var sendDyley = '200-800'
while(id("recycler_view_message_list").findOne().scrollBackward());
var main_loop = true
while (main_loop) {
log('进入while循环')
main_rtv_msg_dot = id('rtv_msg_dot').findOne(findViewDelay)
if (main_rtv_msg_dot) {
log('找到了小红点')
while(!main_rtv_msg_dot.parent().click());
log('点击该用户成功')
main_et_input = id('et_input').findOne(findViewDelay)
if (main_et_input != null) {
log('找到了消息输入框')
//准备发送话术
main_talking_skill = 话术.split('-')
toastLog('一共有'+main_talking_skill.length+'段话术!')
//读取用户昵称
main_tv_name = id('tv_name').findOne(findViewDelay)
if (main_tv_name != null) {
log('找到了用户昵称控件')
main_userName = main_tv_name.text()
//读取聊天次数
main_msgNumber = main_st.get(main_userName) || 0
toastLog('已经跟'+main_userName+'聊了'+main_msgNumber+'次!')
if (main_msgNumber < main_talking_skill.length) {
log('还没有聊完')
main_talking_skill_one = main_talking_skill[main_msgNumber].split(';')
log('main_talking+skill_one:%s', main_talking_skill_one)
for (let i = 0 ; i < main_talking_skill_one.length ; i++) {
sleep(r_number(forMsgDelay))
main_talking_skill_two = main_talking_skill_one[i].split('|')
log('main_talking_skill_two:%s', main_talking_skill_two)
main_talking_skill_three = main_talking_skill_two[random(0, main_talking_skill_two.length - 1)]
log('main_talking_skill_three:%s', main_talking_skill_three)
main_editText = id('et_input').findOne(findViewDelay)
if (main_editText != null) {
log('找到了编辑框啊')
main_editText.setText(main_talking_skill_three)
} else {
log('没有找到编辑框')
main_right = text('是').fin
没有合适的资源?快使用搜索试试~ 我知道了~
AutoJs源码-Uki消息交互式回复
![preview](https://csdnimg.cn/release/downloadcmsfe/public/img/white-bg.ca8570fa.png)
共1个文件
js:1个
![preview-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/scale.ab9e0183.png)
需积分: 7 0 下载量 23 浏览量
2022-11-15
06:14:01
上传
评论
收藏 3KB 7Z 举报
温馨提示
AutoJs源码-Uki消息交互式回复。本资源购买前提醒:本源码都是实际autojs项目模板,安装好autojs直接运行即可打开。1、支持低版本autojs。2、资源仅供学习与参考,请勿用于商业用途,否则产生的一切后果将由您自己承担!。3、安装过程详见具体资源,不会使用autojs谨慎下载
资源推荐
资源详情
资源评论
![thumb](https://img-home.csdnimg.cn/images/20210720083646.png)
![thumb](https://img-home.csdnimg.cn/images/20210720083646.png)
![thumb](https://img-home.csdnimg.cn/images/20210720083646.png)
![thumb](https://img-home.csdnimg.cn/images/20210720083646.png)
![thumb](https://img-home.csdnimg.cn/images/20210720083646.png)
![zip](https://img-home.csdnimg.cn/images/20210720083646.png)
![thumb](https://img-home.csdnimg.cn/images/20210720083646.png)
![thumb](https://img-home.csdnimg.cn/images/20210720083646.png)
![thumb](https://img-home.csdnimg.cn/images/20210720083646.png)
![thumb](https://img-home.csdnimg.cn/images/20210720083646.png)
![thumb](https://img-home.csdnimg.cn/images/20210720083646.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![thumb](https://img-home.csdnimg.cn/images/20210720083646.png)
![thumb](https://img-home.csdnimg.cn/images/20210720083646.png)
![thumb](https://img-home.csdnimg.cn/images/20210720083646.png)
![thumb](https://img-home.csdnimg.cn/images/20210720083646.png)
![thumb](https://img-home.csdnimg.cn/images/20210720083646.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
收起资源包目录
![package](https://csdnimg.cn/release/downloadcmsfe/public/img/package.f3fc750b.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
共 1 条
- 1
资源评论
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
![avatar](https://profile-avatar.csdnimg.cn/default.jpg!1)
[虚幻私塾】
- 粉丝: 335
- 资源: 1558
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)