Can the documentation include information like terrain?



  • I'm asking because I have no idea how to reference the terrain's type when I do .lookForAt('terrain')



  • function findTerrain(spawn){
    if (spawn.room.memory.swamps){
    return;
    }
    var terrain = spawn.room.lookForAtArea('terrain', 1, 1, 48, 48);

    var plains = [];
    var swamps = [];
    
    
    _.each(terrain, function(col, y){
        _.each(col, function(cell, x){
    
         if (cell == 'swamp'){
             swamps.push(""+ x + "_" + y);
         }
    
         if (cell == 'plain'){
             plains.push(""+ x + "_" + y);
         }
    
     });
    });
    spawn.room.memory.swamps = swamps;
    spawn.room.memory.plains = plains;
    

    }