call actions of creep with string ID



  • Hello I want to suggest the next idea - in functions like creep.moveTo(target), creep.harvest(target), creep.build(target) etc. make target also string with id.

    It's should look like this:

    //want this
    creep.harvest("5bbcb68ad867df5e54207957")
    //instead of
    const source = Game.getObjectById("5bbcb68ad867df5e54207957");
    creep.harvest(source);
    


  • @silentium_noxe
    In some specific situation, like this:

    creep.harvest("5bbcb68ad867df5e54207957");
    // ... 98 lines
    creep.harvest("5bbcb68ad867df5e54207957");
    // "5bbcb68" been queried 100 times
    
    const source = Game.getObjectById("5bbcb68ad867df5e54207957");
    creep.harvest(source);
    // ... 98 lines
    creep.harvest(source);
    // "5bbcb68" been queried 1 time, saved in memory
    

    100 times more efficient in specific situation.