吾爱破解 - LCG - LSG |安卓破解|病毒分析|www.52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 6112|回复: 34
收起左侧

[其他原创] 学习公社平台自动学习脚本

  [复制链接]
evlon 发表于 2022-12-7 10:32

背景

学习公社平台学习中,需要人工干预才可以连续学习。

解方

安装油猴

省略

导入脚本

// ==UserScript==
// home.php?mod=space&uid=170990         学习公社平台
// home.php?mod=space&uid=467642    http://tampermonkey.net/
// home.php?mod=space&uid=1248337      0.3
// @description  try to take over the world!
// home.php?mod=space&uid=686208       You
// home.php?mod=space&uid=195849        https://study.enaea.edu.cn/viewerforccvideo.do?courseId=*&circleId=*
// home.php?mod=space&uid=593100         https://www.google.com/s2/favicons?domain=enaea.edu.cn
// home.php?mod=space&uid=609072        none
// ==/UserScript==

(function() {
    'use strict';

    let isLast = false;
     function gotoNext(){
         let todos = opener.$('table.dataTable tr:contains(%)').filter((i,v)=>{ return $(v).find('td:nth-child(4)').text().indexOf('#') == -1 &&  $(v).find('td:nth-child(5)').text().indexOf('100%') == -1})
         .filter((i,v)=>{ let vurl = $(v).find('a.saveStuCourse').attr('data-vurl'); return location.href.indexOf(vurl) == -1});
            if(todos.length > 0){
                console.log('switch to next.... reload  ');
                let nextCourse =  $(todos[0]);
                nextCourse.find('td').eq(3).text('#')
                let nextVurl = nextCourse.find('a.saveStuCourse').attr('data-vurl');
                location.href = nextVurl;
            }
    }

    function autoSetEvent(){
        setInterval(function(){
            var aud = $("div video").get(0);
            if( $(aud).prop('__ok__') != true){
                aud.addEventListener("ended", video_ended);
                console.log("add ended event listener.")
                $(aud).prop('__ok__',true);

                isLast = $('ul.cvtb-MCK-course-list li.last').text() == $('ul.cvtb-MCK-course-list li.current').text();

                let notStudyList = $('div.cvtb-MCK-CsCt-studyProgress').filter((i,v)=>$(v).text().indexOf('100%') == -1);
                if(notStudyList.length == 0){
                    gotoNext();
                }
                else if(notStudyList.length > 0 && $('ul.cvtb-MCK-course-list li.current').find('div.cvtb-MCK-CsCt-studyProgress').text().indexOf('100%') === 0){
                        notStudyList.eq(0).parent().click();
                }
            }

            $('.dialog-button-container button:contains(继续学习)').click()
        },3000);
    }

    function video_ended() {
        console.log("The audio has ended");

        if(isLast){
            console.log('switch to next.... ');       

           gotoNext();
        }
    }

    setTimeout(function(){
        // debugger;
        $(".continue .user_choise").click()
        autoSetEvent();
    },3000);

    // Your code here...
})();



学习公社平台-tampermonkey_scripts.zip

3.81 KB, 下载次数: 308, 下载积分: 吾爱币 -1 CB

免费评分

参与人数 3吾爱币 +9 热心值 +2 收起 理由
wjz85784788 + 1 + 1 谢谢@Thanks!
wushaominkk + 7 + 1 欢迎分析讨论交流,吾爱破解论坛有你更精彩!
被封号的萌新 + 1 直接爽翻天

查看全部评分

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

 楼主| evlon 发表于 2022-12-7 11:08
dongse 发表于 2022-12-7 11:06
怎么使用????请指教啊

安装油猴,导入后,你就挂着就好了。 他会自动转下一课学, 我都是晚上挂机1晚上搞定。

免费评分

参与人数 1吾爱币 +3 收起 理由
dongse + 3 谢谢@Thanks!

查看全部评分

被封号的萌新 发表于 2022-12-7 10:42
哈哈,这脚本配合我自创的enaea、10倍速岂不是爽翻天
King1993 发表于 2022-12-7 10:47
lfordch 发表于 2022-12-7 10:51
感谢楼主分享!学习了!
Wisdom_xiaogui 发表于 2022-12-7 10:53
强啊,学习到了
宜城小站 发表于 2022-12-7 10:54
谢谢分享
这个真有用
头像被屏蔽
dongse 发表于 2022-12-7 11:06
提示: 作者被禁止或删除 内容自动屏蔽
FIzz001 发表于 2022-12-7 11:24
还有这玩意,学习了
lncyq 发表于 2022-12-7 11:39
学习公社是啥玩意儿,没听说过
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则 警告:本版块禁止灌水或回复与主题无关内容,违者重罚!

快速回复 收藏帖子 返回列表 搜索

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-4-29 22:31

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表