翼狐脚本(作者 海岛奇兵 微信 haidaoqibing456)

try to take over the world!

// ==UserScript==
// @name         翼狐脚本(作者 海岛奇兵 微信 haidaoqibing456)
// @namespace    http://tampermonkey.net/
// @version      4.0
// @description  try to take over the world!
// @author       You
// @include       https://lib.yiihuu.com/*
// @icon         https://lib.yiihuu.com/assets/pc/designer/static/img/logo3.png
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

play_first();
    var bool = false
    window.onload = begin;
    function begin(){
        setInterval(function(){//重复判断是否播放结束
            var wb = document.querySelector('span.pv-time-current').innerText
            var wb1 = document.querySelector('span.pv-time-duration').innerText
            if(wb != "00:00" && wb == wb1){
                setTimeout(play_next,1000);
            }
        },3000)
    }
    function play_next(){
        var list = document.querySelectorAll("li.normal")
        for(var i=0;i<list.length;i++){
            if(list[i].getAttribute("class")=="normal list_num current"){
                if(i!=list.length-1){
                    list[i+1].click();
                    break;
                }
            }
        }
    }

    function play_first(){
        var do_play = document.querySelector("img#begin_play")
        do_play.click()
    }



})();