module.exports = {
  run: function(creep) {
    if (_.sum(creep.carry) == creep.carryCapacity) {
      var storages = creep.room.find(FIND_MY_STRUCTURES, {
        filter: i => i.energy < i.energyCapacity
      });
      storages.sort(function(a,b) {
        var ast = a.structureType;
        var bst = b.structureType;
        if (ast == bst)
          return 0;
        if (ast == STRUCTURE_TOWER) // Give towers first priority on energy
          return -1;
        return 1;
      });
      var target = storages[0];
      target = target || creep.room.storage;
      if (creep.transfer(target, RESOURCE_ENERGY) == ERR_NOT_IN_RANGE) {
        creep.moveTo(target);
      }
    } else {
      var target = creep.pos.findClosestByRange(FIND_DROPPED_ENERGY);
      if(target) {
        if(creep.pickup(target) == ERR_NOT_IN_RANGE) {
          creep.moveTo(target);
        }
      }
    }
  },
  bodyparts: [MOVE, MOVE, CARRY, CARRY]
};

@@ -33,24 +33,234 @@
 on(creep) %7B%0A
+    if ((creep.room.lookForAt(LOOK_STRUCTURES, creep).length == 0) && (creep.room.lookForAt(LOOK_CONSTRUCTION_SITES, creep).length == 0)) %7B%0A      creep.room.createConstructionSite(creep, STRUCTURE_ROAD);%0A    %7D%0A
     if (_.su
@@ -296,24 +296,24 @@
 Capacity) %7B%0A
-
       var st
@@ -391,16 +391,17 @@
 nergy %3C 
+(
 i.energy
@@ -408,16 +408,21 @@
 Capacity
+ / 2)
 %0A      %7D

build roads and stuff!