除了保护生态,再分享一个自动挂机聊天脚本核心源码(高山流水)

Posted 日赚3万网的站长

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了除了保护生态,再分享一个自动挂机聊天脚本核心源码(高山流水)相关的知识,希望对你有一定的参考价值。

以前分享过一个保护生态脚本源码,今天再分享一个类似的高山流水自动聊天脚本核心源码,完整源码可以点击访问这里。可以直接打包运行,该源码是Auto.js编写,可以二次重构。

在这里插入图片描述

//完整源码访问网站 rz3w.com

function 首页ui() {
    importClass(android.view.MenuItem);
    importClass(com.google.android.material.bottomnavigation.BottomNavigationView);
    importClass(com.google.android.material.bottomnavigation.LabelVisibilityMode);
    importClass(android.widget.ArrayAdapter);
    importClass(android.widget.AdapterView);
    importClass(java.util.ArrayList);
    ui.layout(
        '<drawer id="drawer">\\
            <relative>\\
                <appbar  w="*" h="auto">\\
                    <frame bg="#FF6699">\\
                        <toolbar id="toolbar" textStyle="bold" />\\
                    </frame>\\
                </appbar>\\
                <viewpager id="vp" layout_below="appbar" layout_above="bnv" marginTop="55dp">\\
                    <frame>\\
                        <vertical bg="#FF6699">\\
                            <vertical bg="#FFCCFF">\\
                                <Switch id="autoService" bg="#2F4F4F" text="无障碍服务【安卓7.0或以上】" textColor="white" checked="'+ (auto.service != null) + '" padding="8 8 8 8" textSize="15sp" />\\
                            </vertical>\\
                            <horizontal bg="#00CED1">\\
                                <text textColor="#080808" text="公告:" />\\
                                <text id="滚动内容1" singleLine="true" ellipsize="marquee" textColor="#ff010100" text="觅缘,缘来有你平台,点开始没有悬浮窗,如果要停止运行可以按音量加号键!因为平台检测机器人所有才隐藏悬浮窗的!以后不需要手动更新版本了,后台直接同步更新了     觅缘,缘来有你平台,点开始没有悬浮窗,如果要停止运行可以按音量加号键!因为平台检测机器人所有才隐藏悬浮窗的!以后不需要手动更新版本了,后台直接同步更新了" />\\
                            </horizontal>\\
                            <horizontal bg="#C6E2FF">\\
                                <text textColor="#080808" text="更新:" />\\
                                <text id="滚动内容2" singleLine="true" ellipsize="marquee" textColor="#ff010100" text="1.新增:知缘,蜜糖,塔咪,对对,甜柚,勿忘我,国际名门,星梦,陌对,倾心,花枝,就聊,绿茶交友,恋否,星火,甜颜,甜心有约,知梦,初见,缘分,红颜新,花聊,宝聊,他她新,相见,花田,哆趣,欢鹊,美悦,心语,陌音,耳聊,M速配,缘来,找她,香草,百合 2.四个mp3文件会随机播放:1.mp3,2.mp3,3.mp3,4.mp3             1.新增:花枝,就聊,绿茶交友,恋否,星火,甜颜,甜心有约,知梦,初见,缘分,红颜新,花聊,宝聊,他她新,相见,花田,哆趣,欢鹊,美悦,心语,陌音,耳聊,M速配,缘来,找她,香草,百合 2.四个mp3文件会随机播放:1.mp3,2.mp3,3.mp3,4.mp3" />\\
                            </horizontal>\\
                            <horizontal marginTop="10"  w="auto" h="auto" layout_gravity="center">\\
                                <img w="50" h="50" circle="true" src="' + icon_url + '" />\\
                                <input id="模糊搜索" hint="模糊搜索" />\\
                                <img id="模糊搜索btn" src="@drawable/ic_search_black_48dp" padding="5 5 5 5" h="50dp" w="50dp" />\\
                                <img id="运行" w="50dp" h="50dp" tint="#006600" src="ic_play_arrow_black_48dp" />\\
                            </horizontal>\\
                            <horizontal margin="20 5 20 5" bg="#FFCC33">\\
                                <vertical h="auto" w="auto" layout_gravity="left|center" marginLeft="1">\\
                                    <horizontal>\\
                                        <text text="平台:"/>\\
                                        <spinner id="spin_pingTai" entries="未选择" />\\
                                    </horizontal>\\
                                    <horizontal>\\
                                        <text text="模式:"/>\\
                                        <spinner id="spin_moShi" entries="未选择" />\\
                                    </horizontal>\\
                                </vertical>\\
                                <img id="app图片" w="70dp" h="70dp" src="'+ 软件[app记录].src + '" circle="true" layout_gravity="center_vertical" />\\
                            </horizontal>\\
                            <vertical w="*" >\\
                                <horizontal margin="20" bg="#FFCC33" gravity="left|center">\\
                                <text text="详情:" />\\
                                <text id = "详情" text="还未选择app" textColor="#000000" />\\
                                <img id="下载app"  w="0dp" h="50dp" tint="#98F5FF" src="ic_get_app_black_48dp"/>\\
                                </horizontal>\\
                            </vertical>\\
                        </vertical>\\
                    </frame>\\
                    <frame >\\
                        <ScrollView>\\
                            <vertical padding="8 0"  >\\
                                <horizontal gravity="center" bg="#87CEFA">\\
                                    <text text="发送后延时设置" />\\
                                </horizontal>\\
                                <horizontal gravity="center">\\
                                    <text text="发送延时时间为:" h="auto"/>\\
                                    <input id="t1" hint="例如:3" text="'+ storage.get("time", "3") + '" gravity="center" textColor="red"/>\\
                                     <text  text="秒" h="auto" textColor="red"/>\\
                                </horizontal>\\
                                <horizontal gravity="center" bg="#87CEFA">\\
                                    <text text="重复发送设置" />\\
                                </horizontal>\\
                                <horizontal gravity="center">\\
                                    <text  text="重复发送条数为:" h="auto"/>\\
                                    <input id="strip" hint="例如:2" text="'+ storage.get("strip", "2") + '" ravity="center" textColor="red"/>\\
                                    <text text="条" h="auto" textColor="red"/>\\
                                </horizontal>\\
                                <horizontal gravity="center" bg="#87CEFA">\\
                                    <text text="过滤昵称设置" />\\
                                </horizontal>\\
                                <horizontal gravity="center">\\
                                    <text text="要过滤的名称:" />\\
                                    <input id="name_guoLv" text="'+ storage.get("name_guoLv", "小明|小黑|小白") + '" textColor="red" />\\
                                </horizontal>\\
                                <horizontal gravity="center" bg="#87CEFA">\\
                                   <text text="回复与接听设置" />\\
                                </horizontal>\\
                                <horizontal gravity="center">\\
                                    <Switch id="jishihuif" text="及时回复" textColor="blue" checked="'+ storage.get('jishihuif', true) + '" padding="8 8 8 8" textSize="15sp" />\\
                                    <Switch id="zdjieting" text="自动接听" textColor="blue" checked="'+ storage.get('zdjieting', true) + '" padding="8 8 8 8" textSize="15sp" />\\
                                </horizontal>\\
                                <horizontal gravity="center" bg="#87CEFA">\\
                                    <text text="发语音设置" />\\
                                </horizontal>\\
                                <Switch id="yaofayuyin" text="发语音打开(可放4个mp3,1234)" textColor="blue" checked="'+ storage.get('yaofayuyin', true) + '" padding="8 8 8 8" textSize="15sp" />\\
                                <Switch id="fawandashipin" text="亲密度到了直接打视频开关" textColor="blue" textColor="blue" checked="'+ storage.get('fawandashipin', true) + '" padding="8 8 8 8" textSize="15sp" />\\
                                <Switch id="faliangtiao" text="在一起发1条语音打开,发2条语音关闭" textColor="blue" textColor="blue" checked="'+ storage.get('faliangtiao', true) + '" padding="8 8 8 8" textSize="15sp" />\\
                                <Switch id="xqbcf" text="发完语音再发一句文字打开" textColor="blue" checked="'+ storage.get('xqbcf', true) + '" padding="8 8 8 8" textSize="15sp" />\\
                                <Switch id="dlyuyin" text="对聊单独发文字打开,要发语音关闭" textColor="blue" checked="'+ storage.get('dlyuyin', true) + '" padding="8 8 8 8" textSize="15sp" />\\
                                <Switch id="hyyuyin" text="红缘语音发1.mp3,关闭发平台录音的打开" textColor="blue" checked="'+ storage.get('hyyuyin', true) + '" padding="8 8 8 8" textSize="15sp" />\\
                                <Switch id="lkjujieting" text="每天同个用户只要自动接听一次" textColor="blue" checked="'+ storage.get('lkjujieting', false) + '" padding="8 8 8 8" textSize="15sp" />\\
                                <horizontal gravity="center">\\
                                    <text text="注意:在一起相关的如果要发两条语音的分别录制1.mp3跟2.mp3放在文件管理根目录" h="auto" textColor="purple"></text>\\
                                </horizontal>\\
                            </vertical>\\
                        </ScrollView>\\
                    </frame>\\
                    <frame>\\
                        <vertical>\\
                            <appbar>\\
                                <radiogroup orientation="horizontal" padding="30 1">\\
                                    <radio id="视频话术" text="适用于视频"  padding="10 1" />\\
                                    <radio id="聊天话术" text="适用无引诱聊天"  padding="10 1" />\\
                                </radiogroup>\\
                                <tabs id="tabs" />\\
                            </appbar>\\
                            <viewpager id="viewpager" bg="#993399">\\
                                <frame>\\
                                    <ScrollView>\\
                                        <vertical>\\
                                            <input id="打招呼语多行" text="" />\\
                                            <text text="" />\\
                                            <text text="" />\\
                                            <text text="" />\\
                                        </vertical>\\
                                    </ScrollView>\\
                                    <horizontal>\\
                                        <button id="招呼语恢复默认话术" layout_gravity="bottom" w="auto" h="auto" text="恢复到默认" />\\
                                        <button id="招呼语保存" layout_gravity="bottom" w="auto" h="auto" text="保存修改" />\\
                                    </horizontal>\\
                                </frame>\\
                                <frame>\\
                                    <ScrollView>\\
                                        <vertical>\\
                                            <input id="通用回复多行" text="" />\\
                                            <text text="" />\\
                                            <text text="" />\\
                                            <text text="" />\\
                                        </vertical>\\
                                    </ScrollView>center\\
                                    <horizontal>\\
                                        <button id="通用回复恢复默认话术" layout_gravity="bottom" w="auto" h="auto" text="恢复到默认" />\\
                                        <button id="通用回复保存" layout_gravity="bottom" w="auto" h="auto" text="保存修改" />\\
                                    </horizontal>\\
                                </frame>\\
                                <frame>\\
                                    <ScrollView>\\
                                        <vertical>\\
                                            <input id="关键词回复多行" text="" />\\
                                            <text text="" />\\
                                            <text text="" />\\
                                            <text text="" />\\
                                        </vertical>\\
                                    </ScrollView>center\\
                                    <horizontal>\\
                                        <button id="关键词回复恢复默认话术" layout_gravity="bottom" w="auto" h="auto" text="恢复到默认" />\\
                                        <button id="关键词回复保存" layout_gravity="bottom" w="auto" h="auto" text="保存修改" />\\
                                    </horizontal>\\
                                </frame>\\
                            </viewpager>\\
                        </vertical>\\
                    </frame>\\
                    <frame >\\
                        <vertical padding="10 10" >\\
                            <horizontal w="auto" h="auto" layout_gravity="center_horizontal" marginTop="10">\\
                                <img w="50" h="50" circle="true" src="' + icon_url + '" />\\
                                <text text="'+ jbname + '" textColor="#000000" textSize="24sp" textStyle="bold" padding="8" />\\
                            </horizontal>\\
                            <vertical padding="10 10" w="*" h="auto" bg="#ffffff" marginBottom="10dp">\\
                                <vertical id="激活码信息" w="auto" h="90" layout_gravity="left|center_vertical ">\\
                                    <text id="激活码_text" text="激活码:'+ storage.get("CDK") + '" textColor="#000000" textSize="15sp" />\\
                                    <text id="到期时间_text" text="到期时间:" textColor="#000000" textSize="15sp" marginTop="8" />\\
                                    <text id="剩余时间_text" text="剩余时间:" textColor="#000000" textSize="15sp" marginTop="8" />\\
                                </vertical>\\
                            </vertical>\\
                            <card w="*" h="auto" cardCornerRadius="15dp"\\
                                cardElevation="2dp" marginBottom="5dp">\\
                                <ScrollView bg="#ffffff">\\
                                    <frame padding="10 10" id="获取卡密">\\
                                        <text text="获取卡密" textColor="#000000" textSize="15sp" layout_gravity="center_vertical|center_horizontal" />\\
                                        <img w="30" h="30" tint="#DCDCDC" layout_gravity="center_vertical|center_horizontal|right" src="@drawable/ic_keyboard_arrow_right_black_48dp" />\\
                                    </frame>\\
                                </ScrollView>\\
                            </card>\\
                            <card w="*" h="auto" cardCornerRadius="15dp"\\
                                cardElevation="2dp" marginBottom="5dp">\\
                                <ScrollView bg="#ffffff" >\\
                                    <frame padding="10 10" id="使用教程">\\
                                        <text text="使用教程" textColor="#000000" textSize="15sp" layout_gravity="center_vertical|center_horizontal" />\\
                                        <img w="30" h="30" tint="#DCDCDC" layout_gravity="center_vertical|center_horizontal|right" src="@drawable/ic_keyboard_arrow_right_black_48dp" />\\
                                    </frame>\\
                                </ScrollView>\\
                            </card>\\
                            <card w="*" h="auto" cardCornerRadius="15dp"\\
                                cardElevation="2dp" marginBottom="5dp">\\
                                <ScrollView bg="#ffffff">\\
                                    <frame padding="10 10" id="退出登陆">\\
                                        <text text="退出登陆" textColor="#000000" textSize="15sp" layout_gravity="center_vertical|center_horizontal" />\\
                                        <img w="30" h="30" tint="#DCDCDC" layout_gravity="center_vertical|center_horizontal|right" src="@drawable/ic_keyboard_arrow_right_black_48dp" />\\
                                    </frame>\\
                                </ScrollView>\\
                            </card>\\
                            <horizontal gravity="center" bg="#87CEFA">\\
                                <text text="免责声明" />\\
                            </horizontal>\\
                            <horizontal gravity="center">\\
                                <text text="-----免责声明:本软件仅供学习交流使用,更多脚本访问网站:rz3w.com-----" h="auto" textColor="purple"></text>\\
                            </horizontal>\\
                        </vertical>\\
                    </frame>\\
                </viewpager>\\
                <com.google.android.material.bottomnavigation.BottomNavigationView\\
                    id="bnv"\\
                    h="56"\\
                    layout_alignParentBottom="true"\\
                    layout_centerHorizontal="true"\\
                    bg="#FAFAFA" />\\
            </relative>\\
            <frame layout_gravity="left" bg="#C1CDCD" w="220" h="*">\\
                <vertical bg="#C1CDCD" w="*" >\\
                    <img w="100" h="100" circle="true" src="' + icon_url + '" layout_gravity="center" />\\
                    <horizontal id = "跳无障碍" bg="#FFFAFA" w="*" h="auto" marginTop="5" padding="8 10">\\
                        <img w="15" h="15" src="@drawable/ic_android_black_48dp" tint="#696969" marginTop="2" />\\
                        <text textSize="13sp" text="跳转到无障碍服务设置页面" textColor="#696969" marginLeft="8" />\\
                    </horizontal>\\
                    <horizontal id="跳悬浮窗" bg="#FFFAFA" w="*" h="auto" marginTop="5" padding="8 10">\\
                        <img w="15" h="15" src="@drawable/ic_extension_black_48dp" tint="#696969" marginTop="2" />\\
                        <text textSize="13sp" text="跳转到悬浮窗权限设置页面1" textColor="#696969" marginLeft="8" />\\
                    </horizontal>\\
                    <horizontal id="跳悬浮窗2" bg="#FFFAFA" w="*" h="auto" marginTop="5" padding="8 10">\\
                        <img w="15" h="15" src="@drawable/ic_extension_black_48dp" tint="#696969" marginTop="2" />\\
                        <text textSize="13sp" text="跳转到悬浮窗权限设置页面2" textColor="#696969" marginLeft="8" />\\
                    </horizontal>\\
                    <horizontal id="跳查看日志" bg="#FFFAFA" w="*" h="auto" marginTop="5" padding="8 10">\\
                        <img w="15" h="15" src="@drawable/ic_assignment_black_48dp" tint="#696969" marginTop="2" />\\
                        <text textSize="13sp" text="查看日志(有问题反馈管理员)" textColor="#696969" marginLeft="8" />\\
                    </horizontal>\\
                </vertical>\\
                <frame layout_gravity="bottom" bg="#FFFAFA" w="*" h="auto" padding="20 5">\\
                    <horizontal id="设置">\\
                        <img w="30" h="30" src="ic_settings_black_48dp" tint="#696969" />\\
                        <text textColor="#696969" textSize="19sp" text="设置" marginLeft="8" />\\
                    </horizontal>\\
                </frame>\\
            </frame>\\
        </drawer >'
    );

    var arr_adapter = new ArrayAdapter(context, android.R.layout.simple_spinner_dropdown_item, new ArrayList(appList));
    ui.spin_pingTai.setAdapter(arr_adapter);
    ui.spin_pingTai.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener({
        onItemSelected: function (parent, view, pos) {
            更改图标(appList[pos])
            arr_adapter = new ArrayAdapter(context, android.R.layout.simple_spinner_dropdown_item, new ArrayList(软件[appList[pos]].entries));
            ui.spin_moShi.setAdapter(arr_adapter);
        },
    }));

    let bnv = ui.bnv;
    let menu = bnv.getMenu();
    /** ViewPager 与  BottomNavigationView 联动*/
    /** 监听BottomNavigationView切换选中事件  */
    bnv.setOnNavigationItemSelectedListener({
        onNavigationItemSelected: function (item) {
            //跳转到对应的页面
            ui.vp.setCurrentItem(item.getItemId());
            return true;
        }
    });

    ui.vp.addOnPageChangeListener({
        onPageSelected: function (position) {
            // 将当前的页面对应的底部标签设为选中状态
            menu.getItem(position).setChecked(true);
            if (menu.getItem(position) == "话术") {
                ui.viewpager.setTitles(["打招呼", "通用回复", "关键词回复"])
                ui.tabs.setupWithViewPager(ui.viewpager)
                let 模式 = storage.get("视频话术模式", false)
                // log(模式)
                if (模式) {
                    ui.视频话术.checked = true
                    ui.打招呼语多行.setText(storage.get("视频打招呼语数组").join("\\n"))
                    ui.通用回复多行.setText(storage.get("视频通用回复语数组").join("\\n"))
                    ui.关键词回复多行.setText(storage.get("视频关键词回复数组").join("\\n"))
                } else {
                    ui.聊天话术.checked = true
                    ui.打招呼语多行.setText(storage.get("聊天打招呼语数组").join("\\n"))
                    ui.通用回复多行.setText(storage.get("聊天通用回复语数组").join("\\n"))
                    ui.关键词回复多行.setText(storage.get("聊天关键词回复数组").join("\\n"))
                }
            }
        }
    });


    ui.模糊搜索btn.click(() => {
        let 关键词 = ui.模糊搜索.getText().toString()
        var app数组 = []
        for (let i = 0; i < appList.length; i++) {
            if (appList[i].indexOf(关键词) > -1) {
                app数组.push(appList[i])
            }
        }
        if (app数组.length > 0) {
            dialogs.build({
                title: "请选择您要找的app",
                items: app数组,
                itemsSelectMode: "single",
            }).on("single_choice", (index, item) => {
                toast("您选择的是" + item);
                let index = getArrIndex(appList, item)
                ui.spin_pingTai.setSelection(index)
                app记录 = item
                // storage.put("app索引",index)
                // storage.put("app",item)
            }).show();
        } else {
            alert("没找到你搜索的平台,可以联系卖家提供你要的平台")
        }
    })

    ui.autoService.on("check", function (checked) {
        if (checked && auto.service == null) {
            app.startActivity({
                action: "android.settings.ACCESSIBILITY_SETTINGS"
            });
        }
        if (!checked && auto.service != null) {
            auto.service.disableSelf();
        }
    });

    ui.emitter.on('resume', () => {//加载界面
        if (storage.get("运行状态") == 2) {
            toastLog("欢迎回来")
            try { 引擎.getEngine().forceStop() } catch (e) { }
        }
        ui.运行.setClickable(true)
        ui.autoService.checked = auto.service != null;
        if (getPackageName(app记录) != null) {//通过app名字找包名
            ui.详情.setText(app记录 + "(已安装)");
            ui.下载app.attr("w", "0dp");
        } else {
            检查重名app(app记录)
        }
    });

    /**
    * 获取资源ID
    * @param {*} name 
    * @param {*} type 
    */
    function getResID(name, type) {
        return context.getResources().getIdentifier(name, type, context.getPackageName());
    }
    /*标题抽屉栏*/
    // 让工具栏左上角可以打开侧拉菜单
    ui.跳无障碍.click(() => {
        alert("正在跳转到无障碍服务设置页面", "此脚本由无障碍模式开发\\n务必开启无障碍服务").then(() => {
            app.startActivity({
                action: "android.settings.ACCESSIBILITY_SETTINGS"
            });
        });
    })
    ui.跳悬浮窗.click(() => {
        alert("正在跳转到悬浮窗权限设置页面", "脚本需要悬浮窗权限\\n务必开启悬浮窗权限\\n1.进入脚本权限设置界面\\n2.找到《显示悬浮窗》《后台弹出界面》并给予权限").then(() => {
            app.startActivity自动刷视频 | 抖音快手 | 自动化脚本挂机助手

求个天龙八部自动打图的按键脚本原码

传奇脚本计时问题!

益智类小游戏保护小猫做一个暖心的铲屎官,还有语音聊天功能文末送书

益智类小游戏保护小猫做一个暖心的铲屎官,还有语音聊天功能文末送书

超星学习通脚本(油猴)