⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 resource_auto_grow.js2

📁 Download you own three BR
💻 JS2
字号:
function resource_auto_grow(){	//更新资源////////////////////////////	var auto_resource = new XMLHttpRequest();	if (auto_resource) {        auto_resource.onreadystatechange = function() {            if (auto_resource.readyState == 4 && (auto_resource.status == 200 || auto_resource.status == 304)) {                //粮食                document.getElementById("rices").innerHTML='<span style=\"cursor:hand;\" title=\"'+ars[1]+'\">'+ars[1]+'</span>';                //木材                document.getElementById("woods").innerHTML='<span style=\"cursor:hand;\" title=\"'+ars[2]+'\">'+ars[2]+'</span>';                //矿石                document.getElementById("irons").innerHTML='<span style=\"cursor:hand;\" title=\"'+ars[3]+'\">'+ars[3]+'</span>';                //黄金                document.getElementById("golds").innerHTML='<span style=\"cursor:hand;\" title=\"'+ars[4]+'\">'+ars[4]+'</span>';                //总人口                document.getElementById("total_house").innerHTML='<span style=\"cursor:hand;\" title=\"总人口\">'+ars[9]+'</span>';                //剩余人口                if(parseInt(ars[28])<0) color='RED';                else color='#734921';                document.getElementById("free_house").innerHTML='<span style=\"cursor:hand; color:'+color+'\" title=\"剩余人口\">'+ars[28]+'</span>';                //土地                document.getElementById("city_size").innerText = 200 - parseInt(ars[11]);                //当前城市士兵数                var current_city_soldiers=Math.floor(ars[15]/10000);                if(current_city_soldiers >=1) current_city_soldiers_value = (current_city_soldiers + '万');                else current_city_soldiers_value = ars[15];                document.getElementById("current_city_soldiers").innerHTML='<span style=\"cursor:hand;\" title=\"士兵:'+ars[15]+'\">'+current_city_soldiers_value+'</span>';                                document.getElementById("current_city_officers").innerText = ars[16];//武将数                document.getElementById("total_citys").innerText = ars[22];//总城池数                document.getElementById("total_officers").innerText = ars[23];//总武将数                document.getElementById("union_name").innerText = ars[24];//联盟                if(parseInt(ars[24])=="" || parseInt(ars[24])=="0") document.getElementById("union_name").innerText = '无';//联盟                document.getElementById("citywall_status").innerHTML = "<a href=\"build.php?build_page=recovery\" target=\"main\">"+ars[25]+"%";//城墙状态                document.getElementById("p_grade").innerText = ars[26];//玩家等级                var percent = Math.floor(ars[0]/ars[27]*100);                if(percent>100) percent=100;                document.getElementById("p_score").innerHTML = '<span id=\"p_score\">'+ars[0]+'/'+ars[27]+'</span>';                //在线人数                document.getElementById("online").innerText = ars[29];                //排名                document.getElementById("rank").innerText = ars[30];                            }        };    var now=new Date();	var verifycode=now.getTime();    auto_resource.open('GET', 'UpdateResource.php?verifycode='+verifycode);    auto_resource.send(null);    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -