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();
  • 相关阅读:
    LF 第三章 装饰器和迭代器相关
    Python 文件管理
    Python 强制类型转换
    安装模块
    LF 第三章
    pep8 Python编码规则
    Help on module pyclbr:
    Help on class timedelta in module datetime:
    Help on function meshgrid in module numpy.lib.function_base:
    Help on module matplotlib.cm in matplotlib:
  • 原文地址:https://www.cnblogs.com/jamesbd/p/3729922.html
Copyright © 2011-2022 走看看