// ==UserScript==
// @name 怪物归来
// @namespace http://tampermonkey.net/
// @version 2.0
// @description The monster come back,you'll game over!
// @author Jack
// @match http://*.gwgl.xh456.com/index.aspx
/* @require https://greasyfork.org/scripts/367762-jquery-timer-js/code/jquerytimerjs.js?version=596413 */
// @require https://greasyfork.org/scripts/3465-jquery-timers/code/jQuerytimers.js?version=10415
// @grant none
// @downloadURL none
// ==/UserScript==
(function() {
'use strict';
var mpid = 27; //30级
var lasthxs = 0;
// 移除daoguang
$('#div_boss_fight_aciton_container').remove()
$('#div_role_fight_aciton_container').remove();
//list
var html = ' 开始 show';
$('.div_img_chongzhi').parent().append(html)
$('.div_img_chongzhi').parent().parent().parent().css('width','250px');
//
$(".start").click(function(){
var gid = $('#mp').val();
// stopit();
$('body').oneTime('5ds',function(){
qiangzhi_tuichu_monster_fight_check();
console.log("----------停止战斗----------");
});
$('body').oneTime('10ds',function(){
return_monster_fight_check();
console.log('退出fight');
});
$('body').oneTime('20ds',function(){
mpid = gid;
//$('.div_img_chongzhi').click();
create_monster_fight_check(mpid);///77
console.log('开始挂机');
$('body').stopTime('B');
$('body').oneTime('1s',function(){checkbag(mpid);});
$('body').everyTime('60s','B',function(){checkbag(mpid);});
});
})
var qa =' ';
$('#div_daguai_lianji .div_main_title_flow2').parent().append(qa);
$('#showqa').click(function(){
$('#quick').show();
})
$('.dirct').click(function(){
mpid = $(this).attr('data');
$('body').oneTime('5ds',function(){
$('body').stopTime('B');
create_monster_fight_check(mpid);///77
console.log('开始挂机x');
$('body').oneTime('1s',function(){checkbag(mpid);});
$('body').everyTime('60s','B',function(){checkbag(mpid);});
});
})//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(){
$('body').oneTime('5ds',function(){
qiangzhi_tuichu_monster_fight_check();
});
$('body').oneTime('10ds',function(){
return_monster_fight_check();
});
$('body').oneTime('20ds',function(){
create_monster_fight_check(mpid);///77
console.log('开始挂机');
$('body').stopTime('B');
$('body').oneTime('1s',function(){checkbag(mpid);});
$('body').everyTime('60s','B',function(){checkbag(mpid);});
});
})
// check bag, if the bag is full then sell
function checkbag(mpid){
$('body').oneTime('1ds',function(){
show_flow_renwu_shuxing_check();
$('#div_renwu_shuxing').hide();
});
$('body').oneTime('3ds',function(){
show_material_list_renwu_shuxing_check2();
});
$('body').oneTime('8ds',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);
});
$('body').oneTime('10ds',function(){
var t = $('#span_equipment_num_limit_system_state').text().split('/');
console.log("包裹: "+t[0]+'/'+t[1]);
if(t[1]-t[0]<20){
stopit();
$('body').oneTime('15ds',function(){
ronglian_equipment_all_jianling_check();
console.log('兑换:'+t[0]);
});
$('body').oneTime('20ds',function(){
create_monster_fight_check(mpid);
}); //
}
});
var s = 0;
$('body').stopTime('SS');
$('body').everyTime('1s','SS',function(){
s++;
$('#Button1').html('查看 '+ s +'s');
})
}
//stop fight
function stopit(){
qiangzhi_tuichu_monster_fight_check();
$('body').oneTime('6ds',function(){
return_monster_fight_check();
console.log('stopme战斗');
});
}
})();