Flag / Controller



  • Hi,

     

    I'm trying to have efficients claimer because at low RCL they are costly. What I'm trying to do is analyze the situation in the targeted room (by a flag) to know if I have to spawn a claimer to make the reservation ticks go up. The problem is that I have no vision in the room so I can't check the controller (I didn't unlock the observer yet), is there any workarround ?

     

    Thanks,

    Shadow_Bird



  • You can send a scout to observe that room first, or just send out claimer (if you store last know reservation data first). You can store room reservation information in Memory. The idea is whenever that room is visible update reservation tick to Memory object. If you have no vision on that room you should use information in Memory object. Below are my code for this, it may give you some idea

     

    Room.prototype.reserveRoom = function(creepName, roomName, scoutPath, x, y, time, body, roomTickMem) {
    var room = this;
    if (Game.creeps[creepName]) {
    if (Game.creeps[creepName].room.name == roomName && Game.creeps[creepName].room.controller.reservation) {
    Memory.info[tickMem] = Game.creeps[creepName].room.controller.reservation.ticksToEnd;
    } else {
    Memory.info[tickMem] = undefined;
    }
    } else {
    if (!Memory.info[roomTickMem] || Memory.info[roomTickMem]-- < time) {
    // Create new claimer creep to reserve room
    ...
    }
    }
    };

    I use creep name to identify it role in which room, ex my reservation creep is named Claimer-E19N32. And for Memory.info object, I've initialized it somewhere in my code before I use it.

    👏


  • Thanks,

    I was writting the scout way but I didn't though about simulating my own ticksToEnd ;).