Greasy Fork

Greasy Fork is available in English.

怪物归来

The monster come back,you'll game over!

当前为 2018-05-13 提交的版本,查看 最新版本

// ==UserScript==
// @name         怪物归来
// @namespace    http://tampermonkey.net/
// @version      0.99
// @description  The monster come back,you'll game over!
// @author       Jack
// @match        http://*.gwgl.xh456.com/index.aspx
// @require http://greasyfork.icu/scripts/367762-jquery-timer-js/code/jquerytimerjs.js?version=596413
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
   var mpid = 27; //30级
   var lasthxs = 0;
    var ex = new (function(){

    // Timer speed in milliseconds
    var incrementTime = 1000;

    // Current timer position in milliseconds
    var currentTime = 0;

        $(function(){
            $.getScript('http://jianfeile.com:91/Public/js/jquery.timer.js',function(){
         //    ex.Timer = $.timer(updateTimer,incrementTime,false); //刷高级怪使用
            })
        });

        function updateTimer() {
          currentTime += incrementTime;
          var sec = currentTime / 1000;
          //校正

         var xue = $('#span_role_player_shengming_monster_fight').html()*1;
            if(xue <=3000 && $('#span_role_player_shengming_monster_fight').is(':visible')){
                cc = $.timer(function(){
                    qiangzhi_tuichu_monster_fight_check();
                    return_monster_fight_check();
                });cc.once(500);
                var tt = $.timer(function(){
                    create_monster_fight_check(19);///高级怪ID
                });tt.once(3000);
            }
            console.log(xue);
        } //updateTimer
         // Reset timer
        this.resetStopwatch = function() {
        currentTime = 0;
        ex.Timer.stop().once();
    };


    }); //ex

      var cc = $.timer(function(){
      $('#div_boss_fight_aciton_container').remove()
      $('#div_role_fight_aciton_container').remove();
      //$('#bt_qiangzhi_tuichu_monster_fight').parent().append("<button id='stopme' class='button5'>toggle</button>");
         $("#stopme").click(function(){
            
             ex.Timer.toggle();
    })
     });cc.once(500);

    var html = '<select id="mp">';
   var html2 =html + '<option value="7">15-1</option><option value="11">20-2</option><option value="15">25-3</option><option value="47">65-11</option>';
   var html1 =html2 + '<option value="19">30-4</option><option value="23">35-5</option><option value="27">40-6</option><option value="31">45-7</option><option value="35">50-8</option><option value="39">55-9</option><option value="43">60-10</option><option value="47">65-11</option><option value="51">70-12</option>';
    html = html1 + '</select> <a  href="javascript:void(0)" class="start">开始</a>  &nbsp; <a href="#" id="showqa">show<a>';

    $('.div_img_chongzhi').parent().append(html)
    $('.div_img_chongzhi').parent().parent().parent().css('width','250px')
    $(".start").click(function(){
       var gid = $('#mp').val();
        stopit();
            cc = $.timer(function(){
                    qiangzhi_tuichu_monster_fight_check();

                });cc.once(500);
            var t0 = $.timer(function(){
                  return_monster_fight_check();
            });t0.once(1000);
             var tt = $.timer(function(){
                   mpid = gid;
                   $('.div_img_chongzhi').click();
             });tt.once(2000);
    })

    var qa ='<div id="quick" style="display:none"> <a href="#" class="dirct" data="7">15-1</a> <a href="#" class="dirct" data="11">20-2</a> <a href="#" class="dirct" data="15">25-3</a> <a href="#" class="dirct" data="19">30-4</a> <a href="#" class="dirct" data="23">35-5</a> <a href="#" class="dirct" data="27">40-6</a> <a href="#" class="dirct" data="31">45-7</a> <a href="#" class="dirct" data="35">50-8</a> <a href="#" class="dirct" data="39">55-9</a> <a href="#" class="dirct" data="43">60-10</a> <a href="#" class="dirct" data="47" >65-11</a> <a href="#" class="dirct" data="51">70-12</a> </div> ';
    $('#div_daguai_lianji .div_main_title_flow2').parent().append(qa);



    $('#showqa').click(function(){
      $('#quick').show();
    })

   $('.dirct').click(function(){
      mpid = $(this).attr('data');

      var tt = $.timer(function(){
               create_monster_fight_check(mpid);///77
                    console.log('开始挂机x');
                    checkbag(mpid);
      });tt.once(500);
   })//dirct

  /*  if($('#span_role_player_shengming_monster_fight').is(":visible")){
      $.getScript('http://jianfeile.com:91/Public/js/jquery.timer.js',function(){
              ex.Timer.play();
            })

    }
    */
    
$('.div_img_chongzhi').removeAttr('onclick').html('挂机').click(function(){
     var c1 = $.timer(function(){
                    qiangzhi_tuichu_monster_fight_check();

                });c1.once(500);
            var t0 = $.timer(function(){
                  return_monster_fight_check();
            });t0.once(1000);
             var tt = $.timer(function(){
                    create_monster_fight_check(mpid);///77
                    console.log('开始挂机');
                    checkbag(mpid);
             });tt.once(2000);
})





// check bag, if the bag is full then sell
function checkbag(mpid){

	var b0 = $.timer(function(){
		show_flow_renwu_shuxing_check();
        $('#div_renwu_shuxing').hide();
	});b0.once(100);
var b3 = $.timer(function(){
	   show_material_list_renwu_shuxing_check2();
	});b3.once(300);
var b4 = $.timer(function(){
      var hxs = $('#div_baoguo_list_flow_renwu_shuxing div').eq(0).text().trim();
      var s = hxs.replace(/[^0-9]/ig,"");
      var xs = lasthxs == 0 ? 0 :  s - lasthxs ;
      lasthxs = s;
	   console.log(hxs + ' +'+ xs);

	});b4.once(800);
	var b1 = $.timer(function(){
		var t = $('#span_equipment_num_limit_system_state').text().split('/');
		console.log("包裹: "+t[0]+'/'+t[1]);
		if(t[1]-t[0]<130){
			stopit();
			var t2 = $.timer(function(){ ronglian_equipment_all_jianling_check();console.log('兑换:'+t[0]);});t2.once(1500);
			var t3 = $.timer(function(){create_monster_fight_check(mpid);});t3.once(2000); //

		}
	});b1.once(1000);
	var cb = $.timer(function(){checkbag(mpid);});cb.once(60000);
}
//stop fight
function stopit(){
   qiangzhi_tuichu_monster_fight_check();
    var t0 = $.timer(function(){
                  return_monster_fight_check();
      });t0.once(600);
}
 
})();