牧羊岛

懒是不会有好果子吃滴//

导航

0713淘宝打折怪

Posted on 2012-07-13 14:49  牧羊岛  阅读(310)  评论(0)    收藏  举报

玩玩可以,不要瞎胡搞啊

 

//这里开始------
window.PP=(function(){
    var _getSWF=getSWF;//被拦截的方法
    var randomDelay=[1,3];//这里定义搜索随机间隔
    var buttonId="award_btn";//按钮id
    var timer;//计时器id
    var auto=false;//自动标志位
    //开始拦截方法
    var _showEnd=function(a,b){
        _getSWF("moster").showEnd(a, b);
        _getSWF("moster").showMoster(1);
        myBack(a,b);
    };
    //代理对象
    getSWF=function(){
        return {
            showEnd:_showEnd,
            showMoster:function(a){_getSWF("moster").showMoster(a);},
            showMyCoupon:function(a){_getSWF("moster").showMyCoupon(a);}
        };
    };
    var myBack = function(a,b){
        if(b!=null){
            console.log("红包:"+b);
        }
        if(auto){
            timer = setTimeout(go,getDelay());
        }
    };
    //模拟单击
    var go=function(){
        timer = null;
        var b=document.getElementById(buttonId);
        b&&b.click();
        reSetAward();
    };
    var getDelay=function(){
        var a=Math.random();
        if(a<0.025||(a>0.525&&a<0.55)){
            a=Math.floor(Math.random()*60000);
            console.log("休息:"+a);
            return a
        }
        return randomDelay[0]*1000+Math.floor(a * Math.abs(randomDelay[1]-randomDelay[0])*1000);
    };
    
    var _start=function(){auto=true;go();};
    var _stop=function(){auto=false;};
    return {
        start:_start,
        stop:_stop
    };
})();
//这里结束------

//这哥俩是控制台命令
PP.start();
PP.stop();

 

 

这次懒得搞界面了,得到红包也在控制台输出好了