zoukankan      html  css  js  c++  java
  • 小米自动砸蛋机器js代码

    02 //地址:http://static.xiaomi.cn/515
    03 //@author:liuzh
    04 //@url:http://blog.csdn.net/isea533
    05 var start = 10000000;
    06 var autoEgg = {
    07     start:function(){
    08         //5秒发布一次
    09         setInterval(this.send,5000);
    10         //5秒点击一次
    11         setTimeout(this.egg,5000);
    12         //3秒检测一下关闭
    13         setInterval(this.close,3000);
    14     },
    15     send:function(){
    16         //填写内容
    17         document.getElementById('commentContent').value = start++;
    18         //发布
    19         $('#sentBtn').click();
    20     },
    21     close:function(){
    22         if($('.unlucky_egg_modal').hasClass('in') || $('.unlucky_egg_modal').css('display')=='block'){
    23             $('a.close').click();
    24         }
    25     },
    26     egg:function(){
    27         //随机敲蛋
    28         $('.egg')[(Math.random()*3).toFixed(0)].click();
    29         setTimeout(function(){
    30             if($('.unlucky_egg_modal').hasClass('in') || $('.unlucky_egg_modal').css('display')=='block'){
    31                 setTimeout(this.egg,1000);
    32             }
    33             else {
    34                 alert('提示!');
    35             }
    36         },3000);
    37     }
    38 }
    39 //开始
    40 autoEgg.start();
  • 相关阅读:
    如果你也时常想要上进,我们可以相互鼓励,相互促进
    (转)Math.round(11.5)等于多少?Math.round(-11.5)等于多少?
    乐观锁和悲观锁(Version:0.1)
    redis数据丢失及解决【转】
    Spring的IOC原理[通俗解释一下]
    Java中Error与Exception的区别
    WebService
    JDBC详解
    Cookie与Session
    java的pojo规范
  • 原文地址:https://www.cnblogs.com/jamesbd/p/3729922.html
Copyright © 2011-2022 走看看