naxform.blogg.se

Screeps scripts
Screeps scripts





screeps scripts

Now with only 1 harvester working, there's only 1 dumping-pile of energy on the ground. Assume all energy on the ground has been previously collected. Let's imagine only ONE harvester is currently working. Hard code might cause problems if the array isn't that long. In instances where the only dropped resources are from x2 harvesters, there will only ever be index's and. I understand you're trying to send particular creeps to a split of destinations, but I'm pretty sure has been missed a few times. I see a number of uses of and yet hasn't been used at all.

  • Use console.log( "Did this line execute?" + valuesOutput ) debugging lines in your creep execution loop to test where the code is getting up to.
  • Var closestHostile = (FIND_HOSTILE_CREEPS) Var closestDamagedStructure = (FIND_STRUCTURES,įilter: (structure) => structure.hits < structure.hitsMax Var newName = (, undefined, ) Ĭonsole.log('Spawning new repairer: ' + newName)

    screeps scripts

    Var miners = _.filter(Game.creeps, (creep) => = 'miner') Ĭonsole.log('Harvesters: ' + harvesters.length, 'Builders: ' + builders.length, 'Upgraders: ' + upgraders.length, 'Repairers: ' + repairers.length, 'Miners: ' + miners.length) Ĭonsole.log('Room "'+name+'" has '++' energy') Ĭonsole.log('Clearing non-existing creep memory:', name) Var repairers = _.filter(Game.creeps, (creep) => = 'repairer') Var upgraders = _.filter(Game.creeps, (creep) => = 'upgrader') Var builders = _.filter(Game.creeps, (creep) => = 'builder') Var harvesters = _.filter(Game.creeps, (creep) => = 'harvester') var creepControl = require('creepControl') Var roleRepairer = require('role.repairer') Var roleBuilder = require('role.builder')

    screeps scripts

    Var roleUpgrader = require('role.upgrader') Var roleHarvester = require('role.harvester')







    Screeps scripts