2
下面的代碼打印出「壘」,但蠕變只是靜止不修復。它使用文檔中提到的代碼段。根據文件,結構可以修復,並且壘是結構。怎麼了?修復蠕變不修復壘
module.exports = function(creep) {
var target = creep.pos.findNearest(Game.MY_STRUCTURES, {
filter: function(object) {
return object.hits < object.hitsMax;
}
});
if(target) {
console.log("_________" + target.structureType);
creep.moveTo(target);
creep.repair(target);
}
}
謝謝,應該這樣做。 – PascalVKooten 2014-11-21 11:35:53
不錯,這些錯誤代碼確實會有很大幫助。順便說一句,使用Chrome瀏覽器,我有一個視覺錯誤的console.log,其中時間和我的輸出重疊(因此我使用「_______」)。這是一個已知的錯誤? – PascalVKooten 2014-11-21 11:42:53
不,請發送截圖給我們[email protected] – artch 2014-11-21 11:57:13